OgreOggSound  1.26
OgreOggSound::OgreOggSoundManager Class Reference

Sound Manager: Manages all sounds for an application. More...

#include <OgreOggSoundManager.h>

Inheritance diagram for OgreOggSound::OgreOggSoundManager:

Public Member Functions

 OgreOggSoundManager ()
 
 ~OgreOggSoundManager ()
 
bool createListener ()
 
bool init (const std::string &deviceName="", unsigned int maxSources=100, unsigned int queueListSize=100, Ogre::SceneManager *sMan=0)
 
const ALCdevice * getOpenalDevice ()
 
const ALCcontext * getOpenalContext ()
 
void setMasterVolume (ALfloat vol)
 
void setSceneManager (Ogre::SceneManager *sMan)
 
Ogre::SceneManagergetSceneManager ()
 
unsigned int getNumSounds () const
 
ALfloat getMasterVolume ()
 
OgreOggISoundcreateSound (const std::string &name, const std::string &file, bool stream=false, bool loop=false, bool preBuffer=false, Ogre::SceneManager *scnMgr=0, bool immediate=false)
 
OgreOggISoundgetSound (const std::string &name)
 
const Ogre::StringVector getSoundList () const
 
bool hasSound (const std::string &name)
 
void setGlobalPitch (float pitch)
 
const float getGlobalPitch () const
 
void stopAllSounds ()
 
void pauseAllSounds ()
 
void muteAllSounds ()
 
void unmuteAllSounds ()
 
void resumeAllPausedSounds ()
 
void destroyAllSounds ()
 
void destroySound (const std::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)
 
void setDopplerFactor (float factor=1.f)
 
void setSpeedOfSound (float speed=363.f)
 
void fadeMasterVolume (float time, bool fadeIn)
 
const Ogre::StringVector getDeviceList () const
 
OgreOggListenergetListener ()
 
int getNumSources () const
 
void update (float fTime=0.f)
 
void setResourceGroupName (const Ogre::String &group)
 
Ogre::String getResourceGroupName () const
 
bool hasXRamSupport ()
 
bool hasEFXSupport ()
 
bool hasEAXSupport ()
 
void setXRamBuffer (ALsizei numBuffers, ALuint *buffers)
 
void setXRamBufferMode (ALenum mode)
 
void setEFXDistanceUnits (float unit=3.3f)
 
bool createEFXFilter (const std::string &eName, ALint type, ALfloat gain=1.0, ALfloat hfGain=1.0)
 
bool createEFXEffect (const std::string &eName, ALint type, EAXREVERBPROPERTIES *props=0)
 
bool setEFXSoundProperties (const std::string &sName, float airAbsorption=0.f, float roomRolloff=0.f, float coneOuterHF=0.f)
 
bool _setEFXSoundPropertiesImpl (OgreOggISound *sound=0, float airAbsorption=0.f, float roomRolloff=0.f, float coneOuterHF=0.f)
 
bool setEFXEffectParameter (const std::string &eName, ALint effectType, ALenum attrib, ALfloat param)
 
bool setEFXEffectParameter (const std::string &eName, ALint type, ALenum attrib, ALfloat *params=0)
 
bool setEFXEffectParameter (const std::string &eName, ALint type, ALenum attrib, ALint param)
 
bool setEFXEffectParameter (const std::string &eName, ALint type, ALenum attrib, ALint *params=0)
 
int getNumberOfSupportedEffectSlots ()
 
int getNumberOfCreatedEffectSlots ()
 
bool createEFXSlot ()
 
bool attachEffectToSound (const std::string &sName, ALuint slot, const Ogre::String &effect="", const Ogre::String &filter="")
 
bool attachFilterToSound (const std::string &sName, const Ogre::String &filter="")
 
bool detachEffectFromSound (const std::string &sName, ALuint slotID)
 
bool detachFilterFromSound (const std::string &sName)
 
bool _attachEffectToSoundImpl (OgreOggISound *sound=0, ALuint slot=255, const Ogre::String &effect="", const Ogre::String &filter="")
 
bool _attachFilterToSoundImpl (OgreOggISound *sound=0, const Ogre::String &filter="")
 
bool _detachEffectFromSoundImpl (OgreOggISound *sound=0, ALuint slotID=255)
 
bool _detachFilterFromSoundImpl (OgreOggISound *sound=0)
 
bool isEffectSupported (ALint effectID)
 
OgreOggSoundRecordcreateRecorder ()
 
OgreOggSoundRecordgetRecorder ()
 
bool isRecordingAvailable () const
 
- Public Member Functions inherited from Ogre::Singleton< OgreOggSoundManager >
 Singleton (void)
 
 ~Singleton (void)
 

Static Public Attributes

static const Ogre::String OGREOGGSOUND_VERSION_STRING
 

Private Types

typedef ALboolean(__cdecl * LPEAXSETBUFFERMODE) (ALsizei n, ALuint *buffers, ALint value)
 
typedef ALenum(__cdecl * LPEAXGETBUFFERMODE) (ALuint buffer, ALint *value)
 

Private Member Functions

OgreOggISound_createSoundImpl (Ogre::SceneManager *scnMgr, const std::string &name, const std::string &file, bool stream=false, bool loop=false, bool preBuffer=false, bool immediate=false)
 
void _loadSoundImpl (OgreOggISound *sound, const Ogre::String &file, bool prebuffer)
 
