ObjectAL  2.1
ObjectAL API Reference (iOS) for Kobold2D developers
<ALSoundSource> Protocol Reference

Manages all properties relating to an OpenAL sound source. More...

#include <ALSoundSource.h>

Inheritance diagram for <ALSoundSource>:

List of all members.

Public Member Functions

id< ALSoundSourceplay: (ALBuffer *buffer)
 Play a sound.
id< ALSoundSourceplay:loop: (ALBuffer *buffer,[loop] bool loop)
 Play a sound, optionally looping.
id< ALSoundSourceplay:gain:pitch:pan:loop: (ALBuffer *buffer,[gain] float gain,[pitch] float pitch,[pan] float pan,[loop] bool loop)
 Play a sound, setting gain, pitch, pan, and looping.
void stop ()
 Stop playing the current sound.
void rewind ()
 Stop playing the current sound and set its state to AL_INITIAL.
void fadeTo:duration:target:selector: (float gain,[duration] float duration,[target] id target,[selector] SEL selector)
 Fade to the specified gain value.
void stopFade ()
 Stop the currently running fade operation, if any.
void panTo:duration:target:selector: (float pan,[duration] float duration,[target] id target,[selector] SEL selector)
 pan to the specified value.
void stopPan ()
 Stop the currently running pan operation, if any.
void pitchTo:duration:target:selector: (float pitch,[duration] float duration,[target] id target,[selector] SEL selector)
 Gradually change pitch to the specified value.
void stopPitch ()
 Stop the currently running pitch operation, if any.
void stopActions ()
 Stop any currently running fade, pan, or pitch operations.
void clear ()
 Clear any buffers this source is currently using.

Properties

float coneInnerAngle
 Cone inner angle (OpenAL property).
float coneOuterAngle
 Cone outer angle (OpenAL property).
float coneOuterGain
 Cone outer gain (OpenAL property).
ALVector direction
 Direction (OpenAL property).
float gain
 Gain (volume) (OpenAL property).
float volume
 Volume (alias to gain).
bool interruptible
 If true, this source may be interrupted when resources are low.
bool looping
 Looping (OpenAL property).
float maxDistance
 Max distance (OpenAL property).
float maxGain
 Max gain (OpenAL property).
float minGain
 Min gain (OpenAL property).
bool muted
 If true, this source is muted.
bool paused
 If true, this source is currently paused.
float pitch
 Pitch (OpenAL property).
bool playing
 If true, this source is currently playing audio.
ALPoint position
 Position (OpenAL property).
float referenceDistance
 Reference distance (OpenAL property).
float rolloffFactor
 Rolloff factor (OpenAL property).
int sourceRelative
 Source relative (OpenAL property).
int sourceType
 Source type (OpenAL property).
ALVector velocity
 Velocity (OpenAL property).
float pan
 Pan value (-1.0 = far left, 1.0 = far right).

Detailed Description

Manages all properties relating to an OpenAL sound source.

There are currently two classes that adhere to this protocol: ALSource and ChannelSource (which collectively manipulates a set of ALSource objects). A full description of the properties themselves is available in the OpenAL 1.1 Specification and Reference: http://connect.creativelabs.com/openal/Documentation


Member Function Documentation

void ALSoundSource-p::clear ( ) [virtual]

Clear any buffers this source is currently using.

void ALSoundSource-p::fadeTo:duration:target:selector: ( float  gain,
[duration] float  duration,
[target] id  target,
[selector] SEL  selector 
) [virtual]

Fade to the specified gain value.

Parameters:
gainThe gain to fade to.
durationThe duration of the fade operation in seconds.
targetThe target to notify when the fade completes (can be nil).
selectorThe selector to call when the fade completes. The selector must accept a single parameter, which will be the object that performed the fade.
void ALSoundSource-p::panTo:duration:target:selector: ( float  pan,
[duration] float  duration,
[target] id  target,
[selector] SEL  selector 
) [virtual]

pan to the specified value.

Parameters:
panThe value to pan to.
durationThe duration of the pan operation in seconds.
targetThe target to notify when the pan completes (can be nil).
selectorThe selector to call when the pan completes. The selector must accept a single parameter, which will be the object that performed the pan.
void ALSoundSource-p::pitchTo:duration:target:selector: ( float  pitch,
[duration] float  duration,
[target] id  target,
[selector] SEL  selector 
) [virtual]

Gradually change pitch to the specified value.

Parameters:
pitchThe value to change pitch to.
durationThe duration of the pitch operation in seconds.
targetThe target to notify when the pitch change completes (can be nil).
selectorThe selector to call when the pitch change completes. The selector must accept a single parameter, which will be the object that performed the pitch change.
id<ALSoundSource> ALSoundSource-p::play: ( ALBuffer buffer) [virtual]

Play a sound.

