ObjectAL  2.1
ObjectAL API Reference (iOS) for Kobold2D developers
OpenALManager Class Reference

Manager class for OpenAL objects (ObjectAL). More...

#include <OpenALManager.h>

Inheritance diagram for OpenALManager:
Collaboration diagram for OpenALManager:

List of all members.

Public Member Functions

ALBufferbufferFromFile: (NSString *filePath)
 Load an OpenAL buffer with the contents of an audio file.
ALBufferbufferFromFile:reduceToMono: (NSString *filePath,[reduceToMono] bool reduceToMono)
 Load an OpenAL buffer with the contents of an audio file.
ALBufferbufferFromUrl: (NSURL *url)
 Load an OpenAL buffer with the contents of an audio file.
ALBufferbufferFromUrl:reduceToMono: (NSURL *url,[reduceToMono] bool reduceToMono)
 Load an OpenAL buffer with the contents of an audio file.
NSString * bufferAsyncFromFile:target:selector: (NSString *filePath,[target] id target,[selector] SEL selector)
 Load an OpenAL buffer with the contents of an audio file asynchronously.
NSString * bufferAsyncFromFile:reduceToMono:target:selector: (NSString *filePath,[reduceToMono] bool reduceToMono,[target] id target,[selector] SEL selector)
 Load an OpenAL buffer with the contents of an audio file asynchronously.
NSString * bufferAsyncFromUrl:target:selector: (NSURL *url,[target] id target,[selector] SEL selector)
 Load an OpenAL buffer with the contents of a URL asynchronously.
NSString * bufferAsyncFromUrl:reduceToMono:target:selector: (NSURL *url,[reduceToMono] bool reduceToMono,[target] id target,[selector] SEL selector)
 Load an OpenAL buffer with the contents of a URL asynchronously.
void clearAllBuffers ()
 Clear all references to sound data from ALL buffers, managed or not.
void notifyDeviceInitializing: (ALDevice *device)
 (INTERNAL USE) Notify that a device is initializing.
void notifyDeviceDeallocating: (ALDevice *device)
 (INTERNAL USE) Notify that a device is deallocating.

Protected Member Functions

 SYNTHESIZE_SINGLETON_FOR_CLASS_HEADER (OpenALManager)
 Singleton implementation providing "sharedInstance" and "purgeSharedInstance" methods.

Protected Attributes

__unsafe_unretained ALContextcurrentContext
NSMutableArray * devices
 All opened devices.
OALSuspendHandlersuspendHandler
 Handles suspending and interrupting for this object.
NSOperationQueue * operationQueue
 Operation queue for asynchronous loading.

Properties

NSArray * availableDevices
 List of available playback devices (NSString*).
NSArray * availableCaptureDevices
 List of available capture devices (NSString*).
ALContextcurrentContext
 The current context (some context operations require the context to be the "current" one).
NSString * defaultCaptureDeviceSpecifier
 Name of the default capture device.
NSString * defaultDeviceSpecifier
 Name of the default playback device.
NSArray * devices
 List of all open devices (ALDevice*).
ALdouble mixerOutputFrequency
 The frequency of the output mixer.

Detailed Description

Manager class for OpenAL objects (ObjectAL).

Keeps track of devices that have been opened, and allows high level OpenAL management.
Provides methods for loading ALBuffer objects from audio files.
The OpenAL 1.1 specification is available at http://connect.creativelabs.com/openal/Documentation
Be sure to read through it (especially the part about distance models) as ObjectAL follows the OpenAL object model.

Alternatively, you may opt to use OALSimpleAudio for a simpler interface.


Member Function Documentation

NSString * OpenALManager::bufferAsyncFromFile:reduceToMono:target:selector: ( NSString*  filePath,
[reduceToMono] bool  reduceToMono,
[target] id  target,
[selector] SEL  selector 
) [virtual]

Load an OpenAL buffer with the contents of an audio file asynchronously.

This method will schedule a request to have the buffer created and filled, and then call the specified selector with the newly created buffer.
The buffer's name will be the fully qualified URL of the path.
Returns the fully qualified URL of the path, which you can match up to the buffer name in your callback method.

See the class description note regarding sound file formats.

Parameters:
filePathThe path of the file containing the audio data.
reduceToMonoIf true, reduce the sample to mono (stereo samples don't support panning or positional audio).
targetThe target to call when the buffer is loaded.
selectorThe selector to invoke when the buffer is loaded.
Returns:
The fully qualified URL of the path.
NSString * OpenALManager::bufferAsyncFromFile:target:selector: ( NSString*  filePath,
[target] id  target,
[selector] SEL  selector 
) [virtual]

Load an OpenAL buffer with the contents of an audio file asynchronously.

This method will schedule a request to have the buffer created and filled, and then call the specified selector with the newly created buffer.
The buffer's name will be the fully qualified URL of the path.
Returns the fully qualified URL of the path, which you can match up to the buffer name in your callback method.

See the class description note regarding sound file formats.

Parameters:
filePathThe path of the file containing the audio data.
targetThe target to call when the buffer is loaded.
selectorThe selector to invoke when the buffer is loaded.
Returns:
The fully qualified URL of the path.
NSString * OpenALManager::bufferAsyncFromUrl:reduceToMono:target:selector: ( NSURL*  url,
[reduceToMono] bool  reduceToMono,
[target] id  target,
[selector] SEL  selector 
) [virtual]

Load an OpenAL buffer with the contents of a URL asynchronously.

This method will schedule a request to have the buffer created and filled, and then call the specified selector with the newly created buffer.
The buffer's name will be the fully qualified URL.
Returns the fully qualified URL, which you can match up to the buffer name in your callback method.

See the class description note regarding sound file formats.

Parameters:
urlThe URL of the file containing the audio data.
reduceToMonoIf true, reduce the sample to mono (stereo samples don't support panning or positional audio).
targetThe target to call when the buffer is loaded.
selectorThe selector to invoke when the buffer is loaded.
Returns:
The fully qualified URL of the path.
NSString * OpenALManager::bufferAsyncFromUrl:target:selector: ( NSURL*  url,
[target] id  target,
[selector] SEL  selector 
) [virtual]

Load an OpenAL buffer with the contents of a URL asynchronously.

This method will schedule a request to have the buffer created and filled, and then call the specified selector with the newly created buffer.
The buffer's name will be the fully qualified URL.
Returns the fully qualified URL, which you can match up to the buffer name in your callback method.

See the class description note regarding sound file formats.

Parameters:
urlThe URL of the file containing the audio data.
targetThe target to call when the buffer is loaded.
selectorThe selector to invoke when the buffer is loaded.
Returns:
The fully qualified URL of the path.
ALBuffer * OpenALManager::bufferFromFile: ( NSString*  filePath) [virtual]

Load an OpenAL buffer with the contents of an audio file.

The buffer's name will be the fully qualified URL of the path.

See the class description note regarding sound file formats.

Parameters:
filePathThe path of the file containing the audio data.
Returns:
An ALBuffer containing the audio data.
ALBuffer * OpenALManager::bufferFromFile:reduceToMono: ( NSString*  filePath,
[reduceToMono] bool  reduceToMono 
) [virtual]

Load an OpenAL buffer with the contents of an audio file.

The buffer's name will be the fully qualified URL of the path.

See the class description note regarding sound file formats.

Parameters:
filePathThe path of the file containing the audio data.
reduceToMonoIf true, reduce the sample to mono (stereo samples don't support panning or positional audio).
Returns:
An ALBuffer containing the audio data.
ALBuffer * OpenALManager::bufferFromUrl: ( NSURL*  url) [virtual]

Load an OpenAL buffer with the contents of an audio file.

The buffer's name will be the fully qualified URL.

See the class description note regarding sound file formats.

Parameters:
urlThe URL of the file containing the audio data.
Returns:
An ALBuffer containing the audio data.
ALBuffer * OpenALManager::bufferFromUrl:reduceToMono: ( NSURL*  url,
[reduceToMono] bool  reduceToMono 
) [virtual]

Load an OpenAL buffer with the contents of an audio file.

The buffer's name will be the fully qualified URL.

See the class description note regarding sound file formats.

Parameters:
urlThe URL of the file containing the audio data.
reduceToMonoIf true, reduce the sample to mono (stereo samples don't support panning or positional audio).
Returns:
An ALBuffer containing the audio data.
void OpenALManager::clearAllBuffers ( ) [virtual]

Clear all references to sound data from ALL buffers, managed or not.

void OpenALManager::notifyDeviceDeallocating: ( ALDevice device) [virtual]

(INTERNAL USE) Notify that a device is deallocating.

void OpenALManager::notifyDeviceInitializing: ( ALDevice device) [virtual]

(INTERNAL USE) Notify that a device is initializing.

OpenALManager::SYNTHESIZE_SINGLETON_FOR_CLASS_HEADER ( OpenALManager  ) [protected]

Singleton implementation providing "sharedInstance" and "purgeSharedInstance" methods.

- (OpenALManager*) sharedInstance: Get the shared singleton instance.
- (void) purgeSharedInstance: Purge (deallocate) the shared instance.


Member Data Documentation

NSMutableArray* OpenALManager::devices [protected]

All opened devices.

NSOperationQueue* OpenALManager::operationQueue [protected]

Operation queue for asynchronous loading.

Handles suspending and interrupting for this object.


Property Documentation

NSArray * OpenALManager::availableCaptureDevices [read, assign]

List of available capture devices (NSString*).

NSArray * OpenALManager::availableDevices [read, assign]

List of available playback devices (NSString*).

ALContext* OpenALManager::currentContext [read, write, assign]

The current context (some context operations require the context to be the "current" one).

NSString * OpenALManager::defaultCaptureDeviceSpecifier [read, assign]

Name of the default capture device.

NSString * OpenALManager::defaultDeviceSpecifier [read, assign]

Name of the default playback device.

NSArray* OpenALManager::devices [read, assign]

List of all open devices (ALDevice*).

ALdouble OpenALManager::mixerOutputFrequency [read, write, assign]

The frequency of the output mixer.


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