VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtExerciseSoundPlayer Class Reference

Instances of DtExerciseSoundPlayer automatically control a VR-Link exercise by attaching sounds to its entities and interaction using a specified MTL File. More...

Inheritance diagram for makVrv::DtExerciseSoundPlayer:
Inheritance graph
[legend]

Public Member Functions

 DtExerciseSoundPlayer (DtExerciseConn *exConn, DtReflectedEntityList *rel, const char *mtlFilename)
 Gets sound mappings from the given mtl file.
 DtExerciseSoundPlayer (DtExerciseConn *exConn, DtReflectedEntityList *rel, DtSoundMapper *soundMapper)
 Uses an existing DtSoundMapper object.
virtual ~DtExerciseSoundPlayer ()
 Virtual DTOR.
virtual void tick (DtConstVector viewPosition, DtConstVector viewVelocity, const DtTaitBryan &viewAngle)
 Overridden tick(..) Each call to tick updates the listener's position and orientation and manages starting, stopping and cleanup of sounds each frame.
virtual void mapEntitySound (const DtEntityType &entity, const std::string filename)
 Add an Entity to Sound-file mapping, or change an existing mapping if one already exists.
virtual void removeEntitySoundMap (const DtEntityType &entity)
 Remove an existing Entity to Sound-file mapping.
virtual void mapFireSound (const DtEntityType &entity, const std::string filename, double duration=-1.0, int channel=0)
 Add a Fire to Sound-file mapping, or change an existing mapping if one already exists.
virtual void removeFireSoundMap (const DtEntityType &entity)
 Remove an existing Fire to Sound-file mapping.
virtual void mapDetonationSound (const DtEntityType &entity, const std::string filename, double duration=-1.0, int channel=0, int result=-1)
 Add a Detonation to Sound-file mapping, or change an existing mapping if one already exists.
virtual void removeDetonationSoundMap (const DtEntityType &entity, int result=-1)
 Remove an existing Detonation to Sound-file mapping.
virtual void clearSoundMappings ()
 Clear all the sound maps.
virtual void recycleSoundSources ()
 Recycle sounds sources.
const DtSoundMapper * soundMapper () const
 Get the sound mapper.
- Public Member Functions inherited from makVrv::DtNetSoundPlayer
 DtNetSoundPlayer (DtExerciseConn *exConn)
 Initialization CTOR.
virtual ~DtNetSoundPlayer ()
 Virtual DTOR.
void setExerciseConn (DtExerciseConn *exConn)
 Set a new exercise connection.
void registerSignalCallbacks ()
 Register a signal interaction callback with the exercise connection.
void unregisterSignalCallbacks ()
 Unregister the signal interaction callback from the exercise connection.
virtual void setProcessSignalInteractions (bool)
 Change setting to process signal callbacks.
virtual bool processSignalInteractions () const
 Get the current setting to process signal callbacks.

Protected Member Functions

virtual bool initialize (DtExerciseConn *exConn, DtReflectedEntityList *rel)
 Initialize the view position and connect to the reflected entity list.
virtual void registerCallbacks ()
 A helper function to register callbacks with the reflected entity list.
virtual void unregisterCallbacks ()
 A helper function to unregister callbacks from the reflected entity list.
virtual void onRecycleSoundSources ()
 A helper function to recycle the currently playing sound sources.
virtual void addEntitiesFromList (DtReflectedEntityList *rel)
 A helper function to add a list of reflected entities.
virtual void removeEntitiesFromList (DtReflectedEntityList *rel)
 A helper function to remove a list of reflected entities.
Virtual callbacks
virtual void onEntityAdded (DtReflectedEntity *entity)
 Called when a reflected entity has been added to the simulation.
virtual void onEntityRemoved (DtReflectedEntity *entity)
 Called when a reflected entity has been removed from the simulation.
virtual void onFireInteraction (DtFireInteraction *fire)
 Called when a fire interaction has occurred in the simulation.
virtual void onDetonationInteraction (DtDetonationInteraction *detonation)
 Called when a detonation interaction has occurred in the simulation.
- Protected Member Functions inherited from makVrv::DtNetSoundPlayer
virtual bool addBufferSource (DtBufferSource *bs)
 Add a buffer source to the signal list.

Static Protected Member Functions

Static callbacks
static void entityAddedCb (DtReflectedEntity *entity, void *caller)
static void entityRemovedCb (DtReflectedEntity *entity, void *caller)
static void fireInteractionCb (DtFireInteraction *fire, void *caller)
static void detonationInteractionCb (DtDetonationInteraction *detonation, void *caller)
- Static Protected Member Functions inherited from makVrv::DtNetSoundPlayer
static void signalInteractionCb (DtSignalInteraction *sound, void *caller)
 Called on a signaled interaction.
