|
Planeshift
|
This Manager Object is used to play all sounds. More...
#include <manager.h>
Public Member Functions | |
| SoundControl * | AddSoundControl (uint sndCtrlID) |
| Returns a NEW SoundControl. More... | |
| csVector3 | GetListenerPos () const |
| Gets the listener position. More... | |
| csVector3 & | GetPlayerPosition () |
| Gets the current player's position. More... | |
| SoundControl * | GetSoundControl () |
| Returns a NEW SoundControl. More... | |
| SoundControl * | GetSoundControl (uint sndCtrlID) const |
| SoundData * | GetSoundData () |
| SoundDataCache * | GetSoundDataCache () const |
| SoundSystem * | GetSoundSystem () |
| SoundSystem * | GetSoundSystem () const |
| bool | Initialize (iObjectRegistry *objectReg) |
| Initializes this SoundSystemManager. More... | |
| bool | IsHandleValid (uint handleID) const |
| Check if the given handle ID exists. More... | |
| bool | Play2DSound (const char *name, bool loop, size_t loopstart, size_t loopend, float volume_preset, SoundControl *&sndCtrl, SoundHandle *&handle) |
| Plays a 2D sound (Cannot be converted to 3D). More... | |
| bool | Play2DSound (const char *name, bool loop, size_t loopstart, size_t loopend, float volume_preset, SoundControl *&sndCtrl, SoundHandle *&handle) |
| Plays a 2D sound (Cannot be converted to 3D). More... | |
| bool | Play3DSound (const char *name, bool loop, size_t loopstart, size_t loopend, float volume_preset, SoundControl *&sndCtrl, csVector3 pos, csVector3 dir, float mindist, float maxdist, float rad, int type3d, SoundHandle *&handle) |
| Plays a 3D sound. More... | |
| bool | Play3DSound (const char *name, bool loop, size_t loopstart, size_t loopend, float volume_preset, SoundControl *&sndCtrl, csVector3 pos, csVector3 dir, float mindist, float maxdist, float rad, int type3d, SoundHandle *&handle, bool dopplerEffect=true) |
| Plays a 3D sound. More... | |
| void | RemoveSoundControl (uint sndCtrlID) |
| void | SetPlayerPosition (csVector3 &pos) |
| Sets the current player's position. More... | |
| void | SetPlayerVelocity (csVector3 vel) |
| Sets the player velocity. More... | |
| bool | SetSoundSource (uint handleID, csVector3 position) |
| Set the position of the sound source of the handle with the given ID. More... | |
| SoundSystemManager (iObjectRegistry *objectReg) | |
| Constructor initializes this SoundSystemManager. More... | |
| SoundSystemManager () | |
| Constructor. More... | |
| void | StopSound (SoundHandle *handle) |
| Stops and removes a SoundHandle. More... | |
| bool | StopSound (uint handleID) |
| Pause a sound and set the autoremove. More... | |
| void | Update () |
| Updates this SoundManager and everything its driving. More... | |
| void | Update () |
| Updates this SoundManager and everything its driving. More... | |
| void | UpdateListener (csVector3 v, csVector3 f, csVector3 t) |
| Update listener position. More... | |
| void | UpdateListener (csVector3 v, csVector3 f, csVector3 t) |
| Update listener position. More... | |
| void | UpdateSound () |
| Checks all SoundHandles alters Volume, does fading and removes them if Unmanaged (Autoremove true). More... | |
| void | UpdateSound () |
| Checks all SoundHandles alters Volume, does fading, applies the Doppler effect and removes them if Unmanaged (Autoremove true). More... | |
| ~SoundSystemManager () | |
| Destructor will remove everything this SoundManager created. More... | |
| ~SoundSystemManager () | |
| Destructor will remove everything this SoundManager created. More... | |
Public Member Functions inherited from Singleton< SoundSystemManager > | |
| Singleton (SoundSystemManager *ptr) | |
| Singleton (void) | |
| ~Singleton () | |
Public Attributes | |
| SoundControl * | effectSndCtrl |
| sound control for effects / actions More... | |
| csRef< iEventTimer > | eventTimer |
| timer event used by all the sound handle to play after a delay More... | |
| SoundControl * | guiSndCtrl |
| sound control for paws / gui More... | |
| bool | Initialised |
| is initialized ? More... | |
| SoundControl * | mainSndCtrl |
| sound control for this manager More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Singleton< SoundSystemManager > | |
| static SoundSystemManager & | GetSingleton (void) |
| static SoundSystemManager * | GetSingletonPtr (void) |
This Manager Object is used to play all sounds.
It keeps track of Data/Sounds and does fading, sets volume and removes sounds which are no longer needed. You may use the Play*Sound methods to play a sound. You need a
TODO merge Play* functions
It keeps track of Data/Sounds and does fading, sets volume and removes sounds which are no longer needed. You may use the Play*Sound methods to play a sound. You need a
| SoundSystemManager::SoundSystemManager | ( | iObjectRegistry * | objectReg | ) |
Constructor initializes this SoundSystemManager.
Also initializes a
| SoundSystemManager::~SoundSystemManager | ( | ) |
Destructor will remove everything this SoundManager created.
It will stop and delete all Handles, removes
| SoundSystemManager::SoundSystemManager | ( | ) |
Constructor.
| SoundSystemManager::~SoundSystemManager | ( | ) |
Destructor will remove everything this SoundManager created.
It will stop and delete all Handles, removes
| SoundControl* SoundSystemManager::AddSoundControl | ( | uint | sndCtrlID | ) |
Returns a NEW SoundControl.
It creates a new SoundControl and returns it. Also keeps a internal list of all existing SoundControls. But atm there is no way to recover a lost SoundControl.
| csVector3 SoundSystemManager::GetListenerPos | ( | ) | const |
Gets the listener position.
| csVector3& SoundSystemManager::GetPlayerPosition | ( | ) |
Gets the current player's position.
| SoundControl* SoundSystemManager::GetSoundControl | ( | ) |
Returns a NEW SoundControl.
It creates a new SoundControl and returns it. Also keeps a internal list of all existing SoundControls. But atm there is no way to recover a lost SoundControl.
| SoundControl* SoundSystemManager::GetSoundControl | ( | uint | sndCtrlID | ) | const |
|
inline |
|
inline |
|
inline |
| bool SoundSystemManager::Initialize | ( | iObjectRegistry * | objectReg | ) |
Initializes this SoundSystemManager.
Also initializes a
| objectReg | the object registry. |
| bool SoundSystemManager::IsHandleValid | ( | uint | handleID | ) | const |
Check if the given handle ID exists.
| handleID | the handle ID to check. |
| bool SoundSystemManager::Play2DSound | ( | const char * | name, |
| bool | loop, | ||
| size_t | loopstart, | ||
| size_t | loopend, | ||
| float | volume_preset, | ||
| SoundControl *& | sndCtrl, | ||
| SoundHandle *& | handle | ||
| ) |
Plays a 2D sound (Cannot be converted to 3D).
| name | name of the resource you want to play |
| loop | LOOP or DONT_LOOP |
| loopstart | startframe when looping |
| loopend | when reach it will jump to startframe |
| volume_preset | volume for this sound, all volume calculations are based upon this |
| sndCtrl | SoundControl to control this sound |
| handle | a Handle you have to supply. You may discard it if you dont want to manage this sound. |
| bool SoundSystemManager::Play2DSound | ( | const char * | name, |
| bool | loop, | ||
| size_t | loopstart, | ||
| size_t | loopend, | ||
| float | volume_preset, | ||
| SoundControl *& | sndCtrl, | ||
| SoundHandle *& | handle | ||
| ) |
Plays a 2D sound (Cannot be converted to 3D).
| name | name of the resource you want to play |
| loop | LOOP or DONT_LOOP |
| loopstart | startframe when looping |
| loopend | when reach it will jump to startframe |
| volume_preset | volume for this sound, all volume calculations are based upon this |
| sndCtrl | SoundControl to control this sound |
| handle | a Handle you have to supply. If the handle is null a new one is created. You may discard it if you dont want to manage this sound. |
| bool SoundSystemManager::Play3DSound | ( | const char * | name, |
| bool | loop, | ||
| size_t | loopstart, | ||
| size_t | loopend, | ||
| float | volume_preset, | ||
| SoundControl *& | sndCtrl, | ||
| csVector3 | pos, | ||
| csVector3 | dir, | ||
| float | mindist, | ||
| float | maxdist, | ||
| float | rad, | ||
| int | type3d, | ||
| SoundHandle *& | handle | ||
| ) |
Plays a 3D sound.
| name | name of the resource you want to play |
| loop | LOOP or DONT_LOOP |
| loopstart | startframe when looping |
| loopend | when reach it will jump to startframe |
| volume_preset | volume for this sound, all volume calculations are based upon this |
| sndCtrl | the sound controller |
| pos | Sound 3d position of the sound, keep type3d in mind because it can be ABSOLUTE or RELATIVE |
| dir | direction this sound is emitting to |
| mindist | distance when maxvolume should be reached |
| maxdist | distance when minvolume is applied |
| rad | radiation of the directional cone. Set it to 0 if you dont want a directional sound. |
| type3d | Either ABSOLUTE or RELATIVE. |
| handle | a Handle you have to supply. You may discard it if you dont want to manage this sound. |
| bool SoundSystemManager::Play3DSound | ( | const char * | name, |
| bool | loop, | ||
| size_t | loopstart, | ||
| size_t | loopend, | ||
| float | volume_preset, | ||
| SoundControl *& | sndCtrl, | ||
| csVector3 | pos, | ||
| csVector3 | dir, | ||
| float | mindist, | ||
| float | maxdist, | ||
| float | rad, | ||
| int | type3d, | ||
| SoundHandle *& | handle, | ||
| bool | dopplerEffect = true |
||
| ) |
Plays a 3D sound.
| name | name of the resource you want to play |
| loop | LOOP or DONT_LOOP |
| loopstart | startframe when looping |
| loopend | when reach it will jump to startframe |
| volume_preset | volume for this sound, all volume calculations are based upon this |
| pos | Sound 3d position of the sound, keep type3d in mind because it can be ABSOLUTE or RELATIVE |
| dir | direction this sound is emitting to |
| mindist | distance when maxvolume should be reached |
| maxdist | distance when minvolume is applied |
| rad | radiation of the directional cone. Set it to 0 if you dont want a directional sound. |
| handle | a Handle you have to supply. If the handle is null a new one is created. You may discard it if you dont want to manage this sound. |
| dopplerEffect | true to apply the doppler effect to this sound, false otherwise. |
| void SoundSystemManager::RemoveSoundControl | ( | uint | sndCtrlID | ) |
| void SoundSystemManager::SetPlayerPosition | ( | csVector3 & | pos | ) |
Sets the current player's position.
| pos | the new player's position. |
| void SoundSystemManager::SetPlayerVelocity | ( | csVector3 | vel | ) |
Sets the player velocity.
| vel | the player's velocity. |
| bool SoundSystemManager::SetSoundSource | ( | uint | handleID, |
| csVector3 | position | ||
| ) |
Set the position of the sound source of the handle with the given ID.
| handleID | the ID of the handle to stop. |
| position | the new position of the sound's source. |
| void SoundSystemManager::StopSound | ( | SoundHandle * | handle | ) |
Stops and removes a SoundHandle.
Use with caution. It doesnt care if its still in use.
| handle | A valid soundhandle |
| bool SoundSystemManager::StopSound | ( | uint | handleID | ) |
Pause a sound and set the autoremove.
The handle is picked up in the next update.
| handleID | the ID of the handle to stop. |
| void SoundSystemManager::Update | ( | ) |
Updates this SoundManager and everything its driving.
Consider this as its Mainloop. It does ten updates per second. It calls UpdateSound and updates SoundData.
| void SoundSystemManager::Update | ( | ) |
Updates this SoundManager and everything its driving.
Consider this as its Mainloop. It does ten updates per second. It calls UpdateSound and updates SoundDataCache.
| void SoundSystemManager::UpdateListener | ( | csVector3 | v, |
| csVector3 | f, | ||
| csVector3 | t | ||
| ) |
Update listener position.
| v | viewpoint or for that matter hearpoint |
| f | front |
| t | top |
| void SoundSystemManager::UpdateListener | ( | csVector3 | v, |
| csVector3 | f, | ||
| csVector3 | t | ||
| ) |
Update listener position.
| v | viewpoint or for that matter hearpoint |
| f | front |
| t | top |
| void SoundSystemManager::UpdateSound | ( | ) |
Checks all SoundHandles alters Volume, does fading and removes them if Unmanaged (Autoremove true).
| void SoundSystemManager::UpdateSound | ( | ) |
Checks all SoundHandles alters Volume, does fading, applies the Doppler effect and removes them if Unmanaged (Autoremove true).
| SoundControl* SoundSystemManager::effectSndCtrl |
| csRef<iEventTimer> SoundSystemManager::eventTimer |
| SoundControl* SoundSystemManager::guiSndCtrl |
| SoundControl * SoundSystemManager::mainSndCtrl |