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. | |
int | GetCombatStance () const |
Gets the current combat stance. | |
psSoundSector * | GetCommonSector () |
Gets the common sector. | |
int | GetTimeOfDay () const |
Gets the time of the day. | |
bool | Initialize (iObjectRegistry *objectReg) |
Load all sound sectors defined in XML files stored in the areas folder. | |
bool | IsCombatMusicOn () const |
Checks if the combat music is activated. | |
bool | IsLoopBGMOn () const |
Checks if the background music loop is allowed. | |
virtual void | OnSoundChange (SoundControl *sndCtrl) |
This function is called everytime the volume or the toggle change. | |
bool | ReloadSectors () |
Reload all sound sectors from XML definition. | |
void | RemoveObjectEntity (iMeshWrapper *mesh, const char *meshName) |
Removes an object entity managed from the current sector. | |
bool | SetActiveSector (const char *sectorName) |
Sets the current active sector to the one with the given name and deactivate the previous one (if any). | |
void | SetCombatMusicToggle (bool toggle) |
Toggles the combat music. | |
void | SetCombatStance (int newCombatStance) |
Sets the current combat stance. | |
void | SetEntityState (int state, iMeshWrapper *mesh, const char *meshName, bool forceChange) |
Sets the new state for the entity associated to the given mesh. | |
void | SetLoopBGMToggle (bool toggle) |
Toggles the background music. | |
void | SetTimeOfDay (int newTimeOfDay) |
Sets the current time of the day. | |
void | SetWeather (int newWeather) |
Sets the current weather. | |
SoundSectorManager () | |
Constructor. | |
void | UnloadSectors () |
Unload all sound sectors. | |
void | Update () |
Update the active sector. | |
void | UpdateObjectEntity (iMeshWrapper *mesh, const char *meshName) |
Updates an object entity managed from the current sector. | |
virtual | ~SoundSectorManager () |
Destructor. |
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 SoundSectorManager::~SoundSectorManager | ( | ) | [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. |
int SoundSectorManager::GetCombatStance | ( | ) | const [inline] |
Gets the current combat stance.
Definition at line 143 of file sectormngr.h.
psSoundSector* SoundSectorManager::GetCommonSector | ( | ) | [inline] |
int SoundSectorManager::GetTimeOfDay | ( | ) | const [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. |
bool SoundSectorManager::IsCombatMusicOn | ( | ) | const [inline] |
Checks if the combat music is activated.
Definition at line 111 of file sectormngr.h.
bool SoundSectorManager::IsLoopBGMOn | ( | ) | const [inline] |
Checks if the background music loop is allowed.
Definition at line 96 of file sectormngr.h.
virtual void SoundSectorManager::OnSoundChange | ( | SoundControl * | sndCtrl | ) | [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. |