void _destroySoundImpl (OgreOggISound *sound=0)
 
void _releaseSoundImpl (OgreOggISound *sound=0)
 
void _removeFromLists (OgreOggISound *sound=0)
 
void _stopAllSoundsImpl ()
 
void _setGlobalPitchImpl ()
 
void _pauseAllSoundsImpl ()
 
void _resumeAllPausedSoundsImpl ()
 
void _destroyAllSoundsImpl ()
 
int _createSourcePool ()
 
sharedAudioBuffer_getSharedBuffer (const Ogre::String &sName)
 
Ogre::DataStreamPtr _openStream (const Ogre::String &file) const
 
void _releaseAll ()
 
void _checkFeatureSupport ()
 
bool _checkEFXSupport ()
 
bool _checkXRAMSupport ()
 
void _determineAuxEffectSlots ()
 
ALuint _getEFXFilter (const std::string &fName)
 
ALuint _getEFXEffect (const std::string &eName)
 
ALuint _getEFXSlot (int slotID=0)
 
bool _setEAXReverbProperties (EFXEAXREVERBPROPERTIES *pEFXEAXReverb, ALuint uiEffect)
 
bool _attachEffectToSlot (ALuint slot, ALuint effect)
 
void _reactivateQueuedSounds ()
 
void _reactivateQueuedSoundsImpl ()
 
void _enumDevices ()
 
OgreOggListener_createListener ()
 
void _destroyListener ()
 

Static Private Member Functions

static Ogre::Real _calculateDistanceToListener (OgreOggISound *sound, const Ogre::Vector3 &listenerPos)
 

Private Attributes

LocklessQueue< OgreOggISound * > * mSoundsToDestroy
 
ALCdevice * mDevice
 
ALCcontext * mContext
 
ALfloat mOrigVolume
 
SoundMap mSoundMap
 
ActiveList mActiveSounds
 
ActiveList mPausedSounds
 
ActiveList mSoundsToReactivate
 
ActiveList mWaitingSounds
 
SourceList mSourcePool
 
FeatureList mEFXSupportList
 
SharedBufferList mSharedBuffers
 
Ogre::Real mFadeTime
 
Ogre::Real mFadeTimer
 
bool mFadeIn
 
bool mFadeVolume
 
ALCchar * mDeviceStrings
 
unsigned int mNumSources
 
unsigned int mMaxSources
 
float mGlobalPitch
 
OgreOggSoundRecordmRecorder
 
bool mEFXSupport
 
LPALGENEFFECTS alGenEffects
 
LPALDELETEEFFECTS alDeleteEffects
 
LPALISEFFECT alIsEffect
 
LPALEFFECTI alEffecti
 
LPALEFFECTIV alEffectiv
 
LPALEFFECTF alEffectf
 
LPALEFFECTFV alEffectfv
 
LPALGETEFFECTI alGetEffecti
 
LPALGETEFFECTIV alGetEffectiv
 
LPALGETEFFECTF alGetEffectf
 
LPALGETEFFECTFV alGetEffectfv
 
LPALGENFILTERS alGenFilters
 
LPALDELETEFILTERS alDeleteFilters
 
LPALISFILTER alIsFilter
 
LPALFILTERI alFilteri
 
LPALFILTERIV alFilteriv
 
LPALFILTERF alFilterf
 
LPALFILTERFV alFilterfv
 
LPALGETFILTERI alGetFilteri
 
LPALGETFILTERIV alGetFilteriv
 
LPALGETFILTERF alGetFilterf
 
LPALGETFILTERFV alGetFilterfv
 
LPALGENAUXILIARYEFFECTSLOTS alGenAuxiliaryEffectSlots
 
LPALDELETEAUXILIARYEFFECTSLOTS alDeleteAuxiliaryEffectSlots
 
LPALISAUXILIARYEFFECTSLOT alIsAuxiliaryEffectSlot
 
LPALAUXILIARYEFFECTSLOTI alAuxiliaryEffectSloti
 
LPALAUXILIARYEFFECTSLOTIV alAuxiliaryEffectSlotiv
 
LPALAUXILIARYEFFECTSLOTF alAuxiliaryEffectSlotf
 
LPALAUXILIARYEFFECTSLOTFV alAuxiliaryEffectSlotfv
 
LPALGETAUXILIARYEFFECTSLOTI alGetAuxiliaryEffectSloti
 
LPALGETAUXILIARYEFFECTSLOTIV alGetAuxiliaryEffectSlotiv
 
LPALGETAUXILIARYEFFECTSLOTF alGetAuxiliaryEffectSlotf
 
LPALGETAUXILIARYEFFECTSLOTFV alGetAuxiliaryEffectSlotfv
 
LPEAXSETBUFFERMODE mEAXSetBufferMode
 
LPEAXGETBUFFERMODE mEAXGetBufferMode
 
bool mEAXSupport
 
int mEAXVersion
 
bool mXRamSupport
 
EffectList mFilterList
 
EffectList mEffectList
 
SourceList mEffectSlotList
 
ALint mNumEffectSlots
 
ALint mNumSendsPerSource
 
ALenum mXRamSize
 
ALenum mXRamFree
 
ALenum mXRamAuto
 
ALenum mXRamHardware
 
ALenum mXRamAccessible
 
ALenum mCurrentXRamMode
 
ALint mXRamSizeMB
 
ALint mXRamFreeMB
 
