API  0.9.6
 All Classes Files Functions Variables Macros Modules Pages
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:
 
(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:
 
(Class) + class
 
(void) + exposeBinding:
 
(void) + initialize
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isSubclassOfClass:
 
(CPSet+ keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 
- Instance Variables inherited from CPObject
Class isa
 

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

- (id) delegate
implementation

Synthesized accessor method.

Provided by category CPSound(CPSynthesizedAccessors).

Definition at line 339 of file CPSound.j.

- (double) duration
implementation

Returns the duration in seconds of the sound.

Returns
double the duration

Definition at line 301 of file CPSound.j.

- (id) init
implementation

Initializes the receiver

Returns
the initialized receiver

Reimplemented from CPObject.

Definition at line 56 of file CPSound.j.

- (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 94 of file CPSound.j.

- (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 111 of file CPSound.j.

- (id) initWithData: (CPData someData
implementation

Initialize with the sound contents of someData.

Parameters
someDataCPData containing the sound
byRefignored (Cocoa compatibility)

Definition at line 122 of file CPSound.j.

- (BOOL) isPlaying
implementation

Returns if the sound is playing or not.

Returns
BOOL YES if the sound is playing, NO otherwise

Definition at line 311 of file CPSound.j.

- (BOOL) loops
implementation

Return YES if the sound is in loop mode.

Returns
BOOL YES if in loop mode, NO otherwise

Definition at line 253 of file CPSound.j.

- (CPString) name
implementation

Synthesized accessor method.

Provided by category CPSound(CPSynthesizedAccessors).

Definition at line 323 of file CPSound.j.

- (BOOL) pause
implementation

Pause the sound.

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

Definition at line 219 of file CPSound.j.

- (BOOL) play
implementation

Play the sound.

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

Definition at line 175 of file CPSound.j.

- (BOOL) resume
implementation

Resume playback of a paused sound.

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

Definition at line 236 of file CPSound.j.

- (void) setDelegate: (id)  aValue
implementation

Synthesized accessor method.

Provided by category CPSound(CPSynthesizedAccessors).

Definition at line 347 of file CPSound.j.

- (void) setLoops: (BOOL)  shouldLoop
implementation

Specifies whether the sound should repeat.

Parameters
BOOLYES for loop mode, NO otherwise

Definition at line 263 of file CPSound.j.

- (void) setName: (CPString aValue
implementation

Synthesized accessor method.

Provided by category CPSound(CPSynthesizedAccessors).

Definition at line 331 of file CPSound.j.

- (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 283 of file CPSound.j.

- (BOOL) stop
implementation

Stop the sound.

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

Definition at line 198 of file CPSound.j.

- (double) volume
implementation

Returns the volume of the receiver.

Returns
double from 0.0 to 1.0

Definition at line 273 of file CPSound.j.


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