static int processEncodingType (DtSignalInteraction *sound)
 Translate the OpenAL encoding type based on the signal interaction encoding type.
static bool canProcessEncodingClass (DtSignalInteraction *sound)
 Check for a valid encoding class.

Protected Attributes

DtReflectedEntityListmyRel
DtSoundMapper * mySoundMapper
DtVector myLastViewPos
DtVector myLastViewVel
DtTaitBryan myLastViewOri
bool myRecycleSourcesFlag
- Protected Attributes inherited from makVrv::DtNetSoundPlayer
DtExerciseConn * myExConn
bool myProcessSignalInteractions

Private Member Functions

 DtExerciseSoundPlayer (const DtExerciseSoundPlayer &orig)
 Copy CTOR.
DtExerciseSoundPlayeroperator= (const DtExerciseSoundPlayer &orig)
 Assignment operator.

Additional Inherited Members

- Static Protected Attributes inherited from makVrv::DtNetSoundPlayer
static DtList * mySignalList

Detailed Description

Instances of DtExerciseSoundPlayer automatically control a VR-Link exercise by attaching sounds to its entities and interaction using a specified MTL File.

Constructor & Destructor Documentation

makVrv::DtExerciseSoundPlayer::DtExerciseSoundPlayer ( DtExerciseConn *  exConn,
DtReflectedEntityList rel,
const char mtlFilename 
)

Gets sound mappings from the given mtl file.

Internally, creates a DtSoundMapper object with its own mtl environment, which then loads the mtl file.

Parameters
[in]exConnis a pointer to an exercise connection.
[in]relis a pointer to a list of reflected entities.
[in]mtlFilenameis the name of an MTL file to load.
makVrv::DtExerciseSoundPlayer::DtExerciseSoundPlayer ( DtExerciseConn *  exConn,
DtReflectedEntityList rel,
DtSoundMapper *  soundMapper 
)

Uses an existing DtSoundMapper object.

The caller is responsible for determining if the DtSoundMapper should load or not-load an MTL environment..

Parameters
[in]exConnis a pointer to an exercise connection.
[in]relis a pointer to a list of reflected entities.
[in]mtlFilenameis the name of an MTL file to load.
Note
This object will take ownership of the DtSoundMapper and delete it when this object is destroyed.
virtual makVrv::DtExerciseSoundPlayer::~DtExerciseSoundPlayer ( )
virtual

Virtual DTOR.

makVrv::DtExerciseSoundPlayer::DtExerciseSoundPlayer ( const DtExerciseSoundPlayer orig)
private

Copy CTOR.

Note
not implemented.

Member Function Documentation

virtual void makVrv::DtExerciseSoundPlayer::tick ( DtConstVector  viewPosition,
DtConstVector  viewVelocity,
const DtTaitBryan &  viewAngle 
)
virtual

Overridden tick(..) Each call to tick updates the listener's position and orientation and manages starting, stopping and cleanup of sounds each frame.

Parameters
[in]viewPositionis the location of the listener.
[in]viewVelocityis the moving velocity of the listener.
[in]viewAngleis the orientation of the listener.

Reimplemented from makVrv::DtNetSoundPlayer.

virtual void makVrv::DtExerciseSoundPlayer::mapEntitySound ( const DtEntityType &  entity,
const std::string  filename 
)
virtual

Add an Entity to Sound-file mapping, or change an existing mapping if one already exists.

Parameters
[in]entityis the Entity Type to be mapped to a sound-file.
[in]filenameis the name of a sound file to be mapped.
virtual void makVrv::DtExerciseSoundPlayer::removeEntitySoundMap ( const DtEntityType &  entity)
virtual

Remove an existing Entity to Sound-file mapping.

Parameters
[in]entityis the Entity Type who's mapping is to be removed.
virtual void makVrv::DtExerciseSoundPlayer::mapFireSound ( const DtEntityType &  entity,
const std::string  filename,
double  duration = -1.0,
int  channel = 0 
)
virtual

Add a Fire to Sound-file mapping, or change an existing mapping if one already exists.

Parameters
[in]entityis the Entity Type to be mapped to a sound-file.
[in]filenameis the name of a sound file to be mapped.
[in]durationis deprecated.
[in]channelis a flag limiting concurrently playing sounds.
virtual void makVrv::DtExerciseSoundPlayer::removeFireSoundMap ( const DtEntityType &  entity)
virtual

Remove an existing Fire to Sound-file mapping.

Parameters
[in]entityis the Entity Type who's mapping is to be removed.
virtual void makVrv::DtExerciseSoundPlayer::mapDetonationSound ( const DtEntityType &  entity,
const std::string  filename,
double  duration = -1.0,
int  channel = 0,
int  result = -1 
)
virtual

Add a Detonation to Sound-file mapping, or change an existing mapping if one already exists.

