|
Planeshift
|
This class handles every sound defined in a sector. More...
#include <sectormngr.h>
Public Member Functions | |
| void | AddObjectEntity (iMeshWrapper *mesh, const char *meshName) |
| Adds an object entity to be managed from the current sector. More... | |
| int | GetCombatStance () const |
| Gets the current combat stance. More... | |
| psSoundSector * | GetCommonSector () |
| Gets the common sector. More... | |
| int | GetTimeOfDay () const |
| Gets the time of the day. More... | |
| bool | Initialize (iObjectRegistry *objectReg) |
| Load all sound sectors defined in XML files stored in the areas folder. More... | |
| bool | IsCombatMusicOn () const |
| Checks if the combat music is activated. More... | |
| bool | IsLoopBGMOn () const |
| Checks if the background music loop is allowed. More... | |
| virtual void | OnSoundChange (SoundControl *sndCtrl) |
| This function is called everytime the volume or the toggle change. More... | |
| bool | ReloadSectors () |
| Reload all sound sectors from XML definition. More... | |
| void | RemoveObjectEntity (iMeshWrapper *mesh, const char *meshName) |
| Removes an object entity managed from the current sector. More... | |
| bool | SetActiveSector (const char *sectorName) |
| Sets the current active sector to the one with the given name and deactivate the previous one (if any). More... | |
| void | SetCombatMusicToggle (bool toggle) |
| Toggles the combat music. More... | |
| void | SetCombatStance (int newCombatStance) |
| Sets the current combat stance. More... | |
| void | SetEntityState (int state, iMeshWrapper *mesh, const char *meshName, bool forceChange) |
| Sets the new state for the entity associated to the given mesh. More... | |
| void | SetLoopBGMToggle (bool toggle) |
| Toggles the background music. More... | |
| void | SetTimeOfDay (int newTimeOfDay) |
| Sets the current time of the day. More... | |
| void | SetWeather (int newWeather) |
| Sets the current weather. More... | |
| SoundSectorManager () | |
| Constructor. More... | |
| void | UnloadSectors () |
| Unload all sound sectors. More... | |
| void | Update () |
| Update the active sector. More... | |
| void | UpdateObjectEntity (iMeshWrapper *mesh, const char *meshName) |
| Updates an object entity managed from the current sector. More... | |
| virtual | ~SoundSectorManager () |
| Destructor. More... | |
Public Member Functions inherited from Singleton< SoundSectorManager > | |
| Singleton (SoundSectorManager *ptr) | |
| Singleton (void) | |
| ~Singleton () | |
Additional Inherited Members | |
Static Public Member Functions inherited from Singleton< SoundSectorManager > | |
| static SoundSectorManager & | GetSingleton (void) |
| static SoundSectorManager * | GetSingletonPtr (void) |
This class handles every sound defined in a sector.
It basically controls all sounds that comes from the 3D world.
Definition at line 52 of file sectormngr.h.
| SoundSectorManager::SoundSectorManager | ( | ) |
Constructor.
|
virtual |
Destructor.
| void SoundSectorManager::AddObjectEntity | ( | iMeshWrapper * | mesh, |
| const char * | meshName | ||
| ) |
Adds an object entity to be managed from the current sector.
| mesh | The mesh associated to the entity. |
| meshName | the name associated to the entity. |
|
inline |
Gets the current combat stance.
Definition at line 143 of file sectormngr.h.
|
inline |
|
inline |
| bool SoundSectorManager::Initialize | ( | iObjectRegistry * | objectReg | ) |
Load all sound sectors defined in XML files stored in the areas folder.
Its * path is defined in the option Planeshift.Sound.AreasPath of the configuration file.
| objectReg | the object registry. |
|
inline |
Checks if the combat music is activated.
Definition at line 111 of file sectormngr.h.
|
inline |
Checks if the background music loop is allowed.
Definition at line 96 of file sectormngr.h.
|
virtual |
This function is called everytime the volume or the toggle change.
| sndCtrl | the SoundControl that has been changed. |
Implements iSoundControlListener.
| bool SoundSectorManager::ReloadSectors | ( | ) |
Reload all sound sectors from XML definition.
If SoundSectorManager has not been already initialized nothing happens.
| void SoundSectorManager::RemoveObjectEntity | ( | iMeshWrapper * | mesh, |
| const char * | meshName | ||
| ) |
Removes an object entity managed from the current sector.
| mesh | The mesh associated to the entity. |
| meshName | the name associated to the entity. |
| bool SoundSectorManager::SetActiveSector | ( | const char * | sectorName | ) |
Sets the current active sector to the one with the given name and deactivate the previous one (if any).
If no sound sector with that name is found, nothing change.
| void SoundSectorManager::SetCombatMusicToggle | ( | bool | toggle | ) |
Toggles the combat music.
| toggle | true to activate the combat music. |
| void SoundSectorManager::SetCombatStance | ( | int | newCombatStance | ) |
Sets the current combat stance.
| newCombatStance | the new combat stance. |
| void SoundSectorManager::SetEntityState | ( | int | state, |
| iMeshWrapper * | mesh, | ||
| const char * | meshName, | ||
| bool | forceChange | ||
| ) |
Sets the new state for the entity associated to the given mesh.
If it is already playing a sound, it is stopped.
| state | the new state >= 0 for the entity. For negative value the function is not defined. |
| mesh | the mesh associated to the entity. |
| meshName | the name associated to the entity. |
| forceChange | if it is false the entity does not change its state if the new one is not defined. If it is true the entity stops play any sound until a new valid state is defined. |
| void SoundSectorManager::SetLoopBGMToggle | ( | bool | toggle | ) |
Toggles the background music.
| toggle | true to make the background music to loop. |
| void SoundSectorManager::SetTimeOfDay | ( | int | newTimeOfDay | ) |
Sets the current time of the day.
| newTimeOfDay | the new time of the day. |
| void SoundSectorManager::SetWeather | ( | int | newWeather | ) |
Sets the current weather.
| newWeather | the new weather. |
| void SoundSectorManager::UnloadSectors | ( | ) |
Unload all sound sectors.
| void SoundSectorManager::Update | ( | ) |
Update the active sector.
This is called every x milliseconds by SoundManager::Update() It updates Emitters and Entities
| void SoundSectorManager::UpdateObjectEntity | ( | iMeshWrapper * | mesh, |
| const char * | meshName | ||
| ) |
Updates an object entity managed from the current sector.
| mesh | The mesh associated to the entity. |
| meshName | the name associated to the entity. |