Ogre::String mResourceGroupName
 
Ogre::SceneManagermSceneMgr
 
OgreOggListenermListener
 

Friends

class OgreOggSoundFactory
 

Additional Inherited Members

- Static Public Member Functions inherited from Ogre::Singleton< OgreOggSoundManager >
static OgreOggSoundManager & getSingleton (void)
 
static OgreOggSoundManager * getSingletonPtr (void)
 

Detailed Description

Sound Manager: Manages all sounds for an application.

Member Typedef Documentation

typedef ALenum(__cdecl * OgreOggSound::OgreOggSoundManager::LPEAXGETBUFFERMODE) (ALuint buffer, ALint *value)
private
typedef ALboolean(__cdecl * OgreOggSound::OgreOggSoundManager::LPEAXSETBUFFERMODE) (ALsizei n, ALuint *buffers, ALint value)
private

XRAM Support

Constructor & Destructor Documentation

OgreOggSound::OgreOggSoundManager::OgreOggSoundManager ( )

Creates a manager for all sounds within the application.

OgreOggSound::OgreOggSoundManager::~OgreOggSoundManager ( )

Destroys this manager.

Remarks
Destroys all sound objects and thread if defined. Cleans up all OpenAL objects, buffers and devices and closes down the audio device.

Member Function Documentation

bool OgreOggSound::OgreOggSoundManager::_attachEffectToSlot ( ALuint  slot,
ALuint  effect 
)
private

Attaches a created effect to an Auxiliary slot

Parameters
slotslot ID
effecteffect 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

Remarks
Currently sound must have a source attached prior to this call.
Parameters
soundsound pointer
slotslot ID
effectname of effect as defined when created
filtername of filter as defined when created
bool OgreOggSound::OgreOggSoundManager::_attachFilterToSoundImpl ( OgreOggISound sound = 0,
const Ogre::String filter = "" 
)

Attaches a filter to a sound

Remarks
Currently sound must have a source attached prior to this call.
Parameters
soundsound pointer
filtername of filter as defined when created
static Ogre::Real OgreOggSound::OgreOggSoundManager::_calculateDistanceToListener ( OgreOggISound sound,
const Ogre::Vector3 listenerPos 
)
staticprivate

Calculates the distance a sound is from the specified listener position.

bool OgreOggSound::OgreOggSoundManager::_checkEFXSupport ( )
private

Checks for EFX hardware support

void OgreOggSound::OgreOggSoundManager::_checkFeatureSupport ( )
private

Checks and Logs a supported feature list

Remarks
Queries OpenAL for various supported features and lists them with the LogManager.
bool OgreOggSound::OgreOggSoundManager::_checkXRAMSupport ( )
private

Checks for XRAM hardware support

OgreOggListener* OgreOggSound::OgreOggSoundManager::_createListener ( )
private

Creates a listener object.

OgreOggISound* OgreOggSound::OgreOggSoundManager::_createSoundImpl ( Ogre::SceneManager scnMgr,
const std::string &  name,
const std::string &  file,
bool  stream = false,
bool  loop = false,
bool  preBuffer = false,
bool  immediate = false 
)
private

Creates a single sound object (implementation).

Remarks
Creates and inits a single sound object, depending on passed parameters this function will create a static/streamed sound. Each sound must have a unique name within the manager.
Parameters
scnMgrpointer to creator
nameUnique name of sound
fileAudio file path string
streamFlag indicating if the sound sound be streamed.
loopFlag indicating if the file should loop.
preBufferFlag indicating if a source should be attached at creation.
int OgreOggSound::OgreOggSoundManager::_createSourcePool ( )
private

Creates a pool of OpenAL sources for playback.

Remarks
Attempts to create a pool of source objects which allow simultaneous audio playback. The number of sources will be clamped to either the hardware maximum or [mMaxSources] whichever comes first.
void OgreOggSound::OgreOggSoundManager::_destroyAllSoundsImpl ( )
private

Destroys all sounds.

void OgreOggSound::OgreOggSoundManager::_destroyListener ( )
private

Destroys a listener object.

void OgreOggSound::OgreOggSoundManager::_destroySoundImpl ( OgreOggISound sound = 0)
private

Destroys a single sound.

Remarks
Destroys a single sound object.
Parameters
soundSound object to destroy.
void OgreOggSound::OgreOggSoundManager::_destroyTemporarySound ( OgreOggISound sound)

Destroys a temporary sound.

Remarks
Internal use only.
Parameters
soundSound to destroy.
void OgreOggSound::OgreOggSoundManager::_destroyTemporarySoundImpl ( OgreOggISound sound)

Destroys a temporary sound implementation

Remarks
Internal use only.
Parameters
soundSound to destroy.
bool OgreOggSound::OgreOggSoundManager::_detachEffectFromSoundImpl ( OgreOggISound sound = 0,
ALuint  slotID = 255 
)

Detaches all effects from a sound

Remarks
Currently sound must have a source attached prior to this call.
Parameters
soundsound pointer
slotIDslot ID
bool OgreOggSound::OgreOggSoundManager::_detachFilterFromSoundImpl ( OgreOggISound sound = 0)

Detaches all filters from a sound

Remarks
Currently sound must have a source attached prior to this call.
Parameters
soundsound pointer
void OgreOggSound::OgreOggSoundManager::_determineAuxEffectSlots ( )
private

