cocos2d-x  3.3rc0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CDSoundSource Class Reference

CDSoundSource is a wrapper around an OpenAL sound source. More...

#import <CocosDenshion.h>

Inheritance diagram for CDSoundSource:
<CDAudioTransportProtocol> <CDAudioInterruptProtocol> <CDAudioTransportProtocol> <CDAudioInterruptProtocol>

Instance Methods

(id- init:sourceIndex:soundEngine:
 Do not init yourself, get an instance from the sourceForSound factory method on CDSoundEngine. More...
 
var - init:sourceIndex:soundEngine:
 Do not init yourself, get an instance from the sourceForSound factory method on CDSoundEngine. More...
 
local - init:sourceIndex:soundEngine:
 Do not init yourself, get an instance from the sourceForSound factory method on CDSoundEngine. More...
 
(id- init:sourceIndex:soundEngine:
 Do not init yourself, get an instance from the sourceForSound factory method on CDSoundEngine. More...
 
var - init:sourceIndex:soundEngine:
 Do not init yourself, get an instance from the sourceForSound factory method on CDSoundEngine. More...
 
local - init:sourceIndex:soundEngine:
 Do not init yourself, get an instance from the sourceForSound factory method on CDSoundEngine. More...
 
- Instance Methods inherited from <CDAudioTransportProtocol>
(BOOL) - play
 Play the audio. More...
 
(BOOL) - pause
 Pause the audio, retain resources. More...
 
var - pause
 Pause the audio, retain resources. More...
 
local - pause
 Pause the audio, retain resources. More...
 
(BOOL) - stop
 Stop the audio, release resources. More...
 
(BOOL) - rewind
 Return playback to beginning. More...
 
var - rewind
 Return playback to beginning. More...
 
local - rewind
 Return playback to beginning. More...
 
(BOOL) - play
 Play the audio. More...
 
(BOOL) - pause
 Pause the audio, retain resources. More...
 
var - pause
 Pause the audio, retain resources. More...
 
local - pause
 Pause the audio, retain resources. More...
 
(BOOL) - stop
 Stop the audio, release resources. More...
 
var - stop
 Stop the audio, release resources. More...
 
local - stop
 Stop the audio, release resources. More...
 
(BOOL) - rewind
 Return playback to beginning. More...
 
var - rewind
 Return playback to beginning. More...
 
local - rewind
 Return playback to beginning. More...
 
- Instance Methods inherited from <CDAudioInterruptProtocol>
(BOOL) - mute
 Is audio mute. More...
 
var - mute
 Is audio mute. More...
 
local - mute
 Is audio mute. More...
 
(void) - setMute:
 If YES then audio is silenced but not stopped, calls to start new audio will proceed but silently. More...
 
(BOOL) - enabled
 Is audio enabled. More...
 
(void) - setEnabled:
 If NO then all audio is stopped and any calls to start new audio will be ignored. More...
 
(BOOL) - mute
 Is audio mute. More...
 
var - mute
 Is audio mute. More...
 
local - mute
 Is audio mute. More...
 
(void) - setMute:
 If YES then audio is silenced but not stopped, calls to start new audio will proceed but silently. More...
 
(BOOL) - enabled
 Is audio enabled. More...
 
(void) - setEnabled:
 If NO then all audio is stopped and any calls to start new audio will be ignored. More...
 

Public Attributes

ALuint _sourceId
var _sourceId
local _sourceId
ALuint _sourceIndex
var _sourceIndex
local _sourceIndex
CDSoundEngine_engine
var _engine
local _engine
int _soundId
var _soundId
local _soundId
float _preMuteGain
var _preMuteGain
local _preMuteGain
BOOL enabled_
var enabled_
local enabled_
BOOL mute_
var mute_
local mute_

Properties

float pitch
float gain
float pan
BOOL looping
BOOL isPlaying
int soundId
float durationInSeconds
 Returns the duration of the attached buffer in seconds or a negative value if the buffer is invalid. More...
 
ALenum lastError
 Stores the last error code that occurred. More...
 

Detailed Description

CDSoundSource is a wrapper around an OpenAL sound source.

It allows you to manipulate properties such as pitch, gain, pan and looping while the sound is playing. CDSoundSource is based on the old CDSourceWrapper class but with much added functionality.

Since
v1.0

Method Documentation

- (id) init: (ALuint)  theSourceId
sourceIndex: (int)  index
soundEngine: (CDSoundEngine *)  engine 

Do not init yourself, get an instance from the sourceForSound factory method on CDSoundEngine.

- (id) init: var  theSourceId
sourceIndex: var  index
soundEngine: var  engine 

Do not init yourself, get an instance from the sourceForSound factory method on CDSoundEngine.

- (id) init: local  theSourceId
sourceIndex: local  index
soundEngine: local  engine 

Do not init yourself, get an instance from the sourceForSound factory method on CDSoundEngine.

- (id) init: (ALuint)  theSourceId
sourceIndex: (int)  index
soundEngine: (CDSoundEngine *)  engine 

Do not init yourself, get an instance from the sourceForSound factory method on CDSoundEngine.

- (id) init: var  theSourceId
sourceIndex: var  index
soundEngine: var  engine 

Do not init yourself, get an instance from the sourceForSound factory method on CDSoundEngine.

- (id) init: local  theSourceId
sourceIndex: local  index
soundEngine: local  engine 

Do not init yourself, get an instance from the sourceForSound factory method on CDSoundEngine.

Member Data Documentation

- (CDSoundEngine *) _engine
var _engine
local _engine
- (float) _preMuteGain
var _preMuteGain
local _preMuteGain
- (int) _soundId
var _soundId
local _soundId
- (ALuint) _sourceId
var _sourceId
local _sourceId
- (ALuint) _sourceIndex
var _sourceIndex
local _sourceIndex
- (BOOL) enabled_
var enabled_
local enabled_
- (BOOL) mute_
var mute_
local mute_

Property Documentation

- (float) durationInSeconds
readatomicassign

Returns the duration of the attached buffer in seconds or a negative value if the buffer is invalid.

var durationInSeconds
readatomicassign

Returns the duration of the attached buffer in seconds or a negative value if the buffer is invalid.

local durationInSeconds
readatomicassign

Returns the duration of the attached buffer in seconds or a negative value if the buffer is invalid.

- (float) gain
readwritenonatomicassign
var gain
readwritenonatomicassign
local gain
readwritenonatomicassign
- (BOOL) isPlaying
readatomicassign
var isPlaying
readatomicassign
local isPlaying
readatomicassign
- (ALenum) lastError
readatomicassign

Stores the last error code that occurred.

Check against AL_NO_ERROR

var lastError
readatomicassign

Stores the last error code that occurred.

Check against AL_NO_ERROR

- (BOOL) looping
readwritenonatomicassign
var looping
readwritenonatomicassign
local looping
readwritenonatomicassign
- (float) pan
readwritenonatomicassign
var pan
readwritenonatomicassign
local pan
readwritenonatomicassign
- (float) pitch
readwritenonatomicassign
var pitch
readwritenonatomicassign
local pitch
readwritenonatomicassign
- (int) soundId
readwritenonatomicassign
var soundId
readwritenonatomicassign
local soundId
readwritenonatomicassign

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