A source represents an object that emits sound which can be heard by a listener. More...
#import <ALSource.h>
Instance Methods | |
(id) | - initOnContext: |
Initialize a new source on the specified context. More... | |
(id< ALSoundSource >) | - play |
Play the currently attached buffer. More... | |
(bool) | - queueBuffer: |
Add a buffer to the buffer queue. More... | |
(bool) | - queueBuffer:repeats: |
Add a buffer to the buffer queue, repeating it multiple times. More... | |
(bool) | - queueBuffers: |
Add buffers to the buffer queue. More... | |
(bool) | - queueBuffers:repeats: |
Add buffers to the buffer queue, repeating it multiple times. More... | |
(bool) | - unqueueBuffer: |
Remove a buffer from the buffer queue. More... | |
(bool) | - unqueueBuffers: |
Remove buffers from the buffer queue. More... | |
(void) | - registerNotification:callback:userData: |
Register to receive notifications about an event on this source. More... | |
(void) | - unregisterNotification: |
Unregister notifications for a notification type on this source. More... | |
(void) | - unregisterAllNotifications |
Unregister all notifications for this source. 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... | |
Instance Methods inherited from <OALSuspendManager> | |
(void) | - addSuspendListener: |
Add a listener that will receive manual suspend and interrupt events. More... | |
(void) | - removeSuspendListener: |
Remove a registered listener. More... | |
Class Methods | |
(id) | + source |
Create a new source. More... | |
(id) | + sourceOnContext: |
Create a new source on the specified context. More... | |
Protected Attributes | |
bool | interruptible |
float | gain |
bool | muted |
int | shadowState |
Shadow value which keeps the correct state value for AL_PLAYING and AL_PAUSED. More... | |
bool | abortPlaybackResume |
Used to abort a pending playback resume if the user calls stop or pause. More... | |
OALAction * | gainAction |
Current action operating on the gain control. More... | |
OALAction * | panAction |
Current action operating on the pan control. More... | |
OALAction * | pitchAction |
Current action operating on the pitch control. More... | |
OALSuspendHandler * | suspendHandler |
Handles suspending and interrupting for this object. More... | |
Properties | |
ALBuffer * | buffer |
The sound buffer this source is attached to (set to nil to detach the currently attached buffer). More... | |
int | buffersQueued |
How many buffers this source has queued. More... | |
int | buffersProcessed |
How many of these buffers have been processed during playback. More... | |
ALContext * | context |
The context this source was opened on. More... | |
float | offsetInBytes |
The offset into the current buffer (in bytes). More... | |
float | offsetInSamples |
The offset into the current buffer (in samples). More... | |
float | offsetInSeconds |
The offset into the current buffer (in seconds). More... | |
ALuint | sourceId |
OpenAL's ID for this source. More... | |
int | state |
The state of this source. 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... | |
Properties inherited from <OALSuspendManager> | |
bool | suspended |
If YES, this object is suspended. More... | |
Properties inherited from <OALSuspendListener> | |
bool | manuallySuspended |
Set to YES to manually suspend. More... | |
bool | interrupted |
If YES, this object is interrupted. More... | |
A source represents an object that emits sound which can be heard by a listener.
This source can have position, velocity, and direction.
- (id) initOnContext: | (ALContext*) | context |
Initialize a new source on the specified context.
context | the context to create the source on. |
- (id< ALSoundSource >) play |
Play the currently attached buffer.
- (bool) queueBuffer: | (ALBuffer*) | buffer |
Add a buffer to the buffer queue.
buffer | the buffer to add to the queue. |
- (bool) queueBuffer: | (ALBuffer*) | buffer | |
repeats: | (NSUInteger) | repeats | |
Add a buffer to the buffer queue, repeating it multiple times.
buffer | the buffer to add to the queue. |
repeats | the number of times to repeat the buffer in the queue. |
- (bool) queueBuffers: | (NSArray*) | buffers |
Add buffers to the buffer queue.
buffers | the buffers to add to the queue. |
- (bool) queueBuffers: | (NSArray*) | buffers | |
repeats: | (NSUInteger) | repeats | |
Add buffers to the buffer queue, repeating it multiple times.
The buffers will be played in order, repeating the specified number of times.
buffers | the buffers to add to the queue. |
repeats | the number of times to repeat the buffer in the queue. |
- (void) registerNotification: | (ALuint) | notificationID | |
callback: | (OALSourceNotificationCallback) | callback | |
userData: | (void*) | userData | |
Register to receive notifications about an event on this source.
(iOS 5.0+)
The following notification types are recognized: AL_SOURCE_STATE - Sent when a source's state changes. AL_BUFFERS_PROCESSED - Sent when all buffers have been processed. AL_QUEUE_HAS_LOOPED - Sent when a looping source has looped to it's start point.
notificationID | The kind of notification to be informed of (see above). |
callback | The block to call for notification. |
userData | a pointer that will be passed to the callback. |
+ (id) source |
Create a new source.
+ (id) sourceOnContext: | (ALContext*) | context |
Create a new source on the specified context.
context | the context to create the source on. |
- (bool) unqueueBuffer: | (ALBuffer*) | buffer |
Remove a buffer from the buffer queue.
buffer | the buffer to remove from the queue. |
- (bool) unqueueBuffers: | (NSArray*) | buffers |
Remove buffers from the buffer queue.
buffers | the buffers to remove from the queue. |
- (void) unregisterAllNotifications |
Unregister all notifications for this source.
(iOS 5.0+)
- (void) unregisterNotification: | (ALuint) | notificationID |
Unregister notifications for a notification type on this source.
(iOS 5.0+)
notificationID | The kind of notification to remove. |
|
protected |
Used to abort a pending playback resume if the user calls stop or pause.
|
protected |
Current action operating on the gain control.
|
protected |
Current action operating on the pan control.
|
protected |
Current action operating on the pitch control.
|
protected |
Shadow value which keeps the correct state value for AL_PLAYING and AL_PAUSED.
We need this due to a buggy OpenAL implementation.
|
protected |
Handles suspending and interrupting for this object.
|
readwritenonatomicretain |
The sound buffer this source is attached to (set to nil to detach the currently attached buffer).
|
readnonatomicassign |
How many of these buffers have been processed during playback.
|
readnonatomicassign |
How many buffers this source has queued.
|
readnonatomicretain |
The context this source was opened on.
|
readwritenonatomicassign |
The offset into the current buffer (in bytes).
|
readwritenonatomicassign |
The offset into the current buffer (in samples).
|
readwritenonatomicassign |
The offset into the current buffer (in seconds).
|
readnonatomicassign |
OpenAL's ID for this source.
|
readwritenonatomicassign |
The state of this source.