Checks for EAX effect support

void OgreOggSound::OgreOggSoundManager::_enumDevices ( )
private

Enumerates audio devices.

Remarks
Gets a list of audio device available.
ALuint OgreOggSound::OgreOggSoundManager::_getEFXEffect ( const std::string &  eName)
private

Gets a specified EFX Effect

Parameters
eNamename of effect as defined when created.
ALuint OgreOggSound::OgreOggSoundManager::_getEFXFilter ( const std::string &  fName)
private

Gets a specified EFX filter

Parameters
fNamename of filter as defined when created.
ALuint OgreOggSound::OgreOggSoundManager::_getEFXSlot ( int  slotID = 0)
private

Gets a specified EFX Effect slot

Parameters
slotIDindex of auxiliary effect slot
sharedAudioBuffer* OgreOggSound::OgreOggSoundManager::_getSharedBuffer ( const Ogre::String sName)
private

Gets a shared audio buffer

Remarks
Returns a previously loaded shared buffer reference if available. NOTE:- Increments a reference count so releaseSharedBuffer() must be called when buffer is no longer used.
Parameters
sNameName of audio file
void OgreOggSound::OgreOggSoundManager::_loadSoundImpl ( OgreOggISound sound,
const Ogre::String file,
bool  prebuffer 
)
private

Implementation of sound loading

Parameters
soundsound pointer.
filename of sound file.
prebufferPrebuffer flag.
Ogre::DataStreamPtr OgreOggSound::OgreOggSoundManager::_openStream ( const Ogre::String file) const
private

Opens the specified file as a new data stream.

Parameters
fileThe path to the resource file to open.
void OgreOggSound::OgreOggSoundManager::_pauseAllSoundsImpl ( )
private

Pauses all currently playing sounds.

void OgreOggSound::OgreOggSoundManager::_reactivateQueuedSounds ( )
private

Re-activates any sounds which had their source stolen.

void OgreOggSound::OgreOggSoundManager::_reactivateQueuedSoundsImpl ( )
private

Re-activates any sounds which had their source stolen, implementation methods.

Remarks
When all sources are in use the sounds begin to give up their source objects to higher priority sounds. When this happens the lower priority sound is queued ready to re-play when a source becomes available again, this function checks this queue and tries to re-play those sounds. Only affects sounds which were originally playing when forced to give up their source object.
bool OgreOggSound::OgreOggSoundManager::_registerSharedBuffer ( const Ogre::String sName,
ALuint &  buffer,
OgreOggISound parent = 0 
)

Registers a shared audio buffer

Remarks
Internal function - SHOULD NOT BE CALLED BY USER CODE Its possible to share audio buffer data among many sources so this function registers an audio buffer as 'sharable', meaning if a the same audio file is created more then once, it will simply use the original buffer data instead of creating/loading the same data again.
Parameters
sNameName of audio file
bufferOpenAL buffer ID holding audio data
void OgreOggSound::OgreOggSoundManager::_releaseAll ( )
private

Releases all sounds and buffers

Remarks
Release all sounds and their associated OpenAL objects from the system.
bool OgreOggSound::OgreOggSoundManager::_releaseSharedBuffer ( const Ogre::String sName,
ALuint &  buffer 
)

Releases a shared audio buffer

Remarks
Internal function - SHOULD NOT BE CALLED BY USER CODE Each shared audio buffer is reference counted so destruction is handled correctly, this function merely decrements the reference count, only destroying when no sounds are referencing buffer.
Parameters
sNameName of audio file
bufferbuffer id
void OgreOggSound::OgreOggSoundManager::_releaseSoundImpl ( OgreOggISound sound = 0)
private

Destroys a single sound.

Remarks
Destroys a single sound object.
Parameters
soundSound to destroy.
bool OgreOggSound::OgreOggSoundManager::_releaseSoundSource ( OgreOggISound sound = 0)

Release a sounds source.

Remarks
Internal function - SHOULD NOT BE CALLED BY USER CODE Releases a specified sounds source object back to the system, allowing it to be re-used by another sound.
Parameters
soundSound pointer.
void OgreOggSound::OgreOggSoundManager::_removeFromLists ( OgreOggISound sound = 0)
private

Removes references of a sound from all possible internal lists.

Remarks
Various lists exist to manage numerous states of a sound, this function exists to remove a sound object from any/all lists it has previously been added to.
Parameters
soundSound to destroy.
bool OgreOggSound::OgreOggSoundManager::_requestSoundSource ( OgreOggISound sound = 0)

Requests a free source object.

Remarks
Internal function - SHOULD NOT BE CALLED BY USER CODE Retrieves a free source object and attaches it to the specified sound object. Internally checks for any currently available sources, then checks stopped sounds and finally prioritised sounds.
Parameters
soundSound pointer.
void OgreOggSound::OgreOggSoundManager::_resumeAllPausedSoundsImpl ( )
private

Resumes all previously playing sounds.

bool OgreOggSound::OgreOggSoundManager::_setEAXReverbProperties ( EFXEAXREVERBPROPERTIES *  pEFXEAXReverb,
ALuint  uiEffect 
)
private

Sets EAX reverb properties using a specified present

Parameters
pEFXEAXReverbpointer to converted EFXEAXREVERBPROPERTIES structure object
uiEffecteffect 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

