Planeshift
Public Member Functions | Public Attributes

psSoundSector Class Reference

work in progress - Looks like a mishap. More...

#include <pssoundsector.h>

List of all members.

Public Member Functions

void AddAmbient (csRef< iDocumentNode > Node)
void AddEmitter (csRef< iDocumentNode > Node)
 Adds one emitter from the current array of known emitters.
void AddEntityDefinition (csRef< iDocumentNode > entityNode)
 Loads an ENTITY entry from an xml file and generates an entity sound definition.
void AddMusic (csRef< iDocumentNode > Node)
void AddObjectEntity (iMeshWrapper *mesh, const char *meshName)
 Adds an object entity to be managed from the sector.
void Delete ()
void DeleteAmbient (psMusic *&ambient)
void DeleteEmitter (psEmitter *&emitter)
 Deletes one emitter from the current array of known emitters.
void DeleteEntity (psEntity *&entity)
void DeleteMusic (psMusic *&music)
void Load (csRef< iDocumentNode > sectorNode)
 Loads the sector's definition from the given node.
 psSoundSector (iObjectRegistry *objectReg)
 Create an empty psSoundSector with no musics, ambients, emitters and entities.
 psSoundSector (csRef< iDocumentNode > sectorNode, iObjectRegistry *objectReg)
 Creates a sound sector and loads its definition.
void Reload (csRef< iDocumentNode > sector)
void RemoveObjectEntity (iMeshWrapper *mesh, const char *meshName)
 Removes an object entity managed from the sector.
void SetEntityState (int state, iMeshWrapper *mesh, const char *actorName, bool forceChange)
 Sets the new state for the entity associated to the given mesh.
void UpdateAllEmitters (SoundControl *&ctrl)
 Start/stops all emitters based on distance and time of the day.
void UpdateAllEntities (SoundControl *&ctrl)
 Update all entities times, and based on their status generate a sound.
void UpdateAmbient (int type, SoundControl *&ctrl)
void UpdateEntity (iMeshWrapper *mesh, const char *meshName, SoundControl *&ctrl)
 Updates an object entity managed from the sector.
void UpdateMusic (bool loopToggle, int type, SoundControl *&ctrl)
 ~psSoundSector ()
 Destructor.

Public Attributes

bool active
 is this sector active?
psMusicactiveambient
 active ambient music
psMusicactivemusic
 active music
csArray< psMusic * > ambientarray
 array of available ambients
csArray< psEmitter * > emitterarray
 array of emitters
csHash< psEntity *, csString > factories
 hash of factory entities
csHash< psEntity *, csString > meshes
 hash of mesh entities
csArray< psMusic * > musicarray
 array of available musics
csString name
 name of this sector
csHash< psEntity *, uint > tempEntities
 hash of all the temporary psEntites (i.e. associated to a specific mesh)

Detailed Description

work in progress - Looks like a mishap.

I hope find a object where i can merge this into

Definition at line 48 of file pssoundsector.h.


Constructor & Destructor Documentation

psSoundSector::psSoundSector ( iObjectRegistry *  objectReg)

Create an empty psSoundSector with no musics, ambients, emitters and entities.

Parameters:
objectRegthe object registry.
psSoundSector::psSoundSector ( csRef< iDocumentNode >  sectorNode,
iObjectRegistry *  objectReg 
)

Creates a sound sector and loads its definition.

This is exactly identical to calling the normal constructor and then Load().

Parameters:
objectRegthe object registry.
sectorNodeiDocumentNode that contains the sector's definition.
psSoundSector::~psSoundSector ( )

Destructor.

Cleans all arrays


Member Function Documentation

void psSoundSector::AddAmbient ( csRef< iDocumentNode >  Node)
void psSoundSector::AddEmitter ( csRef< iDocumentNode >  Node)

Adds one emitter from the current array of known emitters.

Parameters:
ctrlThe sound control to be used to handle the update.
void psSoundSector::AddEntityDefinition ( csRef< iDocumentNode >  entityNode)

Loads an ENTITY entry from an xml file and generates an entity sound definition.

Parameters:
entityNodexml node to load
void psSoundSector::AddMusic ( csRef< iDocumentNode >  Node)
void psSoundSector::AddObjectEntity ( iMeshWrapper *  mesh,
const char *  meshName 
)

Adds an object entity to be managed from the sector.

Parameters:
meshThe mesh associated to the entity.
meshNamethe name associated to the entity.
void psSoundSector::Delete ( )
void psSoundSector::DeleteAmbient ( psMusic *&  ambient)
void psSoundSector::DeleteEmitter ( psEmitter *&  emitter)

Deletes one emitter from the current array of known emitters.

Parameters:
ctrlThe sound control to be used to handle the update.
void psSoundSector::DeleteEntity ( psEntity *&  entity)
void psSoundSector::DeleteMusic ( psMusic *&  music)
void psSoundSector::Load ( csRef< iDocumentNode >  sectorNode)

Loads the sector's definition from the given node.

This does not delete the previous data so, if called twice, the new definition is "appended" to the old one.

Parameters:
sectorNodethe node containing the sector's definition.
void psSoundSector::Reload ( csRef< iDocumentNode >  sector)
void psSoundSector::RemoveObjectEntity ( iMeshWrapper *  mesh,
const char *  meshName 
)

Removes an object entity managed from the sector.

Parameters:
meshThe mesh associated to the entity.
meshNamethe name associated to the entity.
void psSoundSector::SetEntityState ( int  state,
iMeshWrapper *  mesh,
const char *  actorName,
bool  forceChange 
)

Sets the new state for the entity associated to the given mesh.

If it is already playing a sound, it is stopped.

Parameters:
statethe new state >= 0 for the entity. For negative value the function is not defined.
meshthe mesh associated to the entity.
actorNamethe name associated to the entity.
forceChangeif 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 psSoundSector::UpdateAllEmitters ( SoundControl *&  ctrl)

Start/stops all emitters based on distance and time of the day.

Parameters:
ctrlThe sound control to be used to handle the update.
void psSoundSector::UpdateAllEntities ( SoundControl *&  ctrl)

Update all entities times, and based on their status generate a sound.

Parameters:
ctrlThe sound control to be used to handle the update.
void psSoundSector::UpdateAmbient ( int  type,
SoundControl *&  ctrl 
)
void psSoundSector::UpdateEntity ( iMeshWrapper *  mesh,
const char *  meshName,
SoundControl *&  ctrl 
)

Updates an object entity managed from the sector.

Parameters:
meshThe mesh associated to the entity.
meshNamethe name associated to the entity.
ctrlThe sound control to be used to handle the update.
void psSoundSector::UpdateMusic ( bool  loopToggle,
int  type,
SoundControl *&  ctrl 
)

Member Data Documentation

is this sector active?

Definition at line 52 of file pssoundsector.h.

active ambient music

Definition at line 53 of file pssoundsector.h.

active music

Definition at line 54 of file pssoundsector.h.

array of available ambients

Definition at line 55 of file pssoundsector.h.

array of emitters

Definition at line 57 of file pssoundsector.h.

csHash<psEntity*, csString> psSoundSector::factories

hash of factory entities

Definition at line 58 of file pssoundsector.h.

csHash<psEntity*, csString> psSoundSector::meshes

hash of mesh entities

Definition at line 59 of file pssoundsector.h.

array of available musics

Definition at line 56 of file pssoundsector.h.

name of this sector

Definition at line 51 of file pssoundsector.h.

hash of all the temporary psEntites (i.e. associated to a specific mesh)

Definition at line 60 of file pssoundsector.h.


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