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 | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends
makVrv::DtSharedAudioSettings Class Reference

This class maintains the track history settings. More...

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

Public Member Functions

virtual ~DtSharedAudioSettings ()
 DTOR.
Controls for the sound settings.
virtual void setAudioEnabled (bool val)
 Set the master audio enabled state.
virtual bool audioEnabled () const
 Get the master audio enabled state.
virtual void setVolume (double val)
 Set the master audio volume.
virtual double volume () const
 Get the master audio volume.
virtual void setSoundRangeEnabled (bool val)
 Set the master audio range enabled state.
virtual bool soundRangeEnabled () const
 Get the master audio range enabled state.
virtual void setSoundRange (double val)
 Set the master audio range (in meters).
virtual double soundRange () const
 Get the master audio range (in meters).
Controls for the sound mappings.
virtual unsigned int entityMapSize () const
 Get the number of sound mapping records for entity types.
virtual unsigned int weaponFireMapSize () const
 Get the number of sound mapping records for weapon-fire types.
virtual unsigned int detonationMapSize () const
 Get the number of sound mapping records for detonation types.
virtual const
DtEntitySoundMapRecord
entityMapAt (unsigned int index) const
 Get a reference to an entity to sound-file map record.
virtual const
DtEntitySoundMapRecord
weaponFireMapAt (unsigned int index) const
 Get a reference to a weapon-fire to sound-file map record.
virtual const
DtEntitySoundMapRecord
detonationMapAt (unsigned int index) const
 Get a reference to a detonation to sound-file map record.
virtual unsigned int entityMapIndex (const DtEntitySoundMapRecord &record) const
 Get the index of a sound-file map record for an entity.
virtual unsigned int weaponFireMapIndex (const DtFireSoundMapRecord &record) const
 Get the index of a sound-file map record for a weapon-fire.
virtual unsigned int detonationMapIndex (const DtDetonationSoundMapRecord &record) const
 Get the index of a sound-file map record for a detonation.
virtual void entityMapAdd (const DtEntitySoundMapRecord &record, bool reload=true)
 Add a new entity to sound-file map record.
virtual void entityMapRemove (const DtEntitySoundMapRecord &record, bool reload=true)
 Remove an entity to sound-file map record.
virtual void weaponFireMapAdd (const DtFireSoundMapRecord &record, bool reload=false)
 Add a new weapon-fire to sound-file map record.
virtual void weaponFireMapRemove (const DtEntitySoundMapRecord &record, bool reload=false)
 Remove a weapon-fire to sound-file map record.
virtual void detonationMapAdd (const DtDetonationSoundMapRecord &record, bool reload=false)
 Add a new detonation to sound-file map record.
virtual void detonationMapRemove (const DtEntitySoundMapRecord &record, bool reload=false)
 Remove a detonation to sound-file map record.
Deprecated controls for the sound settings.
virtual void setFilename (const std::string &mtlFile)
 Set the sound mapping filename ("*.mtl").
virtual const std::string & filename () const
 Get the sound mapping filename ("*.mtl").
Settings record / backup methods
virtual void setFromRecord (const DtAudioSettingsRecord &rec)
 Set or reset a complete audio settings and mappings state from a new audio settings record.
virtual void getRecord (DtAudioSettingsRecord &rec) const
 Get a copy of the current audio settings and mappings state.
virtual const
DtAudioSettingsBackup
settingsBackup () const
 Accessor for the settings backup (const).
virtual DtAudioSettingsBackupsettingsBackup ()
 Accessor for the settings backup.
virtual void backup ()
 Called to back up the settings.
- Public Member Functions inherited from makVrv::DtSharedSettings
 DtSharedSettings (const DtSharedSettingsManager &manager)
 CTOR.
virtual ~DtSharedSettings ()
 DTOR.
boost::shared_mutex & mutex ()
 Get the mutex for the settings object.
SafetyKey safeToEmitSignals ()
 Create a safety key for the function, see above example.
void setCurrentWriteLock (boost::unique_lock< boost::shared_mutex > *currentWriteLock)
 No need to call, set by the DtWriteSettingLock object.
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor.
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor.

Static Public Member Functions

static std::string className ()
 The class name for this settings object.

Protected Member Functions

 DtSharedAudioSettings (DtSharedSettingsManager &manager)
 Protected CTOR (Use DtReadSettingsLock and DtWriteSettingsLock).

Protected Attributes

int myControllerId
 The audio controller ID.
DtAudioSettingsRecord myRecord
 The current audio settings and sound-file mappings.
DtAudioSettingsBackupmySettingsBackup
 The settings backup object.

Friends

class DtReadSettingsLock< DtSharedAudioSettings >
 Use the DtReadSettingsLock to read the object.
class DtWriteSettingsLock< DtSharedAudioSettings >
 Use the DtWriteSettingsLock to write to the object.

Detailed Description

This class maintains the track history settings.

