API 0.9.5
CPSound Class Reference

#import <CPSound.h>

Inheritance diagram for CPSound:

List of all members.

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

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

Synthesized accessor method.

Definition at line 339 of file CPSound.j.

- (double) duration

Returns the duration in seconds of the sound.

Returns:
double the duration

Definition at line 301 of file CPSound.j.

- (id) init

Definition at line 56 of file CPSound.j.

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

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 

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

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

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

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

Synthesized accessor method.

Definition at line 323 of file CPSound.j.

- (BOOL) pause

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

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

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

Synthesized accessor method.

Definition at line 347 of file CPSound.j.

- (void) setLoops: (BOOL)  shouldLoop

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

Synthesized accessor method.

Definition at line 331 of file CPSound.j.

- (void) setVolume: (double)  aVolume

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

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

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:
 All Classes Files Functions Variables Defines