Ogre Video and Audio Plugins
master
|
Sound Manager: Manages all sounds for an application. More...
#include <OgreOggSoundManager.h>
Public Member Functions | |
OgreOggSoundManager () | |
~OgreOggSoundManager () | |
bool | createListener () |
bool | init (const std::string &deviceName="", unsigned int maxSources=100, unsigned int queueListSize=100, Ogre::SceneManager *scnMgr=0) |
const ALCdevice * | getOpenALDevice () |
const ALCcontext * | getOpenALContext () |
void | pauseOpenALDevice () |
void | resumeOpenALDevice () |
void | setMasterVolume (ALfloat vol) |
void | setSceneManager (Ogre::SceneManager *sMan) |
Ogre::SceneManager * | getSceneManager () |
unsigned int | getNumSounds () const |
ALfloat | getMasterVolume () |
OgreOggISound * | createSound (const Ogre::String &name, const Ogre::String &file, bool stream=false, bool loop=false, bool preBuffer=false, Ogre::SceneManager *scnMgr=0, bool immediate=false) |
OgreOggISound * | getSound (const Ogre::String &name) |
const Ogre::StringVector | getSoundList () const |
bool | hasSound (const Ogre::String &name) |
void | setGlobalPitch (float pitch) |
const float | getGlobalPitch () const |
void | stopAllSounds () |
void | pauseAllSounds () |
void | muteAllSounds () |
void | unmuteAllSounds () |
void | addSoundToResume (OgreOggISound *sound) |
void | resumeAllPausedSounds () |
void | destroyAllSounds () |
void | destroySound (const Ogre::String &name="") |
void | destroySound (OgreOggISound *sound) |
void | _destroyTemporarySoundImpl (OgreOggISound *sound) |
void | _destroyTemporarySound (OgreOggISound *sound) |
bool | _requestSoundSource (OgreOggISound *sound=0) |
bool | _releaseSoundSource (OgreOggISound *sound=0) |
bool | _releaseSharedBuffer (const Ogre::String &sName, ALuint &buffer) |
bool | _registerSharedBuffer (const Ogre::String &sName, ALuint &buffer, OgreOggISound *parent=0) |
void | setDistanceModel (ALenum value) |
const ALenum | getDistanceModel () const |
void | setDopplerFactor (float factor=1.f) |
float | getDopplerFactor () |
void | setSpeedOfSound (float speed=363.f) |
float | getSpeedOfSound () |
void | fadeMasterVolume (float time, bool fadeIn) |
const Ogre::StringVector | getDeviceList () const |
OgreOggListener * | getListener () |
int | getNumSources () const |
void | update (float fTime=0.f) |
void | setResourceGroupName (const Ogre::String &group) |
Ogre::String | getResourceGroupName () const |
bool | hasEFXSupport () |
bool | hasEAXSupport () |
void | setEFXDistanceUnits (float unit=3.3f) |
bool | createEFXFilter (const Ogre::String &eName, ALint type, ALfloat gain=1.0, ALfloat hfGain=1.0, ALfloat lfGain=1.0) |
bool | createEFXEffect (const Ogre::String &eName, ALint type, EFXEAXREVERBPROPERTIES *props=0) |
bool | setEFXSoundProperties (const Ogre::String &sName, float airAbsorption=0.f, float roomRolloff=0.f, float coneOuterHF=0.f) |
bool | setEFXEffectParameter (const Ogre::String &eName, ALint effectType, ALenum attrib, ALfloat param) |
bool | setEFXEffectParameter (const Ogre::String &eName, ALint type, ALenum attrib, ALfloat *params=0) |
bool | setEFXEffectParameter (const Ogre::String &eName, ALint type, ALenum attrib, ALint param) |
bool | setEFXEffectParameter (const Ogre::String &eName, ALint type, ALenum attrib, ALint *params=0) |
int | getMaxAuxiliaryEffectSlots () |
int | getMaxAuxiliaryEffectSends () |
int | getNumberOfCreatedEffectSlots () |
bool | createEFXSlot () |
bool | attachEffectToSound (const Ogre::String &sName, ALuint slotID, const Ogre::String &effect="", const Ogre::String &filter="") |
bool | detachEffectFromSound (const Ogre::String &sName, ALuint slotID) |
bool | attachFilterToSound (const Ogre::String &sName, const Ogre::String &filter="") |
bool | detachFilterFromSound (const Ogre::String &sName) |
bool | _setEFXSoundPropertiesImpl (OgreOggISound *sound=0, float airAbsorption=0.f, float roomRolloff=0.f, float coneOuterHF=0.f) |
bool | _attachEffectToSoundImpl (OgreOggISound *sound=0, ALuint slot=255, const Ogre::String &effect="", const Ogre::String &filter="") |
bool | _detachEffectFromSoundImpl (OgreOggISound *sound=0, ALuint slotID=255) |
bool | _attachFilterToSoundImpl (OgreOggISound *sound=0, const Ogre::String &filter="") |
bool | _detachFilterFromSoundImpl (OgreOggISound *sound=0) |
bool | isEffectSupported (ALint effectID) |
OgreOggSoundRecord * | createRecorder () |
OgreOggSoundRecord * | getRecorder () |
bool | isRecordingAvailable () const |
const RecordDeviceList & | getCaptureDeviceList () |
![]() | |
Singleton (void) | |
~Singleton (void) | |
Static Public Attributes | |
static const Ogre::String | OGREOGGSOUND_VERSION_STRING |
Static Private Member Functions | |
static Ogre::Real | _calculateDistanceToListener (OgreOggISound *sound, const Ogre::Vector3 &listenerPos) |
Friends | |
class | OgreOggSoundFactory |
class | OgreOggISound |
Additional Inherited Members | |
![]() | |
static T & | getSingleton (void) |
static T * | getSingletonPtr (void) |
Sound Manager: Manages all sounds for an application.
OgreOggSound::OgreOggSoundManager::OgreOggSoundManager | ( | ) |
Creates a manager for all sounds within the application.
OgreOggSound::OgreOggSoundManager::~OgreOggSoundManager | ( | ) |
Destroys this manager.
|
private |
Attaches a created effect to an Auxiliary slot
slot | Slot ID |
effect | Effect ID |
bool OgreOggSound::OgreOggSoundManager::_attachEffectToSoundImpl | ( | OgreOggISound * | sound = 0 , |
ALuint | slot = 255 , |
||
const Ogre::String & | effect = "" , |
||
const Ogre::String & | filter = "" |
||
) |
Attaches an effect to a sound
sound | Sound pointer |
slot | Slot ID |
effect | Name of effect as defined when created |
filter | Name of filter as defined when created |
bool OgreOggSound::OgreOggSoundManager::_attachFilterToSoundImpl | ( | OgreOggISound * | sound = 0 , |
const Ogre::String & | filter = "" |
||
) |
Attaches a filter to a sound
sound | Sound pointer |
filter | Name of filter as defined when created |
|
staticprivate |
Calculates the distance a sound is from the specified listener position.
|
private |
Checks for EFX hardware support
|
private |
Checks and Logs a list of supported extensions
|
private |
Checks and Logs a list of supported features
|
private |
Creates a listener object.
|
private |
Creates a single sound object (implementation).
scnMgr | Pointer to creator |
name | Unique name of sound |
file | Audio file path string or "BUFFER" for memory buffer sound (OgreOggStreamBufferSound) |
stream | Flag indicating if the sound sound be streamed. |
loop | Flag indicating if the file should loop. |
preBuffer | Flag indicating if a source should be attached at creation. |
immediate | Optional flag to indicate creation should occur immediately and not be passed to background thread for queueing. Can be used to overcome the random creation time which might not be acceptable (MULTI-THREADED ONLY) |
|
private |
Creates a pool of OpenAL sources for playback.
|
private |
Destroys all sounds.
|
private |
Destroys a listener object.
|
private |
Destroys a single sound.
sound | Sound object to destroy. |
void OgreOggSound::OgreOggSoundManager::_destroyTemporarySound | ( | OgreOggISound * | sound | ) |
Destroys a temporary sound.
sound | Sound to destroy. |
void OgreOggSound::OgreOggSoundManager::_destroyTemporarySoundImpl | ( | OgreOggISound * | sound | ) |
Destroys a temporary sound implementation
sound | Sound to destroy. |
bool OgreOggSound::OgreOggSoundManager::_detachEffectFromSoundImpl | ( | OgreOggISound * | sound = 0 , |
ALuint | slotID = 255 |
||
) |
Detaches all effects from a sound
sound | Sound pointer |
slotID | Slot ID |
bool OgreOggSound::OgreOggSoundManager::_detachFilterFromSoundImpl | ( | OgreOggISound * | sound = 0 | ) |
Detaches all filters from a sound
sound | Sound pointer |
|
private |
Checks for EAX effect support
|
private |
Enumerates audio devices.
|
private |
Gets a specified EFX Effect
eName | Name of effect as defined when created. |
|
private |
Gets a specified EFX filter
fName | Name of filter as defined when created. |
|
private |
Gets a specified EFX Effect slot
slotID | Index of auxiliary effect slot |
|
private |
Gets a shared audio buffer
sName | Name of audio file |
|
private |
Implementation of sound loading
sound | Sound pointer. |
file | Name of sound file. |
prebuffer | Prebuffer flag. |
|
private |
Opens the specified file as a new data stream.
file | The path to the resource file to open. |
|
private |
Pauses all currently playing sounds.
|
private |
Re-activates any sounds which had their source stolen.
|
private |
Re-activates any sounds which had their source stolen, implementation methods.
bool OgreOggSound::OgreOggSoundManager::_registerSharedBuffer | ( | const Ogre::String & | sName, |
ALuint & | buffer, | ||
OgreOggISound * | parent = 0 |
||
) |
Registers a shared audio buffer
sName | Name of audio file |
buffer | OpenAL buffer ID holding audio data |
parent | Sound from where to copy the properties: Buffers, PlayTime, Format |
|
private |
Releases all sounds and buffers
bool OgreOggSound::OgreOggSoundManager::_releaseSharedBuffer | ( | const Ogre::String & | sName, |
ALuint & | buffer | ||
) |
Releases a shared audio buffer
sName | Name of audio file |
buffer | Buffer ID |
|
private |
Destroys a single sound.
sound | Sound to destroy. |
bool OgreOggSound::OgreOggSoundManager::_releaseSoundSource | ( | OgreOggISound * | sound = 0 | ) |
Release a sounds source.
sound | Sound pointer. |
|
private |
Removes references of a sound from all possible internal lists.
sound | Sound to destroy. |
bool OgreOggSound::OgreOggSoundManager::_requestSoundSource | ( | OgreOggISound * | sound = 0 | ) |
Requests a free source object.
sound | Sound pointer. |
|
private |
Resumes all previously playing sounds.
|
private |
Sets EAX reverb properties using a specified present
pEFXEAXReverb | Pointer to converted EFXEAXREVERBPROPERTIES structure object |
uiEffect | Effect ID |
bool OgreOggSound::OgreOggSoundManager::_setEFXSoundPropertiesImpl | ( | OgreOggISound * | sound = 0 , |
float | airAbsorption = 0.f , |
||
float | roomRolloff = 0.f , |
||
float | coneOuterHF = 0.f |
||
) |
Sets extended properties on a specified sounds source
sound | Name of sound. |
airAbsorption | Absorption factor for air. |
roomRolloff | Room rolloff factor. |
coneOuterHF | Cone outer gain factor for High frequencies. |
|
private |
Applys global pitch.
|
private |
Stops all currently playing sounds.
void OgreOggSound::OgreOggSoundManager::addSoundToResume | ( | OgreOggISound * | sound | ) |
Add single sound to list of sounds resumed on resumeAllPausedSounds call.
sound | Sound pointer. |
bool OgreOggSound::OgreOggSoundManager::attachEffectToSound | ( | const Ogre::String & | sName, |
ALuint | slotID, | ||
const Ogre::String & | effect = "" , |
||
const Ogre::String & | filter = "" |
||
) |
Attaches an effect to a sound
sName | Name of sound |
slotID | ID of the EFX slot where the sound will be attached along with the effect |
effect | Name of effect as defined when created |
filter | Name of filter as defined when created |
bool OgreOggSound::OgreOggSoundManager::attachFilterToSound | ( | const Ogre::String & | sName, |
const Ogre::String & | filter = "" |
||
) |
Attaches a filter to a sound
sName | Name of sound |
filter | Name of filter as defined when created |
bool OgreOggSound::OgreOggSoundManager::createEFXEffect | ( | const Ogre::String & | eName, |
ALint | type, | ||
EFXEAXREVERBPROPERTIES * | props = 0 |
||
) |
Creates a specified EFX effect
eName | Name for effect. |
type | See OpenAL docs for available effects. |
props | Legacy structure describing a preset reverb effect. (See efx-presets.h) |
bool OgreOggSound::OgreOggSoundManager::createEFXFilter | ( | const Ogre::String & | eName, |
ALint | type, | ||
ALfloat | gain = 1.0 , |
||
ALfloat | hfGain = 1.0 , |
||
ALfloat | lfGain = 1.0 |
||
) |
Creates a specified EFX filter
eName | name for the filter. |
type | Possible types: AL_FILTER_LOWPASS, AL_FILTER_HIGHPASS, AL_FILTER_BANDPASS. |
gain | Gain of the allowed frequency band. Range: [0.0, 1.0] |
hfGain | Desired gain for filtered high frequencies (only affects lowpass and bandpass filters). Range: [0.0, 1.0] |
lfGain | Desired gain for filtered low frequencies (only affects highpass and bandpass filters). Range: [0.0, 1.0] |
bool OgreOggSound::OgreOggSoundManager::createEFXSlot | ( | ) |
Creates an EFX slot
bool OgreOggSound::OgreOggSoundManager::createListener | ( | ) |
Creates a listener object for the system
OgreOggSoundRecord* OgreOggSound::OgreOggSoundManager::createRecorder | ( | ) |
Creates recording class to manage device recording
OgreOggISound* OgreOggSound::OgreOggSoundManager::createSound | ( | const Ogre::String & | name, |
const Ogre::String & | file, | ||
bool | stream = false , |
||
bool | loop = false , |
||
bool | preBuffer = false , |
||
Ogre::SceneManager * | scnMgr = 0 , |
||
bool | immediate = false |
||
) |
Creates a single sound object.
name | Unique name of sound |
file | Audio file path string or "BUFFER" for memory buffer sound (OgreOggStreamBufferSound) |
stream | Flag indicating if the sound sound be streamed. |
loop | Flag indicating if the file should loop. |
preBuffer | Flag indicating if a source should be attached at creation. |
scnMgr | Pointer to SceneManager this sound belongs - 0 defaults to first SceneManager defined. |
immediate | Optional flag to indicate creation should occur immediately and not be passed to background thread for queueing. Can be used to overcome the random creation time which might not be acceptable (MULTI-THREADED ONLY) |
void OgreOggSound::OgreOggSoundManager::destroyAllSounds | ( | ) |
Destroys all sounds within manager.
void OgreOggSound::OgreOggSoundManager::destroySound | ( | const Ogre::String & | name = "" | ) |
Destroys a single sound.
name | Sound name to destroy. |
void OgreOggSound::OgreOggSoundManager::destroySound | ( | OgreOggISound * | sound | ) |
Destroys a single sound.
sound | Sound to destroy. |
bool OgreOggSound::OgreOggSoundManager::detachEffectFromSound | ( | const Ogre::String & | sName, |
ALuint | slotID | ||
) |
Detaches all effects from a sound
sName | Name of sound |
slotID | ID of the EFX slot where the sound was attached in the call to attachEffectToSound() |
bool OgreOggSound::OgreOggSoundManager::detachFilterFromSound | ( | const Ogre::String & | sName | ) |
Detaches all filters from a sound
sName | Name of sound |
void OgreOggSound::OgreOggSoundManager::fadeMasterVolume | ( | float | time, |
bool | fadeIn | ||
) |
Fades master volume in/out
const RecordDeviceList& OgreOggSound::OgreOggSoundManager::getCaptureDeviceList | ( | ) |
Gets a list of strings with the names of the available capture devices
const Ogre::StringVector OgreOggSound::OgreOggSoundManager::getDeviceList | ( | ) | const |
Gets a list of device strings
const ALenum OgreOggSound::OgreOggSoundManager::getDistanceModel | ( | ) | const |
Gets the distance model.
value | ALenum value of distance model. |
float OgreOggSound::OgreOggSoundManager::getDopplerFactor | ( | ) |
Gets doppler factor.
factor | Factor scale (>0). |
|
inline |
Gets the current global pitch.
|
inline |
Returns pointer to listener.
ALfloat OgreOggSound::OgreOggSoundManager::getMasterVolume | ( | ) |
Gets the current global volume for all sounds
|
inline |
Gets the maximum number of Auxiliary Effect Sends per source
|
inline |
Gets the maximum number of Auxiliary Effect Slots detected for the OpenAL device on initialization
int OgreOggSound::OgreOggSoundManager::getNumberOfCreatedEffectSlots | ( | ) |
Gets the number of currently created Auxiliary Effect slots
|
inline |
Gets number of currently created sounds
|
inline |
Returns number of sources created.
|
inline |
Gets the OpenAL context pointer
|
inline |
Gets the OpenAL device pointer
|
inline |
Gets recording class created to manage device recording
Ogre::String OgreOggSound::OgreOggSoundManager::getResourceGroupName | ( | ) | const |
Returns user defined search group name
|
inline |
Gets the default SceneManager for creation of sound objects
OgreOggISound* OgreOggSound::OgreOggSoundManager::getSound | ( | const Ogre::String & | name | ) |
Gets a named sound.
name | Sound name. |
const Ogre::StringVector OgreOggSound::OgreOggSoundManager::getSoundList | ( | ) | const |
Gets list of created sounds.
float OgreOggSound::OgreOggSoundManager::getSpeedOfSound | ( | ) |
Gets speed of sound.
speed | Speed (m/s). |
|
inline |
Returns EAX support status.
|
inline |
Returns EFX support status.
bool OgreOggSound::OgreOggSoundManager::hasSound | ( | const Ogre::String & | name | ) |
Returns whether named sound exists.
name | Sound name. |
bool OgreOggSound::OgreOggSoundManager::init | ( | const std::string & | deviceName = "" , |
unsigned int | maxSources = 100 , |
||
unsigned int | queueListSize = 100 , |
||
Ogre::SceneManager * | scnMgr = 0 |
||
) |
Initialises the audio device.
deviceName | Audio device string to open, will use default device if not found. |
maxSources | Maximum number of sources to allocate (optional) |
queueListSize | Desired size of queue list (optional | Multi-threaded ONLY) |
scnMgr | SceneManager to use in order create sounds (If no manager specified, uses the first one) |
bool OgreOggSound::OgreOggSoundManager::isEffectSupported | ( | ALint | effectID | ) |
Returns whether a specified effect is supported
effectID | OpenAL effect/filter id. (AL_EFFECT... | AL_FILTER...) |
bool OgreOggSound::OgreOggSoundManager::isRecordingAvailable | ( | ) | const |
Returns whether a capture device is available
|
inline |
Mutes all sounds.
void OgreOggSound::OgreOggSoundManager::pauseAllSounds | ( | ) |
Pauses all currently playing sounds.
void OgreOggSound::OgreOggSoundManager::pauseOpenALDevice | ( | ) |
Pauses the OpenAL device
void OgreOggSound::OgreOggSoundManager::resumeAllPausedSounds | ( | ) |
Resumes all previously playing sounds.
void OgreOggSound::OgreOggSoundManager::resumeOpenALDevice | ( | ) |
Resumes previously paused OpenAL device
void OgreOggSound::OgreOggSoundManager::setDistanceModel | ( | ALenum | value | ) |
Sets distance model.
value | ALenum value of distance model. |
void OgreOggSound::OgreOggSoundManager::setDopplerFactor | ( | float | factor = 1.f | ) |
Sets doppler factor.
factor | Factor scale (>0). |
void OgreOggSound::OgreOggSoundManager::setEFXDistanceUnits | ( | float | unit = 3.3f | ) |
Sets the distance units of measurement for EFX effects.
unit | Units (meters). |
bool OgreOggSound::OgreOggSoundManager::setEFXEffectParameter | ( | const Ogre::String & | eName, |
ALint | effectType, | ||
ALenum | attrib, | ||
ALfloat | param | ||
) |
Sets a specified paremeter on an effect
eName | Name of effect. |
effectType | See OpenAL docs for available effects. |
attrib | Parameter value to alter. |
param | Float value to set. |
bool OgreOggSound::OgreOggSoundManager::setEFXEffectParameter | ( | const Ogre::String & | eName, |
ALint | type, | ||
ALenum | attrib, | ||
ALfloat * | params = 0 |
||
) |
Sets a specified paremeter on an effect
eName | Name of effect. |
type | See OpenAL docs for available effects. |
attrib | Parameter value to alter. |
params | Vector pointer of float values to set. |
bool OgreOggSound::OgreOggSoundManager::setEFXEffectParameter | ( | const Ogre::String & | eName, |
ALint | type, | ||
ALenum | attrib, | ||
ALint * | params = 0 |
||
) |
Sets a specified paremeter on an effect
eName | Name of effect. |
type | See OpenAL docs for available effects. |
attrib | Parameter value to alter. |
params | Vector pointer of integer values to set. |
bool OgreOggSound::OgreOggSoundManager::setEFXEffectParameter | ( | const Ogre::String & | eName, |
ALint | type, | ||
ALenum | attrib, | ||
ALint | param | ||
) |
Sets a specified paremeter on an effect
eName | Name of effect. |
type | See OpenAL docs for available effects. |
attrib | Parameter value to alter. |
param | Integer value to set. |
bool OgreOggSound::OgreOggSoundManager::setEFXSoundProperties | ( | const Ogre::String & | sName, |
float | airAbsorption = 0.f , |
||
float | roomRolloff = 0.f , |
||
float | coneOuterHF = 0.f |
||
) |
Sets extended properties on a specified sounds source
sName | Name of sound. |
airAbsorption | Absorption factor for air. |
roomRolloff | Room rolloff factor. |
coneOuterHF | Cone outer gain factor for High frequencies. |
void OgreOggSound::OgreOggSoundManager::setGlobalPitch | ( | float | pitch | ) |
Sets the pitch of all sounds.
pitch | New pitch for all sounds (positive value) |
void OgreOggSound::OgreOggSoundManager::setMasterVolume | ( | ALfloat | vol | ) |
Sets the global volume for all sounds
vol | Global attenuation for all sounds. |
void OgreOggSound::OgreOggSoundManager::setResourceGroupName | ( | const Ogre::String & | group | ) |
Sets a resource group name to search for all sounds first.
group | Name of OGRE ResourceGroup. |
|
inline |
Sets the default SceneManager for creation of sound objects
void OgreOggSound::OgreOggSoundManager::setSpeedOfSound | ( | float | speed = 363.f | ) |
Sets speed of sound.
speed | Speed (m/s). |
void OgreOggSound::OgreOggSoundManager::stopAllSounds | ( | ) |
Stops all currently playing sounds.
|
inline |
Un mutes all sounds.
void OgreOggSound::OgreOggSoundManager::update | ( | float | fTime = 0.f | ) |
Updates system.
fTime | Elapsed frametime. |
|
friend |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
OpenAL device objects
|
private |
|
private |
EAX Support
|
private |
|
private |
|
private |
|
private |
EFX Support
|
private |
|
private |
|
private |
Fading vars
|
private |
|
private |
|
private |
|
private |
|
private |
Listener pointer
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
Sound lists
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
static |