Constructor & Destructor Documentation

virtual makVrv::DtSharedAudioSettings::~DtSharedAudioSettings ( )
virtual

DTOR.

makVrv::DtSharedAudioSettings::DtSharedAudioSettings ( DtSharedSettingsManager manager)
protected

Protected CTOR (Use DtReadSettingsLock and DtWriteSettingsLock).

Member Function Documentation

virtual void makVrv::DtSharedAudioSettings::setAudioEnabled ( bool  val)
virtual

Set the master audio enabled state.

When set, this switch will allow all sounds to be played. When not set, all sounds will be prevented from playing.

Parameters
[in]valis the new enabled state: true for on, false for off.
virtual bool makVrv::DtSharedAudioSettings::audioEnabled ( ) const
virtual

Get the master audio enabled state.

Return values
truefor audio is enabled.
falseotherwise.
See Also
setAudioEnabled()
virtual void makVrv::DtSharedAudioSettings::setVolume ( double  val)
virtual

Set the master audio volume.

This value controls the gain as heard from the listener's position.

Parameters
[in]valis the new volume.
virtual double makVrv::DtSharedAudioSettings::volume ( ) const
virtual

Get the master audio volume.

Returns
The master audio volume.
See Also
setVolume()
virtual void makVrv::DtSharedAudioSettings::setSoundRangeEnabled ( bool  val)
virtual

Set the master audio range enabled state.

When set, this switch will only allows sounds to be played from sources within the sound range to the listener. When not set, all sounds will attempt to be played regardless of distance to the listener.

Parameters
[in]valis the new enabled state: true for on, false for off.
See Also
setSoundRange().
virtual bool makVrv::DtSharedAudioSettings::soundRangeEnabled ( ) const
virtual

Get the master audio range enabled state.

Return values
truefor audio range is enabled.
falseotherwise.
See Also
setSoundRangeEnabled()
virtual void makVrv::DtSharedAudioSettings::setSoundRange ( double  val)
virtual

Set the master audio range (in meters).

This value controls the maximum distance from the listener that sounds will attempt to be played.

Parameters
[in]valis the new maximum range.
See Also
setSoundRangeEnabled.
virtual double makVrv::DtSharedAudioSettings::soundRange ( ) const
virtual

Get the master audio range (in meters).

Returns
The master audio range.
See Also
setSoundRange()
virtual unsigned int makVrv::DtSharedAudioSettings::entityMapSize ( ) const
virtual

Get the number of sound mapping records for entity types.

Returns
The current number of registered mappings.
virtual unsigned int makVrv::DtSharedAudioSettings::weaponFireMapSize ( ) const
virtual

Get the number of sound mapping records for weapon-fire types.

Returns
The current number of registered mappings.
virtual unsigned int makVrv::DtSharedAudioSettings::detonationMapSize ( ) const
virtual

Get the number of sound mapping records for detonation types.

Returns
The current number of registered mappings.
virtual const DtEntitySoundMapRecord& makVrv::DtSharedAudioSettings::entityMapAt ( unsigned int  index) const
virtual

Get a reference to an entity to sound-file map record.

Parameters
[in]indexis the index of the record to locate.
Returns
A reference to a sound-file map record.
Exceptions
std::out_of_rangeon bad index.
virtual const DtEntitySoundMapRecord& makVrv::DtSharedAudioSettings::weaponFireMapAt ( unsigned int  index) const
virtual

Get a reference to a weapon-fire to sound-file map record.

Parameters
[in]indexis the index of the record to locate.
Returns
A reference to a sound-file map record.
Exceptions
std::out_of_rangeon bad index.
virtual const DtEntitySoundMapRecord& makVrv::DtSharedAudioSettings::detonationMapAt ( unsigned int  index) const
virtual

Get a reference to a detonation to sound-file map record.

Parameters
[in]indexis the index of the record to locate.
Returns
A reference to a sound-file map record.
Exceptions
std::out_of_rangeon bad index.
virtual unsigned int makVrv::DtSharedAudioSettings::entityMapIndex ( const DtEntitySoundMapRecord record) const
virtual

Get the index of a sound-file map record for an entity.

Parameters
[in]recordis the record to look for in the map.
Returns
The index to the record or the size of the map if not found.
virtual unsigned int makVrv::DtSharedAudioSettings::weaponFireMapIndex ( const DtFireSoundMapRecord record) const
virtual

Get the index of a sound-file map record for a weapon-fire.

Parameters
[in]recordis the record to look for in the map.
Returns
The index to the record or the size of the map if not found.
virtual unsigned int makVrv::DtSharedAudioSettings::detonationMapIndex ( const DtDetonationSoundMapRecord record) const
virtual

Get the index of a sound-file map record for a detonation.

Parameters
[in]recordis the record to look for in the map.
Returns
The index to the record or the size of the map if not found.
virtual void makVrv::DtSharedAudioSettings::entityMapAdd ( const DtEntitySoundMapRecord record,
bool  reload = true 
)
virtual