Remarks
Tries to set EFX extended source properties.
Parameters
soundname of sound.
airAbsorptionabsorption factor for air.
roomRolloffroom rolloff factor.
coneOuterHFcone outer gain factor for High frequencies.
void OgreOggSound::OgreOggSoundManager::_setGlobalPitchImpl ( )
private

Applys global pitch.

void OgreOggSound::OgreOggSoundManager::_stopAllSoundsImpl ( )
private

Stops all currently playing sounds.

bool OgreOggSound::OgreOggSoundManager::attachEffectToSound ( const std::string &  sName,
ALuint  slot,
const Ogre::String effect = "",
const Ogre::String filter = "" 
)

Attaches an effect to a sound

Remarks
Currently sound must have a source attached prior to this call.
Parameters
sNamename of sound
slotslot ID
effectname of effect as defined when created
filtername of filter as defined when created
bool OgreOggSound::OgreOggSoundManager::attachFilterToSound ( const std::string &  sName,
const Ogre::String filter = "" 
)

Attaches a filter to a sound

Remarks
Currently sound must have a source attached prior to this call.
Parameters
sNamename of sound
filtername of filter as defined when created
bool OgreOggSound::OgreOggSoundManager::createEFXEffect ( const std::string &  eName,
ALint  type,
EAXREVERBPROPERTIES *  props = 0 
)

Creates a specified EFX effect

Remarks
Creates a specified EFX effect if hardware supports it. Optional reverb preset structure can be passed which will be applied to the effect. See eax-util.h for list of presets.
Parameters
eNamename for effect.
typesee OpenAL docs for available effects.
propslegacy structure describing a preset reverb effect.
bool OgreOggSound::OgreOggSoundManager::createEFXFilter ( const std::string &  eName,
ALint  type,
ALfloat  gain = 1.0,
ALfloat  hfGain = 1.0 
)

Creates a specified EFX filter

Remarks
Creates a specified EFX filter if hardware supports it.
Parameters
eNamename for filter.
typesee OpenAL docs for available filters.
gainsee OpenAL docs for available filters.
hfgainsee OpenAL docs for available filters.
bool OgreOggSound::OgreOggSoundManager::createEFXSlot ( )

Creates a specified EFX filter

Remarks
Creates a specified EFX filter if hardware supports it.
Parameters
eNamename for filter. type see OpenAL docs for available filter types.
bool OgreOggSound::OgreOggSoundManager::createListener ( )

Creates a listener object for the system

Remarks
Only needed when clearScene or similar is used which destroys listener object automatically without the manager knowing. You can therefore use this function to recreate a listener object for the system.
OgreOggSoundRecord* OgreOggSound::OgreOggSoundManager::createRecorder ( )
OgreOggISound* OgreOggSound::OgreOggSoundManager::createSound ( const std::string &  name,
const std::string &  file,
bool  stream = false,
bool  loop = false,
bool  preBuffer = false,
Ogre::SceneManager scnMgr = 0,
bool  immediate = false 
)

Creates a single sound object.

Remarks
Plugin specific version of createSound, uses createMovableObject() to instantiate a sound automatically registered with the supplied SceneManager, allows OGRE to automatically cleanup/manage this sound. Each sound must have a unique name within the manager.
Parameters
nameUnique name of sound
fileAudio file path string
streamFlag indicating if the sound sound be streamed.
loopFlag indicating if the file should loop.
preBufferFlag indicating if a source should be attached at creation.
scnMgrPointer to SceneManager this sound belongs - 0 defaults to first SceneManager defined.
immediatelyOptional 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 std::string &  name = "")

Destroys a single sound.

Remarks
Destroys a single sound object.
Parameters
nameSound name to destroy.
void OgreOggSound::OgreOggSoundManager::destroySound ( OgreOggISound sound)

Destroys a single sound.

Remarks
Destroys a single sound object.
Parameters
nameSound name to destroy.
bool OgreOggSound::OgreOggSoundManager::detachEffectFromSound ( const std::string &  sName,
ALuint  slotID 
)

Detaches all effects from a sound

Remarks
Currently sound must have a source attached prior to this call.
Parameters
sNamename of sound
slotIDslot ID
bool OgreOggSound::OgreOggSoundManager::detachFilterFromSound ( const std::string &  sName)

Detaches all filters from a sound

Remarks
Currently sound must have a source attached prior to this call.
Parameters
sNamename of sound
void OgreOggSound::OgreOggSoundManager::fadeMasterVolume ( float  time,
bool  fadeIn 
)

Fades master volume in/out

Remarks
Allows fading of in/out of alls sounds
const Ogre::StringVector OgreOggSound::OgreOggSoundManager::getDeviceList ( ) const

Gets a list of device strings

Remarks
Creates a list of available audio device strings
const float OgreOggSound::OgreOggSoundManager::getGlobalPitch ( ) const

Gets the current global pitch.

OgreOggListener* OgreOggSound::OgreOggSoundManager::getListener ( )

Returns pointer to listener.

ALfloat OgreOggSound::OgreOggSoundManager::getMasterVolume ( )

Gets the current global volume for all sounds

int OgreOggSound::OgreOggSoundManager::getNumberOfCreatedEffectSlots ( )

Gets the number of currently created Auxiliary Effect slots

Remarks
Returns number of slots craeted and available for effects/filters.
int OgreOggSound::OgreOggSoundManager::getNumberOfSupportedEffectSlots ( )

Gets the maximum number of Auxiliary Effect slots per source

