ObjectAL
 All Classes Functions Variables Properties Pages
Instance Methods | Class Methods | Protected Attributes | Properties | List of all members
ALChannelSource Class Reference

A Sound source composed of other sources. More...

#import <ALChannelSource.h>

Inheritance diagram for ALChannelSource:
<ALSoundSource>

Instance Methods

(id) - initWithSources:
 Initialize a channel with a number of sources. More...
 
(void) - setDefaultsFromSource:
 Set this channel's default values from those in the specified source. More...
 
(void) - resetToDefault
 Reset all sources in this channel to their default state. More...
 
(void) - addSource:
 Add a source to this channel. More...
 
(id< ALSoundSource >) - removeSource:
 Remove a source from the channel. More...
 
(ALChannelSource *) - splitChannelWithSources:
 Split the specified number of sources from this channel, creating a new channel. More...
 
(void) - addChannel:
 Absorb another channel's sources into this one. More...
 
(NSArray *) - clearUnusedBuffers
 Set all buffers in all non-playing sources to nil. More...
 
(BOOL) - removeBuffersNamed:
 Remove all instances of the specified buffer. More...
 
- Instance Methods inherited from <ALSoundSource>
(id< ALSoundSource >) - play:
 Play a sound. More...
 
(id< ALSoundSource >) - play:loop:
 Play a sound, optionally looping. More...
 
(id< ALSoundSource >) - play:gain:pitch:pan:loop:
 Play a sound, setting gain, pitch, pan, and looping. More...
 
(void) - stop
 Stop playing the current sound. More...
 
(void) - rewind
 Stop playing the current sound and set its state to AL_INITIAL. More...
 
(void) - fadeTo:duration:target:selector:
 Fade to the specified gain value. More...
 
(void) - stopFade
 Stop the currently running fade operation, if any. More...
 
(void) - panTo:duration:target:selector:
 pan to the specified value. More...
 
(void) - stopPan
 Stop the currently running pan operation, if any. More...
 
(void) - pitchTo:duration:target:selector:
 Gradually change pitch to the specified value. More...
 
(void) - stopPitch
 Stop the currently running pitch operation, if any. More...
 
(void) - stopActions
 Stop any currently running fade, pan, or pitch operations. More...
 
(void) - clear
 Clear any buffers this source is currently using. More...
 

Class Methods

(id) + channelWithSources:
 Create a channel with a number of sources. More...
 

Protected Attributes

bool defaultsInitialized
 If YES, the defaults of this channel have been initialized. More...
 
float pitch
 
float gain
 
float maxDistance
 
float rolloffFactor
 
float referenceDistance
 
float minGain
 
float maxGain
 
float coneOuterGain
 
float coneInnerAngle
 
float coneOuterAngle
 
float reverbSendLevel
 
float reverbOcclusion
 
float reverbObstruction
 
ALPoint position
 
ALVector velocity
 
ALVector direction
 
int sourceRelative
 
int sourceType
 
bool looping
 
float defaultPitch
 Default pitch. More...
 
float defaultGain
 Default gain. More...
 
float defaultMaxDistance
 Default max distance. More...
 
float defaultRolloffFactor
 Default rolloff factor. More...
 
float defaultReferenceDistance
 Default reference distance. More...
 
float defaultMinGain
 Default min gain. More...
 
float defaultMaxGain
 Default max gain. More...
 
float defaultConeOuterGain
 Default cone outer gain. More...
 
float defaultConeInnerAngle
 Default cone inner angle. More...
 
float defaultConeOuterAngle
 Default cone outer angle. More...
 
ALPoint defaultPosition
 Default position. More...
 
ALVector defaultVelocity
 Default veloxity. More...
 
ALVector defaultDirection
 Default direction. More...
 
int defaultSourceRelative
 Default source relative. More...
 
int defaultSourceType
 Default source type. More...
 
bool defaultLooping
 Default looping. More...
 