Add a new entity to sound-file map record.

Parameters
[in]recordis the new sound-file map record to be added.
[in]reloadis a flag forcing currently playing sounds to be reloaded from the new sound-file.
Note
If a record with the given entity value already exists, the record will be updated with the new information instead of adding a new record.
virtual void makVrv::DtSharedAudioSettings::entityMapRemove ( const DtEntitySoundMapRecord record,
bool  reload = true 
)
virtual

Remove an entity to sound-file map record.

Parameters
[in]recordis the sound-file map record to be remove.
[in]reloadis a flag forcing currently playing sounds to be reloaded from their sound-file.
Note
Removing the record to a currently playing sound without forcing a reload will not stop the sound from continuing.
virtual void makVrv::DtSharedAudioSettings::weaponFireMapAdd ( const DtFireSoundMapRecord record,
bool  reload = false 
)
virtual

Add a new weapon-fire to sound-file map record.

Parameters
[in]recordis the new sound-file map record to be added.
[in]reloadis a flag forcing currently playing sounds to be reloaded from the new sound-file.
Note
If a record with the given entity value already exists, the record will be updated with the new information instead of adding a new record.
virtual void makVrv::DtSharedAudioSettings::weaponFireMapRemove ( const DtEntitySoundMapRecord record,
bool  reload = false 
)
virtual

Remove a weapon-fire to sound-file map record.

Parameters
[in]recordis the sound-file map record to be remove.
[in]reloadis a flag forcing currently playing sounds to be reloaded from their sound-file.
Note
Removing the record to a currently playing sound without forcing a reload will not stop the sound from continuing.
virtual void makVrv::DtSharedAudioSettings::detonationMapAdd ( const DtDetonationSoundMapRecord record,
bool  reload = false 
)
virtual

Add a new detonation to sound-file map record.

Parameters
[in]recordis the new sound-file map record to be added.
[in]reloadis a flag forcing currently playing sounds to be reloaded from the new sound-file.
Note
If a record with the given entity value and detonation result already exists, the record will be updated with the new information instead of adding a new record.
virtual void makVrv::DtSharedAudioSettings::detonationMapRemove ( const DtEntitySoundMapRecord record,
bool  reload = false 
)
virtual

Remove a detonation to sound-file map record.

Parameters
[in]recordis the sound-file map record to be remove.
[in]reloadis a flag forcing currently playing sounds to be reloaded from their sound-file.
Note
Removing the record to a currently playing sound without forcing a reload will not stop the sound from continuing.
virtual void makVrv::DtSharedAudioSettings::setFilename ( const std::string &  mtlFile)
virtual

Set the sound mapping filename ("*.mtl").

Parameters
[in]mtlFileis the filename of an MTL file to load.
Note
MTL files only load while connected to a running simulation.
Deprecated:
This mutator is deprecated.
virtual const std::string& makVrv::DtSharedAudioSettings::filename ( ) const
virtual

Get the sound mapping filename ("*.mtl").

Deprecated:
This accessor is deprecated.
virtual void makVrv::DtSharedAudioSettings::setFromRecord ( const DtAudioSettingsRecord rec)
virtual

Set or reset a complete audio settings and mappings state from a new audio settings record.

Parameters
[in]recis the audio settings record to copy from.
virtual void makVrv::DtSharedAudioSettings::getRecord ( DtAudioSettingsRecord rec) const
virtual

Get a copy of the current audio settings and mappings state.

Parameters
[out]recis the audio settings record to copy to.
virtual const DtAudioSettingsBackup* makVrv::DtSharedAudioSettings::settingsBackup ( ) const
virtual

Accessor for the settings backup (const).

Returns
A pointer to the settings backup object.

Reimplemented from makVrv::DtSharedSettings.

virtual DtAudioSettingsBackup* makVrv::DtSharedAudioSettings::settingsBackup ( )
virtual

Accessor for the settings backup.

Returns
A pointer to the settings backup object.

Reimplemented from makVrv::DtSharedSettings.

virtual void makVrv::DtSharedAudioSettings::backup ( )
virtual

Called to back up the settings.

Reimplemented from makVrv::DtSharedSettings.

static std::string makVrv::DtSharedAudioSettings::className ( )
static

The class name for this settings object.

Friends And Related Function Documentation

friend class DtReadSettingsLock< DtSharedAudioSettings >
friend

Use the DtReadSettingsLock to read the object.

Use the DtWriteSettingsLock to write to the object.

Member Data Documentation

int makVrv::DtSharedAudioSettings::myControllerId
protected

The audio controller ID.

DtAudioSettingsRecord makVrv::DtSharedAudioSettings::myRecord
protected

The current audio settings and sound-file mappings.

DtAudioSettingsBackup* makVrv::DtSharedAudioSettings::mySettingsBackup
protected

The settings backup object.


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

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)