Remarks
Determines how many simultaneous effects can be applied to any one source object
unsigned int OgreOggSound::OgreOggSoundManager::getNumSounds ( ) const

Gets number of currently created sounds

References name.

int OgreOggSound::OgreOggSoundManager::getNumSources ( ) const

Returns number of sources created.

const ALCcontext* OgreOggSound::OgreOggSoundManager::getOpenalContext ( )

Gets the openal context ptr

const ALCdevice* OgreOggSound::OgreOggSoundManager::getOpenalDevice ( )

Gets the openal device ptr

OgreOggSoundRecord* OgreOggSound::OgreOggSoundManager::getRecorder ( )

Gets recording device

Ogre::String OgreOggSound::OgreOggSoundManager::getResourceGroupName ( ) const

Returns user defined search group name

Ogre::SceneManager* OgreOggSound::OgreOggSoundManager::getSceneManager ( )

Gets the default SceneManager for creation of sound objects

OgreOggISound* OgreOggSound::OgreOggSoundManager::getSound ( const std::string &  name)

Gets a named sound.

Remarks
Returns a named sound object if defined, NULL otherwise.
Parameters
nameSound name.
const Ogre::StringVector OgreOggSound::OgreOggSoundManager::getSoundList ( ) const

Gets list of created sounds.

Remarks
Returns a vector of sound name strings.
bool OgreOggSound::OgreOggSoundManager::hasEAXSupport ( )

Returns EAX support status.

References type.

bool OgreOggSound::OgreOggSoundManager::hasEFXSupport ( )

Returns EFX support status.

bool OgreOggSound::OgreOggSoundManager::hasSound ( const std::string &  name)

Returns whether named sound exists.

Remarks
Checks sound map for a named sound.
Parameters
nameSound name.
bool OgreOggSound::OgreOggSoundManager::hasXRamSupport ( )

Returns XRAM support status.

bool OgreOggSound::OgreOggSoundManager::init ( const std::string &  deviceName = "",
unsigned int  maxSources = 100,
unsigned int  queueListSize = 100,
Ogre::SceneManager sMan = 0 
)

Initialises the audio device.

Remarks
Attempts to initialise the audio device for sound playback. Internally some logging is done to list features supported as well as creating a pool of sources from which sounds can be attached and played.
Parameters
deviceNameAudio device string to open, will use default device if not found.
maxSourcesmaximum number of sources to allocate (optional)
queueListSizeDesired size of queue list (optional | Multi-threaded ONLY)
bool OgreOggSound::OgreOggSoundManager::isEffectSupported ( ALint  effectID)

Returns whether a specified effect is supported

Parameters
effectIDOpenAL effect/filter id. (AL_EFFECT... | AL_FILTER...)
bool OgreOggSound::OgreOggSoundManager::isRecordingAvailable ( ) const

Returns whether a capture device is available

void OgreOggSound::OgreOggSoundManager::muteAllSounds ( )

Mutes all sounds.

void OgreOggSound::OgreOggSoundManager::pauseAllSounds ( )

Pauses all currently playing sounds.

void OgreOggSound::OgreOggSoundManager::resumeAllPausedSounds ( )

Resumes all previously playing sounds.

void OgreOggSound::OgreOggSoundManager::setDistanceModel ( ALenum  value)

Sets distance model.

Remarks
Sets the global distance attenuation algorithm used by all sounds in the system.
Parameters
valueALenum value of distance model.
void OgreOggSound::OgreOggSoundManager::setDopplerFactor ( float  factor = 1.f)

Sets doppler factor.

Remarks
Sets the global doppler factor which affects attenuation for all sounds
Parameters
factorFactor scale (>0).
void OgreOggSound::OgreOggSoundManager::setEFXDistanceUnits ( float  unit = 3.3f)

Sets the distance units of measurement for EFX effects.

Remarks
Parameters
unitunits(meters).
bool OgreOggSound::OgreOggSoundManager::setEFXEffectParameter ( const std::string &  eName,
ALint  effectType,
ALenum  attrib,
ALfloat  param 
)

Sets a specified paremeter on an effect

Remarks
Tries to set a parameter value on a specified effect. Returns true/false.
Parameters
eNamename of effect.
effectTypesee OpenAL docs for available effects.
attribparameter value to alter.
paramfloat value to set.
bool OgreOggSound::OgreOggSoundManager::setEFXEffectParameter ( const std::string &  eName,
ALint  type,
ALenum  attrib,
ALfloat *  params = 0 
)

Sets a specified paremeter on an effect

Remarks
Tries to set a parameter value on a specified effect. Returns true/false.
Parameters
eNamename of effect.
typesee OpenAL docs for available effects.
attribparameter value to alter.
paramsvector pointer of float values to set.
bool OgreOggSound::OgreOggSoundManager::setEFXEffectParameter ( const std::string &  eName,
ALint  type,
ALenum  attrib,
ALint  param 
)

Sets a specified paremeter on an effect

Remarks
Tries to set a parameter value on a specified effect. Returns true/false.
Parameters
eNamename of effect.
typesee OpenAL docs for available effects.
attribparameter value to alter.
paraminteger value to set.
bool OgreOggSound::OgreOggSoundManager::setEFXEffectParameter ( const std::string &  eName,
ALint  type,
ALenum  attrib,
ALint *  params = 0 
)

Sets a specified paremeter on an effect

Remarks
Tries to set a parameter value on a specified effect. Returns true/false.
Parameters
eNamename of effect.
typesee OpenAL docs for available effects.
attribparameter value to alter.
paramsvector pointer of integer values to set.
bool OgreOggSound::OgreOggSoundManager::setEFXSoundProperties ( const std::string &  sName,
float  airAbsorption = 0.f,
float  roomRolloff = 0.f,
float  coneOuterHF = 0.f 
)

Sets extended properties on a specified sounds source

Remarks
Tries to set EFX extended source properties.
Parameters
sNamename of sound.
airAbsorptionabsorption factor for air.
roomRolloffroom rolloff factor.
coneOuterHFcone outer gain factor for High frequencies.
void OgreOggSound::OgreOggSoundManager::setGlobalPitch ( float  pitch)

Sets the pitch of all sounds.

Remarks
Sets the pitch modifier applied to all sounds.
Parameters
pitchnew pitch for all sounds (positive value)
void OgreOggSound::OgreOggSoundManager::setMasterVolume ( ALfloat  vol)

Sets the global volume for all sounds

Parameters
volglobal attenuation for all sounds.
void OgreOggSound::OgreOggSoundManager::setResourceGroupName ( const Ogre::String group)

Sets a resource group name to search for all sounds first.

Remarks
A speed improvement to skip the cost of searching all resource locations/groups when creating sounds. Will default to searching all groups if sound is not found.
Parameters
groupName of OGRE ResourceGroup.
void OgreOggSound::OgreOggSoundManager::setSceneManager ( Ogre::SceneManager sMan)

Sets the default SceneManager for creation of sound objects

void OgreOggSound::OgreOggSoundManager::setSpeedOfSound ( float  speed = 363.f)

Sets speed of sound.

Remarks
Sets the global speed of sound used in the attenuation algorithm, affects all sounds.
Parameters
speedSpeed (m/s).
void OgreOggSound::OgreOggSoundManager::setXRamBuffer ( ALsizei  numBuffers,
ALuint *  buffers 
)

Sets XRam buffers.

Remarks
Currently defaults to AL_STORAGE_AUTO.
void OgreOggSound::OgreOggSoundManager::setXRamBufferMode ( ALenum  mode)

Sets XRam buffers storage mode.

Remarks
Should be called before creating any sounds Options: AL_STORAGE_AUTOMATIC | AL_STORAGE_HARDWARE | AL_STORAGE_ACCESSIBLE
void OgreOggSound::OgreOggSoundManager::stopAllSounds ( )

Stops all currently playing sounds.

void OgreOggSound::OgreOggSoundManager::unmuteAllSounds ( )

Un mutes all sounds.

References value.

void OgreOggSound::OgreOggSoundManager::update ( float  fTime = 0.f)

Updates system.

Remarks
Iterates all sounds and updates them.
Parameters
fTimeElapsed frametime.

Friends And Related Function Documentation

friend class OgreOggSoundFactory
friend

Member Data Documentation

LPALAUXILIARYEFFECTSLOTF OgreOggSound::OgreOggSoundManager::alAuxiliaryEffectSlotf
private
LPALAUXILIARYEFFECTSLOTFV OgreOggSound::OgreOggSoundManager::alAuxiliaryEffectSlotfv
private
LPALAUXILIARYEFFECTSLOTI OgreOggSound::OgreOggSoundManager::alAuxiliaryEffectSloti
private
LPALAUXILIARYEFFECTSLOTIV OgreOggSound::OgreOggSoundManager::alAuxiliaryEffectSlotiv
private
LPALDELETEAUXILIARYEFFECTSLOTS OgreOggSound::OgreOggSoundManager::alDeleteAuxiliaryEffectSlots
private
LPALDELETEEFFECTS OgreOggSound::OgreOggSoundManager::alDeleteEffects
private
LPALDELETEFILTERS OgreOggSound::OgreOggSoundManager::alDeleteFilters
private
LPALEFFECTF OgreOggSound::OgreOggSoundManager::alEffectf
private
LPALEFFECTFV OgreOggSound::OgreOggSoundManager::alEffectfv
private
LPALEFFECTI OgreOggSound::OgreOggSoundManager::alEffecti
private
LPALEFFECTIV OgreOggSound::OgreOggSoundManager::alEffectiv
private
LPALFILTERF OgreOggSound::OgreOggSoundManager::alFilterf
private
LPALFILTERFV OgreOggSound::OgreOggSoundManager::alFilterfv
private
LPALFILTERI OgreOggSound::OgreOggSoundManager::alFilteri
private
LPALFILTERIV OgreOggSound::OgreOggSoundManager::alFilteriv
private
LPALGENAUXILIARYEFFECTSLOTS OgreOggSound::OgreOggSoundManager::alGenAuxiliaryEffectSlots
private
LPALGENEFFECTS OgreOggSound::OgreOggSoundManager::alGenEffects
private
LPALGENFILTERS OgreOggSound::OgreOggSoundManager::alGenFilters
private
LPALGETAUXILIARYEFFECTSLOTF OgreOggSound::OgreOggSoundManager::alGetAuxiliaryEffectSlotf
private
LPALGETAUXILIARYEFFECTSLOTFV OgreOggSound::OgreOggSoundManager::alGetAuxiliaryEffectSlotfv
private
LPALGETAUXILIARYEFFECTSLOTI OgreOggSound::OgreOggSoundManager::alGetAuxiliaryEffectSloti
private
LPALGETAUXILIARYEFFECTSLOTIV OgreOggSound::OgreOggSoundManager::alGetAuxiliaryEffectSlotiv
private
LPALGETEFFECTF OgreOggSound::OgreOggSoundManager::alGetEffectf
private
LPALGETEFFECTFV OgreOggSound::OgreOggSoundManager::alGetEffectfv
private
LPALGETEFFECTI OgreOggSound::OgreOggSoundManager::alGetEffecti
private
LPALGETEFFECTIV OgreOggSound::OgreOggSoundManager::alGetEffectiv
private
LPALGETFILTERF OgreOggSound::OgreOggSoundManager::alGetFilterf
private
LPALGETFILTERFV OgreOggSound::OgreOggSoundManager::alGetFilterfv
private
LPALGETFILTERI OgreOggSound::OgreOggSoundManager::alGetFilteri
private
LPALGETFILTERIV OgreOggSound::OgreOggSoundManager::alGetFilteriv
private
LPALISAUXILIARYEFFECTSLOT OgreOggSound::OgreOggSoundManager::alIsAuxiliaryEffectSlot
private
LPALISEFFECT OgreOggSound::OgreOggSoundManager::alIsEffect
private
LPALISFILTER OgreOggSound::OgreOggSoundManager::alIsFilter
private
ActiveList OgreOggSound::OgreOggSoundManager::mActiveSounds
private
ALCcontext* OgreOggSound::OgreOggSoundManager::mContext
private
ALenum OgreOggSound::OgreOggSoundManager::mCurrentXRamMode
private
ALCdevice* OgreOggSound::OgreOggSoundManager::mDevice
private