float defaultReverbSendLevel
 Default reverb send level. More...
 
float defaultReverbOcclusion
 Default occlusion. More...
 
float defaultReverbObstruction
 Default obstruction. More...
 
bool interruptible
 
bool muted
 
bool paused
 
id fadeCompleteTarget
 Target to inform when the current fade operation completes. More...
 
SEL fadeCompleteSelector
 Selector to call when the current fade operation completes. More...
 
int expectedFadeCallbackCount
 The expected number of sources that will callback when fading completes. More...
 
int currentFadeCallbackCount
 The actual number of sources that have called back. More...
 
id panCompleteTarget
 Target to inform when the current pan operation completes. More...
 
SEL panCompleteSelector
 Selector to call when the current pan operation completes. More...
 
int expectedPanCallbackCount
 The expected number of sources that will callback when panning completes. More...
 
int currentPanCallbackCount
 The actual number of sources that have called back. More...
 
id pitchCompleteTarget
 Target to inform when the current pitch operation completes. More...
 
SEL pitchCompleteSelector
 Selector to call when the current pitch operation completes. More...
 
int expectedPitchCallbackCount
 The expected number of sources that will callback when pitch op completes. More...
 
int currentPitchCallbackCount
 The actual number of sources that have called back. More...
 

Properties

ALContextcontext
 This source's owning context. More...
 
ALSoundSourcePoolsourcePool
 Pool holding the actual sources. More...
 
int reservedSources
 The number of sources reserved by this channel. More...
 
- Properties inherited from <ALSoundSource>
float coneInnerAngle
 Cone inner angle (OpenAL property). More...
 
float coneOuterAngle
 Cone outer angle (OpenAL property). More...
 
float coneOuterGain
 Cone outer gain (OpenAL property). More...
 
ALVector direction
 Direction (OpenAL property). More...
 
float gain
 Gain (volume) (OpenAL property). More...
 
float volume
 Volume (alias to gain). More...
 
bool interruptible
 If true, this source may be interrupted when resources are low. More...
 
bool looping
 Looping (OpenAL property). More...
 
float maxDistance
 Max distance (OpenAL property). More...
 
float maxGain
 Max gain (OpenAL property). More...
 
float minGain
 Min gain (OpenAL property). More...
 
bool muted
 If true, this source is muted. More...
 
bool paused
 If true, this source is currently paused. More...
 
float pitch
 Pitch (OpenAL property). More...
 
bool playing
 If true, this source is currently playing audio. More...
 
ALPoint position
 Position (OpenAL property). More...
 
float referenceDistance
 Reference distance (OpenAL property). More...
 
float rolloffFactor
 Rolloff factor (OpenAL property). More...
 
int sourceRelative
 Source relative (OpenAL property). More...
 
int sourceType
 Source type (OpenAL property). More...
 
ALVector velocity
 Velocity (OpenAL property). More...
 
float pan
 Pan value (-1.0 = far left, 1.0 = far right). More...
 
float reverbSendLevel
 Reverb send level (how much reverb affects this source). More...
 
float reverbOcclusion
 Reverb occlusion (wall/door between listener and source). More...
 
float reverbObstruction
 Reverb obstruction (object between listener and source). More...
 

Detailed Description

A Sound source composed of other sources.

Property values are applied to all sources within the channel.
Sounds will get played by any free sources within this channel.
If all sources are busy when playback is requested, it will attempt to interrupt a source to free it for playback.

Method Documentation

- (void) addChannel: (ALChannelSource*)  channel

Absorb another channel's sources into this one.

All of the channel's sources will be moved into this channel.

Parameters
channelThe channel to absorb sources from.
- (void) addSource: (id<ALSoundSource>)  source

Add a source to this channel.

Parameters
sourceThe source to add.
+ (id) channelWithSources: (int)  reservedSources

Create a channel with a number of sources.

Parameters
reservedSourcesthe number of sources to reserve for this channel.
Returns
A new channel.
- (NSArray *) clearUnusedBuffers

Set all buffers in all non-playing sources to nil.

Returns
A list of buffers that were cleared.
- (id) initWithSources: (int)  reservedSources

Initialize a channel with a number of sources.

Parameters
reservedSourcesthe number of sources to reserve for this channel.
Returns
The initialized channel.
- (BOOL) removeBuffersNamed: (NSString*)  name

Remove all instances of the specified buffer.

Parameters
nameThe name of the buffer.
Returns
NO if any of the matching buffers are currently being played.
- (id< ALSoundSource >) removeSource: (id<ALSoundSource>)  source

Remove a source from the channel.

Parameters
sourceThe source to remove. If nil, remove any source.
Returns
The source that was removed.
- (void) resetToDefault

Reset all sources in this channel to their default state.

- (void) setDefaultsFromSource: (id<ALSoundSource>)  source

Set this channel's default values from those in the specified source.

Parameters
sourcethe source to set default values from.
- (ALChannelSource *) splitChannelWithSources: (int)  numSources

Split the specified number of sources from this channel, creating a new channel.

Parameters
numSourcesThe number of sources to split off
Returns
A new channel with the split-off sources.

Member Data Documentation

- (int) currentFadeCallbackCount
protected

The actual number of sources that have called back.

- (int) currentPanCallbackCount
protected

The actual number of sources that have called back.

- (int) currentPitchCallbackCount
protected

The actual number of sources that have called back.

- (float) defaultConeInnerAngle
protected

Default cone inner angle.

- (float) defaultConeOuterAngle
protected

Default cone outer angle.

- (float) defaultConeOuterGain
protected

Default cone outer gain.

- (ALVector) defaultDirection
protected

Default direction.

- (float) defaultGain
protected

Default gain.

- (bool) defaultLooping
protected

Default looping.

- (float) defaultMaxDistance
protected

Default max distance.

- (float) defaultMaxGain
protected

Default max gain.

- (float) defaultMinGain
protected

Default min gain.

- (float) defaultPitch
protected

Default pitch.

- (ALPoint) defaultPosition
protected

Default position.

- (float) defaultReferenceDistance
protected

Default reference distance.

- (float) defaultReverbObstruction
protected

Default obstruction.

- (float) defaultReverbOcclusion
protected

Default occlusion.

- (float) defaultReverbSendLevel
protected

Default reverb send level.

- (float) defaultRolloffFactor
protected

Default rolloff factor.

- (bool) defaultsInitialized
protected

If YES, the defaults of this channel have been initialized.

- (int) defaultSourceRelative
protected

Default source relative.

- (int) defaultSourceType
protected

Default source type.

- (ALVector) defaultVelocity
protected

Default veloxity.

- (int) expectedFadeCallbackCount
protected

The expected number of sources that will callback when fading completes.

- (int) expectedPanCallbackCount
protected

The expected number of sources that will callback when panning completes.

- (int) expectedPitchCallbackCount
protected

The expected number of sources that will callback when pitch op completes.

- (SEL) fadeCompleteSelector
protected

Selector to call when the current fade operation completes.

- (id) fadeCompleteTarget
protected

Target to inform when the current fade operation completes.

- (SEL) panCompleteSelector
protected

Selector to call when the current pan operation completes.

- (id) panCompleteTarget
protected

Target to inform when the current pan operation completes.

- (SEL) pitchCompleteSelector
protected

Selector to call when the current pitch operation completes.

- (id) pitchCompleteTarget
protected

Target to inform when the current pitch operation completes.

Property Documentation

- (ALContext *) context
readnonatomicretain

This source's owning context.

- (int) reservedSources
readwritenonatomicassign

The number of sources reserved by this channel.

- (ALSoundSourcePool *) sourcePool
readnonatomicretain

Pool holding the actual sources.

All sources being used by this channel.

Do not modify!


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