API  1.0.0
CPSound Class Reference

#import <CPSound.h>

+ Inheritance diagram for CPSound:

Instance Methods

(id) - delegate
 
(double) - duration
 
(id) - init
 
(id) - initWithContentsOfFile:byReference:
 
(id) - initWithContentsOfURL:byReference:
 
(id) - initWithData:
 
(BOOL) - isPlaying
 
(BOOL) - loops
 
(CPString- name
 
(BOOL) - pause
 
(BOOL) - play
 
(BOOL) - resume
 
(void) - setDelegate:
 
(void) - setLoops:
 
(void) - setName:
 
(void) - setVolume:
 
(BOOL) - stop
 
(double) - volume
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - awakeFromCib
 
(void) - bind:toObject:withKeyPath:options:
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(id) - copy
 
(void) - dealloc
 
(CPString- description
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray) - exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(BOOL) - isEqual:
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableCopy
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(void) - performSelector:withObject:afterDelay:
 
(void) - performSelector:withObject:afterDelay:inModes:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(void) - removeObserver:forKeyPath:
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKey:
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

Additional Inherited Members

- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(BOOL) + automaticallyNotifiesObserversForKey:
 
(void) + cancelPreviousPerformRequestsWithTarget:
 
(void) + cancelPreviousPerformRequestsWithTarget:selector:object:
 
(Class) + class
 
(BOOL) + conformsToProtocol:
 
(void) + exposeBinding:
 
(void) + initialize
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesImplementSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isBindingExclusive:
 
(BOOL) + isSubclassOfClass:
 
(CPSet) + keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + object:performSelector:withObject:afterDelay:inModes:
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

Detailed Description

CPSound provides a way to load and play sounds. In the browser it relies on the HTML5 audio tag being available.

CPSound delegate:

  • sound:didFinishPlaying: called when sound has finished to played

Definition at line 2 of file CPSound.h.

Method Documentation

◆ delegate()

- (id) delegate
implementation

Synthesized accessor method.

Provided by category CPSound(CPSynthesizedAccessors).

Definition at line 387 of file CPSound.j.

◆ duration()

- (double) duration
implementation

Returns the duration in seconds of the sound.

Returns
double the duration

Definition at line 332 of file CPSound.j.

◆ init()

- (id) init
implementation

Initializes the receiver

Returns
the initialized receiver

Reimplemented from CPObject.

Definition at line 69 of file CPSound.j.

◆ initWithContentsOfFile:byReference:()

- (id) initWithContentsOfFile: (CPString aFile
byReference: (BOOL)  byRef 
implementation

Initialize with the sound contents of the URL represented by aFile.

Parameters
aFileCPString the path of the sound
byRefignored (Cocoa compatibility)

Definition at line 107 of file CPSound.j.

◆ initWithContentsOfURL:byReference:()

- (id) initWithContentsOfURL: (CPURL aURL
byReference: (BOOL)  byRef 
implementation

Initialize with the sound contents of the file located at aURL.

Parameters
aURLCPURL containing the URL of the sound
byRefignored (Cocoa compatibility)

Definition at line 124 of file CPSound.j.

◆ initWithData:()

- (id) initWithData: (CPData someData
implementation

Initialize with the sound contents of someData.

Parameters
someDataCPData containing the sound
byRefignored (Cocoa compatibility)

Definition at line 135 of file CPSound.j.

◆ isPlaying()

- (BOOL) isPlaying
implementation

Returns if the sound is playing or not.

Returns
BOOL YES if the sound is playing, NO otherwise

Definition at line 342 of file CPSound.j.

◆ loops()

- (BOOL) loops
implementation

Return YES if the sound is in loop mode.

Returns
BOOL YES if in loop mode, NO otherwise

Definition at line 284 of file CPSound.j.

◆ name()

- (CPString) name
implementation

Synthesized accessor method.

Provided by category CPSound(CPSynthesizedAccessors).

Definition at line 371 of file CPSound.j.

◆ pause()

- (BOOL) pause
implementation

Pause the sound.

Returns
YES when the receiver is playing its audio data, NO otherwise.

Definition at line 250 of file CPSound.j.

◆ play()

- (BOOL) play
implementation

Play the sound.

Returns
YES when the receiver is playing its audio data, NO otherwise.

Definition at line 207 of file CPSound.j.

◆ resume()

- (BOOL) resume
implementation

Resume playback of a paused sound.

Returns
YES when the receiver is playing its audio data, NO otherwise.

Definition at line 267 of file CPSound.j.

◆ setDelegate:()

- (void) setDelegate: (id)  aDelegate
implementation

Sets the sound's delegate.

Parameters
aDelegatethe new delegate

Provided by category CPSound(CPSynthesizedAccessors).

Definition at line 154 of file CPSound.j.

◆ setLoops:()

- (void) setLoops: (BOOL)  shouldLoop
implementation

Specifies whether the sound should repeat.

Parameters
BOOLYES for loop mode, NO otherwise

Definition at line 294 of file CPSound.j.

◆ setName:()

- (void) setName: (CPString aValue
implementation

Synthesized accessor method.

Provided by category CPSound(CPSynthesizedAccessors).

Definition at line 379 of file CPSound.j.

◆ setVolume:()

- (void) setVolume: (double)  aVolume
implementation

Set the volume the sound should be played at.

Parameters
doublea volume value between 0.0 and 1.0

Definition at line 314 of file CPSound.j.

◆ stop()

- (BOOL) stop
implementation

Stop the sound.

Returns
YES when the receiver is playing its audio data, NO otherwise.

Definition at line 230 of file CPSound.j.

◆ volume()

- (double) volume
implementation

Returns the volume of the receiver.

Returns
double from 0.0 to 1.0

Definition at line 304 of file CPSound.j.


The documentation for this class was generated from the following files: