

Public Types | |
| enum | Events { ON_INIT, ON_UPDATE, ON_RELEASE, ON_SOURCECREATE, ON_DECODERREGISTER, ON_DATASOURCEREGISTER } |
Public Member Functions | |
| virtual bool | initialize (const char *deviceName=0x0, int outputFrequency=-1, int eaxEffectSlots=4) |
| Initializes the manager. | |
| virtual void | shutDown () |
| Shuts the manager down, cleaning up audio sources in the process. Does not clean up decoders, data sources, or event handlers. | |
| virtual void | update () |
| If threading is disabled, you must call this function every frame to update the playback buffers of audio sources. Otherwise it should not be called. | |
| virtual IAudioSource * | getSoundByName (const char *name) |
| Returns an Audio Source by its "name" and NULL if the name is not found. | |
| virtual void | releaseAllSources () |
| Releases ALL Audio Sources (but does not shutdown the manager). | |
| virtual void | release (IAudioSource *source) |
| Releases a single Audio Source, removing it from the manager. | |
| virtual const char * | getAvailableDeviceName (unsigned int index) |
| Returns the name of an available playback device. | |
| virtual unsigned int | getAvailableDeviceCount () |
| Returns the number of playback devices available for use. | |
| virtual const char * | getDefaultDeviceName () |
| Returns the name of the default system playback device. | |
| virtual IAudioSource * | create (const char *name, const char *filename, bool stream=false) |
| Creates an Audio Source object using the highest priority data source that has the referenced filename. | |
| virtual IAudioSource * | createFromMemory (const char *name, const char *data, size_t length, const char *extension) |
| Creates an Audio Source from a memory buffer using a specific audio codec. | |
| virtual IAudioSource * | createFromRaw (const char *name, const char *data, size_t length, unsigned int frequency, AudioFormats format) |
| Creates an Audio Source from raw audio data in a memory buffer. | |
| virtual bool | registerAudioDecoder (IAudioDecoderFactory *factory, const char *extension) |
| Register an Audio Decoder. | |
| virtual void | unRegisterAudioDecoder (const char *extension) |
| Unregister a previously registered Audio Decoder. | |
| virtual bool | isAudioDecoderRegistered (const char *extension) |
| Returns whether an audio decoder is currently registered for this file type. | |
| virtual IAudioDecoderFactory * | getAudioDecoderFactory (const char *extension) |
| Returns a registered audio decoder factory. | |
| virtual void | unRegisterAllAudioDecoders () |
| Unregisters all attached Audio Decoders. | |
| virtual bool | registerDataSource (IDataSourceFactory *factory, const char *name, int priority) |
| Registers a data source with this manager. | |
| virtual void | unRegisterDataSource (const char *name) |
| Removes a previously registered data source. | |
| virtual bool | isDataSourceRegistered (const char *name) |
| Returns whether a data source is currently registered under a certain name. | |
| virtual IDataSourceFactory * | getDataSourceFactory (const char *name) |
| Returns a previously registered data source factory. | |
| virtual void | unRegisterAllDataSources () |
| Removes all previously registered data sources. | |
| virtual void | registerEventHandler (IManagerEventHandler *handler) |
| Registers a new event handler with the manager. | |
| virtual void | unRegisterEventHandler (IManagerEventHandler *handler) |
| Unregisters a previously registered event handler from the manager. | |
| virtual void | unRegisterAllEventHandlers () |
| Unregisters all previously registered event handlers from the manager. | |
| void | getAvailableDevices () |
| Grabs a list of available devices, as well as the default system one. | |
| virtual IListener * | getListener () |
| Returns the interface for the listener. | |
| virtual IAudioEffects * | getEffects () |
| Returns the interface for audio effects. | |
Definition at line 30 of file cAudioManager.h.
| IAudioSource * cAudio::cAudioManager::create | ( | const char * | name, | |
| const char * | filename, | |||
| bool | stream = false | |||
| ) | [virtual] |
Creates an Audio Source object using the highest priority data source that has the referenced filename.
| name,: | Name of the audio source. | |
| filename,: | Path to the file to load audio data from. | |
| stream,: | Whether to stream the audio data or load it all into a memory buffer at the start. You should consider using streaming for really large sound files. |
Implements cAudio::IAudioManager.
Definition at line 140 of file cAudioManager.cpp.
| IAudioSource * cAudio::cAudioManager::createFromMemory | ( | const char * | name, | |
| const char * | data, | |||
| size_t | length, | |||
| const char * | extension | |||
| ) | [virtual] |
Creates an Audio Source from a memory buffer using a specific audio codec.
| name,: | Name of the audio source. | |
| data,: | Pointer to a buffer in memory to load the data from. | |
| length,: | Length of the data buffer. | |
| extension,: | Extension for the audio codec of the data in the memory buffer. |
Implements cAudio::IAudioManager.
Definition at line 201 of file cAudioManager.cpp.
| IAudioSource * cAudio::cAudioManager::createFromRaw | ( | const char * | name, | |
| const char * | data, | |||
| size_t | length, | |||
| unsigned int | frequency, | |||
| AudioFormats | format | |||
| ) | [virtual] |
Creates an Audio Source from raw audio data in a memory buffer.
| name,: | Name of the audio source. | |
| data,: | Pointer to a buffer in memory to load the data from. | |
| length,: | Length of the data buffer. | |
| frequency,: | Frequency (or sample rate) of the audio data. | |
| format,: | Format of the audio data. |
Implements cAudio::IAudioManager.
Definition at line 266 of file cAudioManager.cpp.
| IAudioDecoderFactory * cAudio::cAudioManager::getAudioDecoderFactory | ( | const char * | extension | ) | [virtual] |
Returns a registered audio decoder factory.
| extension,: | Extension for the audio decoder to return. |
Implements cAudio::IAudioManager.
Definition at line 359 of file cAudioManager.cpp.
| unsigned int cAudio::cAudioManager::getAvailableDeviceCount | ( | ) | [virtual] |
Returns the number of playback devices available for use.
Implements cAudio::IAudioManager.
Definition at line 693 of file cAudioManager.cpp.
| const char * cAudio::cAudioManager::getAvailableDeviceName | ( | unsigned int | index | ) | [virtual] |
Returns the name of an available playback device.
| index,: | Specify which name to retrieve ( Range: 0 to getAvailableDeviceCount()-1 ) |
Implements cAudio::IAudioManager.
Definition at line 680 of file cAudioManager.cpp.
| IDataSourceFactory * cAudio::cAudioManager::getDataSourceFactory | ( | const char * | name | ) | [virtual] |
Returns a previously registered data source factory.
| name,: | Name of the data source to return. |
Implements cAudio::IAudioManager.
Definition at line 425 of file cAudioManager.cpp.
| const char * cAudio::cAudioManager::getDefaultDeviceName | ( | ) | [virtual] |
Returns the name of the default system playback device.
Implements cAudio::IAudioManager.
Definition at line 699 of file cAudioManager.cpp.
| IAudioSource * cAudio::cAudioManager::getSoundByName | ( | const char * | name | ) | [virtual] |
Returns an Audio Source by its "name" and NULL if the name is not found.
| name,: | Name of the audio source to retrieve. |
Implements cAudio::IAudioManager.
Definition at line 531 of file cAudioManager.cpp.
| bool cAudio::cAudioManager::initialize | ( | const char * | deviceName = 0x0, |
|
| int | outputFrequency = -1, |
|||
| int | eaxEffectSlots = 4 | |||
| ) | [virtual] |
Initializes the manager.
| deviceName,: | Name of the device to create this manager for. | |
| outputFrequency,: | Frequency of the output audio or -1 for the device default. | |
| eaxEffectSlots,: | Number of EFX effect slots to request. Has no effect if EFX is not supported or compiled out. |
Implements cAudio::IAudioManager.
Definition at line 54 of file cAudioManager.cpp.
| bool cAudio::cAudioManager::isAudioDecoderRegistered | ( | const char * | extension | ) | [virtual] |
Returns whether an audio decoder is currently registered for this file type.
| extension,: | Extension for the audio decoder to check for. |
Implements cAudio::IAudioManager.
Definition at line 351 of file cAudioManager.cpp.
| bool cAudio::cAudioManager::isDataSourceRegistered | ( | const char * | name | ) | [virtual] |
Returns whether a data source is currently registered under a certain name.
| name,: | Name of the data source to check for. |
Implements cAudio::IAudioManager.
Definition at line 417 of file cAudioManager.cpp.
| bool cAudio::cAudioManager::registerAudioDecoder | ( | IAudioDecoderFactory * | factory, | |
| const char * | extension | |||
| ) | [virtual] |
Register an Audio Decoder.
| factory,: | Pointer to the factory instance to use. | |
| extension,: | Extension of the audio codec to register this decoder under. For example, .wav for a RIFF/wav decoder. |
Implements cAudio::IAudioManager.
Definition at line 330 of file cAudioManager.cpp.
| bool cAudio::cAudioManager::registerDataSource | ( | IDataSourceFactory * | factory, | |
| const char * | name, | |||
| int | priority | |||
| ) | [virtual] |
Registers a data source with this manager.
Use this function to provide access to a custom resource manager, zip archive, vfs, or any other place you'd like to get audio files from.
| factory,: | Pointer to the data source factory to register. | |
| name,: | Name for the data source (ie. Zip Archive or FileSystem) | |
| priority,: | Determines what order data sources are asked for a file. The higher the priority, the sooner they are asked. cAudio stops looking for a file as soon as any data source returns it. |
Implements cAudio::IAudioManager.
Definition at line 382 of file cAudioManager.cpp.
| void cAudio::cAudioManager::registerEventHandler | ( | IManagerEventHandler * | handler | ) | [virtual] |
Registers a new event handler with the manager.
| handler,: | Pointer to an event handler instance to register. |
Implements cAudio::IAudioManager.
Definition at line 444 of file cAudioManager.cpp.
| void cAudio::cAudioManager::release | ( | IAudioSource * | source | ) | [virtual] |
Releases a single Audio Source, removing it from the manager.
| source,: | Pointer to the source to release. |
Implements cAudio::IAudioManager.
Definition at line 556 of file cAudioManager.cpp.
| void cAudio::cAudioManager::unRegisterAllAudioDecoders | ( | ) | [virtual] |
Unregisters all attached Audio Decoders.
Note that all current sound sources will still continue to use any currently allocated decoders. Will NOT delete any user added factory instance, you must do that yourself.
Implements cAudio::IAudioManager.
Definition at line 371 of file cAudioManager.cpp.
| void cAudio::cAudioManager::unRegisterAllDataSources | ( | ) | [virtual] |
Removes all previously registered data sources.
Note that sound sources will still continue to use any currently allocated sources, so you may not be able to close an open zip/archive file handle until they are done. Will NOT delete any user added factory instance, you must do that yourself.
Implements cAudio::IAudioManager.
Definition at line 437 of file cAudioManager.cpp.
| void cAudio::cAudioManager::unRegisterAllEventHandlers | ( | ) | [virtual] |
Unregisters all previously registered event handlers from the manager.
Note: Will not delete your event handler, you must take care of that yourself.
Implements cAudio::IAudioManager.
Definition at line 460 of file cAudioManager.cpp.
| void cAudio::cAudioManager::unRegisterAudioDecoder | ( | const char * | extension | ) | [virtual] |
Unregister a previously registered Audio Decoder.
Note that all current sound sources will still continue to use any currently allocated decoders. Will NOT delete any user added factory instance, you must do that yourself.
| extension,: | Extension for the audio decoder to remove. |
Implements cAudio::IAudioManager.
Definition at line 339 of file cAudioManager.cpp.
| void cAudio::cAudioManager::unRegisterDataSource | ( | const char * | name | ) | [virtual] |
Removes a previously registered data source.
Note that sound sources will still continue to use any currently allocated sources, so you may not be able to close an open zip/archive file handle until they are done. Will NOT delete any user added factory instance, you must do that yourself.
| name,: | Name of the data source to unregister. |
Implements cAudio::IAudioManager.
Definition at line 394 of file cAudioManager.cpp.
| void cAudio::cAudioManager::unRegisterEventHandler | ( | IManagerEventHandler * | handler | ) | [virtual] |
Unregisters a previously registered event handler from the manager.
Note: Will not delete your event handler, you must take care of that yourself.
| handler,: | Pointer to the event handler to remove. |
Implements cAudio::IAudioManager.
Definition at line 452 of file cAudioManager.cpp.
1.6.2