OpenAL device objects

ALCchar* OgreOggSound::OgreOggSoundManager::mDeviceStrings
private
LPEAXGETBUFFERMODE OgreOggSound::OgreOggSoundManager::mEAXGetBufferMode
private
LPEAXSETBUFFERMODE OgreOggSound::OgreOggSoundManager::mEAXSetBufferMode
private
bool OgreOggSound::OgreOggSoundManager::mEAXSupport
private

EAX Support

int OgreOggSound::OgreOggSoundManager::mEAXVersion
private
EffectList OgreOggSound::OgreOggSoundManager::mEffectList
private
SourceList OgreOggSound::OgreOggSoundManager::mEffectSlotList
private
bool OgreOggSound::OgreOggSoundManager::mEFXSupport
private

EFX Support

FeatureList OgreOggSound::OgreOggSoundManager::mEFXSupportList
private
bool OgreOggSound::OgreOggSoundManager::mFadeIn
private
Ogre::Real OgreOggSound::OgreOggSoundManager::mFadeTime
private

Fading vars

Ogre::Real OgreOggSound::OgreOggSoundManager::mFadeTimer
private
bool OgreOggSound::OgreOggSoundManager::mFadeVolume
private
EffectList OgreOggSound::OgreOggSoundManager::mFilterList
private
float OgreOggSound::OgreOggSoundManager::mGlobalPitch
private
OgreOggListener* OgreOggSound::OgreOggSoundManager::mListener
private

Listener pointer

unsigned int OgreOggSound::OgreOggSoundManager::mMaxSources
private
ALint OgreOggSound::OgreOggSoundManager::mNumEffectSlots
private
ALint OgreOggSound::OgreOggSoundManager::mNumSendsPerSource
private
unsigned int OgreOggSound::OgreOggSoundManager::mNumSources
private
ALfloat OgreOggSound::OgreOggSoundManager::mOrigVolume
private
ActiveList OgreOggSound::OgreOggSoundManager::mPausedSounds
private
OgreOggSoundRecord* OgreOggSound::OgreOggSoundManager::mRecorder
private
Ogre::String OgreOggSound::OgreOggSoundManager::mResourceGroupName
private
Ogre::SceneManager* OgreOggSound::OgreOggSoundManager::mSceneMgr
private
SharedBufferList OgreOggSound::OgreOggSoundManager::mSharedBuffers
private
SoundMap OgreOggSound::OgreOggSoundManager::mSoundMap
private

Sound lists

LocklessQueue<OgreOggISound*>* OgreOggSound::OgreOggSoundManager::mSoundsToDestroy
private

Creates a recordable object

ActiveList OgreOggSound::OgreOggSoundManager::mSoundsToReactivate
private
SourceList OgreOggSound::OgreOggSoundManager::mSourcePool
private
ActiveList OgreOggSound::OgreOggSoundManager::mWaitingSounds
private
ALenum OgreOggSound::OgreOggSoundManager::mXRamAccessible
private
ALenum OgreOggSound::OgreOggSoundManager::mXRamAuto
private
ALenum OgreOggSound::OgreOggSoundManager::mXRamFree
private
ALint OgreOggSound::OgreOggSoundManager::mXRamFreeMB
private
ALenum OgreOggSound::OgreOggSoundManager::mXRamHardware
private
ALenum OgreOggSound::OgreOggSoundManager::mXRamSize
private
ALint OgreOggSound::OgreOggSoundManager::mXRamSizeMB
private
bool OgreOggSound::OgreOggSoundManager::mXRamSupport
private
const Ogre::String OgreOggSound::OgreOggSoundManager::OGREOGGSOUND_VERSION_STRING
static

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