Parameters:
bufferthe buffer to play.
Returns:
the source playing the sound, or nil if the sound could not be played.
id<ALSoundSource> ALSoundSource-p::play:gain:pitch:pan:loop: ( ALBuffer buffer,
[gain] float  gain,
[pitch] float  pitch,
[pan] float  pan,
[loop] bool  loop 
) [virtual]

Play a sound, setting gain, pitch, pan, and looping.

Parameters:
bufferthe buffer to play.
gainThe gain (volume) to play at (0.0 - 1.0).
pitchThe pitch to play at (1.0 = normal pitch).
panLeft-right panning (-1.0 = far left, 1.0 = far right).
loopIf TRUE, the sound will loop until you call "stop" on the returned sound source.
Returns:
the source playing the sound, or nil if the sound could not be played.
id<ALSoundSource> ALSoundSource-p::play:loop: ( ALBuffer buffer,
[loop] bool  loop 
) [virtual]

Play a sound, optionally looping.

Parameters:
bufferthe buffer to play.
loopIf TRUE, the sound will loop until you call "stop" on the returned sound source.
Returns:
the source playing the sound, or nil if the sound could not be played.
void ALSoundSource-p::rewind ( ) [virtual]

Stop playing the current sound and set its state to AL_INITIAL.

void ALSoundSource-p::stop ( ) [virtual]

Stop playing the current sound.

void ALSoundSource-p::stopActions ( ) [virtual]

Stop any currently running fade, pan, or pitch operations.

void ALSoundSource-p::stopFade ( ) [virtual]

Stop the currently running fade operation, if any.

void ALSoundSource-p::stopPan ( ) [virtual]

Stop the currently running pan operation, if any.

void ALSoundSource-p::stopPitch ( ) [virtual]

Stop the currently running pitch operation, if any.


Property Documentation

float ALSoundSource-p::coneInnerAngle [read, write, assign]

Cone inner angle (OpenAL property).

Reimplemented in ALChannelSource.

float ALSoundSource-p::coneOuterAngle [read, write, assign]

Cone outer angle (OpenAL property).

Reimplemented in ALChannelSource.

float ALSoundSource-p::coneOuterGain [read, write, assign]

Cone outer gain (OpenAL property).

Reimplemented in ALChannelSource.

ALVector ALSoundSource-p::direction [read, write, assign]

Direction (OpenAL property).

Reimplemented in ALChannelSource.

float ALSoundSource-p::gain [read, write, assign]

Gain (volume) (OpenAL property).

Reimplemented in ALChannelSource, and ALSource.

bool ALSoundSource-p::interruptible [read, write, assign]

If true, this source may be interrupted when resources are low.

Reimplemented in ALChannelSource, and ALSource.

bool ALSoundSource-p::looping [read, write, assign]

Looping (OpenAL property).

Reimplemented in ALChannelSource.

float ALSoundSource-p::maxDistance [read, write, assign]

Max distance (OpenAL property).

Reimplemented in ALChannelSource.

float ALSoundSource-p::maxGain [read, write, assign]

Max gain (OpenAL property).

Reimplemented in ALChannelSource.

float ALSoundSource-p::minGain [read, write, assign]

Min gain (OpenAL property).

Reimplemented in ALChannelSource.

bool ALSoundSource-p::muted [read, write, assign]

If true, this source is muted.

Reimplemented in ALChannelSource, and ALSource.

float ALSoundSource-p::pan [read, write, assign]

Pan value (-1.0 = far left, 1.0 = far right).

Note: This effect is simulated by changing the source's X position. Do not use this property if you are modifying the position property as well.

bool ALSoundSource-p::paused [read, write, assign]

If true, this source is currently paused.

Reimplemented in ALChannelSource.

float ALSoundSource-p::pitch [read, write, assign]

Pitch (OpenAL property).

Reimplemented in ALChannelSource.

bool ALSoundSource-p::playing [read, assign]

If true, this source is currently playing audio.

ALPoint ALSoundSource-p::position [read, write, assign]

Position (OpenAL property).

Reimplemented in ALChannelSource.

float ALSoundSource-p::referenceDistance [read, write, assign]

Reference distance (OpenAL property).

Reimplemented in ALChannelSource.

float ALSoundSource-p::rolloffFactor [read, write, assign]

Rolloff factor (OpenAL property).

Reimplemented in ALChannelSource.

int ALSoundSource-p::sourceRelative [read, write, assign]

Source relative (OpenAL property).

Reimplemented in ALChannelSource.

int ALSoundSource-p::sourceType [read, assign]

Source type (OpenAL property).

Reimplemented in ALChannelSource.

ALVector ALSoundSource-p::velocity [read, write, assign]

Velocity (OpenAL property).

Reimplemented in ALChannelSource.

float ALSoundSource-p::volume [read, write, assign]

Volume (alias to gain).


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