Parameters
[in]entityis the Entity Type to be mapped to a sound-file.
[in]filenameis the name of a sound file to be mapped.
[in]durationis deprecated.
[in]channelis a flag limiting concurrently playing sounds.
[in]resultis the type of detonation causing sound to play.
virtual void makVrv::DtExerciseSoundPlayer::removeDetonationSoundMap ( const DtEntityType &  entity,
int  result = -1 
)
virtual

Remove an existing Detonation to Sound-file mapping.

Parameters
[in]entityis the Entity Type who's mapping is to be removed.
[in]resultis the type of detonation causing sound to play.
virtual void makVrv::DtExerciseSoundPlayer::clearSoundMappings ( )
virtual

Clear all the sound maps.

virtual void makVrv::DtExerciseSoundPlayer::recycleSoundSources ( )
virtual

Recycle sounds sources.

Note
Recycling sound sources causes playing sounds to be stopped, their buffers to be reloaded, then restarted.
const DtSoundMapper* makVrv::DtExerciseSoundPlayer::soundMapper ( ) const

Get the sound mapper.

Returns
A pointer to the internal sound mapper object.
virtual bool makVrv::DtExerciseSoundPlayer::initialize ( DtExerciseConn *  exConn,
DtReflectedEntityList rel 
)
protectedvirtual

Initialize the view position and connect to the reflected entity list.

Parameters
[in]exConnis a pointer to an exercise connection.
[in]relis a pointer to a list of reflected entities.
Note
Derived classes may extend but not override this method.
virtual void makVrv::DtExerciseSoundPlayer::registerCallbacks ( )
protectedvirtual

A helper function to register callbacks with the reflected entity list.

virtual void makVrv::DtExerciseSoundPlayer::unregisterCallbacks ( )
protectedvirtual

A helper function to unregister callbacks from the reflected entity list.

static void makVrv::DtExerciseSoundPlayer::entityAddedCb ( DtReflectedEntity *  entity,
void *  caller 
)
staticprotected
See Also
onEntityAdded()
static void makVrv::DtExerciseSoundPlayer::entityRemovedCb ( DtReflectedEntity *  entity,
void *  caller 
)
staticprotected
static void makVrv::DtExerciseSoundPlayer::fireInteractionCb ( DtFireInteraction *  fire,
void *  caller 
)
staticprotected
static void makVrv::DtExerciseSoundPlayer::detonationInteractionCb ( DtDetonationInteraction detonation,
void *  caller 
)
staticprotected
virtual void makVrv::DtExerciseSoundPlayer::onEntityAdded ( DtReflectedEntity *  entity)
protectedvirtual

Called when a reflected entity has been added to the simulation.

Parameters
[in]entityis the entity that has been added.
virtual void makVrv::DtExerciseSoundPlayer::onEntityRemoved ( DtReflectedEntity *  entity)
protectedvirtual

Called when a reflected entity has been removed from the simulation.

Parameters
[in]entityis the entity that has been removed.
virtual void makVrv::DtExerciseSoundPlayer::onFireInteraction ( DtFireInteraction *  fire)
protectedvirtual

Called when a fire interaction has occurred in the simulation.

Parameters
[in]fireis the fire interaction that occurred.
virtual void makVrv::DtExerciseSoundPlayer::onDetonationInteraction ( DtDetonationInteraction detonation)
protectedvirtual

Called when a detonation interaction has occurred in the simulation.

Parameters
[in]detonationis the detonation interaction that occurred.
virtual void makVrv::DtExerciseSoundPlayer::onRecycleSoundSources ( )
protectedvirtual

A helper function to recycle the currently playing sound sources.

See Also
recycleSoundSources()
virtual void makVrv::DtExerciseSoundPlayer::addEntitiesFromList ( DtReflectedEntityList rel)
protectedvirtual

A helper function to add a list of reflected entities.

See Also
onEntityAdded()
virtual void makVrv::DtExerciseSoundPlayer::removeEntitiesFromList ( DtReflectedEntityList rel)
protectedvirtual

A helper function to remove a list of reflected entities.

See Also
onEntityRemoved()
DtExerciseSoundPlayer& makVrv::DtExerciseSoundPlayer::operator= ( const DtExerciseSoundPlayer orig)
private

Assignment operator.

Note
not implemented.

Member Data Documentation

DtReflectedEntityList* makVrv::DtExerciseSoundPlayer::myRel
protected
DtSoundMapper* makVrv::DtExerciseSoundPlayer::mySoundMapper
protected
DtVector makVrv::DtExerciseSoundPlayer::myLastViewPos
protected
DtVector makVrv::DtExerciseSoundPlayer::myLastViewVel
protected
DtTaitBryan makVrv::DtExerciseSoundPlayer::myLastViewOri
protected
bool makVrv::DtExerciseSoundPlayer::myRecycleSourcesFlag
protected

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

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)