VR-Forces 4.1 Class Documentation
List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
makVrv::DtAudioSettingsRecord Class Reference

This record holds the state of the audio settings and entity to sound-file mappings. More...

Public Types

typedef std::vector
< DtEntitySoundMapRecord
EntityMapRecordList
 A vector of entity to sound-file maps.
typedef std::vector
< DtFireSoundMapRecord
FireMapRecordList
 A vector of weapon-fire to sound-file maps.
typedef std::vector
< DtDetonationSoundMapRecord
DetonationMapRecordList
 A vector of detonation to sound-file maps.

Public Member Functions

 DtAudioSettingsRecord ()
 Default CTOR.
 DtAudioSettingsRecord (const DtAudioSettingsRecord &other)
 Copy CTOR.
virtual ~DtAudioSettingsRecord ()
 Virtual DTOR.
DtAudioSettingsRecordoperator= (DtAudioSettingsRecord rhs)
 Assignment operator.
virtual void swap (DtAudioSettingsRecord &other)
 No-fail, no-throw swap function, swaps this data with other data.
virtual void sort ()
 Sort the contained list of records.
virtual void clearMaps ()
 Clear the contained list of records.
virtual void setAudioEnabled (bool val)
 Set the master audio enable/disable state.
virtual bool audioEnabled () const
 Get the master audio enable/disable 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 enable/disable state.
virtual bool soundRangeEnabled () const
 Get the master sound range enable/disable state.
virtual void setSoundRange (double val)
 Set the master sound range.
virtual double soundRange () const
 Get the master sound range.
virtual unsigned int entityMapSize () const
 Get the number of entity to sound mapping records.
virtual unsigned int weaponFireMapSize () const
 Get the number of weapon-fire to sound mapping records.
virtual unsigned int detonationMapSize () const
 Get the number of detonation to sound mapping records.
virtual EntityMapRecordListentityMap ()
 Get the list of entity sound maps.
virtual
EntityMapRecordList::iterator 
entityMapFind (DtEntitySoundMapRecord &record)
 Get the iterator of a sound map record in the entity map.
virtual
EntityMapRecordList::const_iterator 
entityMapFind (const DtEntitySoundMapRecord &record)
 Get the iterator of a sound map record in the entity map.
virtual const
DtEntitySoundMapRecord
entityMapAt (unsigned int index) const
 Get the sound map record at a specific index in the entity map.
virtual unsigned int entityMapIndex (const DtEntitySoundMapRecord &record) const
 Get the index of a sound map record in the entity map.
virtual FireMapRecordListweaponFireMap ()
 Get the list of weapon-fire sound maps.
virtual FireMapRecordList::iterator weaponFireMapFind (DtFireSoundMapRecord &record)
 Get the iterator of a sound map record in the weapon-fire map.
virtual
FireMapRecordList::const_iterator 
weaponFireMapFind (const DtFireSoundMapRecord &record)
 Get the iterator of a sound map record in the weapon-fire map.
virtual const
DtEntitySoundMapRecord
weaponFireMapAt (unsigned int index) const
 Get the sound map record at a specific index in the weapon-fire map.
virtual unsigned int weaponFireMapIndex (const DtFireSoundMapRecord &record) const
 Get the index of a sound map record in the weapon-fire map.
virtual DetonationMapRecordListdetonationMap ()
 Get the list of detonation sound maps.
virtual
DetonationMapRecordList::iterator 
detonationMapFind (DtDetonationSoundMapRecord &record)
 Get the iterator of a sound map record in the detonation map.
virtual
DetonationMapRecordList::const_iterator 
detonationMapFind (const DtDetonationSoundMapRecord &record)
 Get the iterator of a sound map record in the detonation map.
virtual const
DtEntitySoundMapRecord
detonationMapAt (unsigned int index) const
 Get the sound map record at a specific index in the detonation map.
virtual unsigned int detonationMapIndex (const DtDetonationSoundMapRecord &record) const
 Get the index of a sound map record in the detonation map.
virtual void entityMapAdd (const DtEntitySoundMapRecord &record)
 Add a new entity sound record to the map or change an existing record.
virtual void entityMapRemove (const DtEntitySoundMapRecord &record)
 Remove an existing entity sound record from the map.
virtual void weaponFireMapAdd (const DtFireSoundMapRecord &record)
 Add a new weapon-fire sound record to the map or change an existing record.
virtual void weaponFireMapRemove (const DtFireSoundMapRecord &record)
 Remove an existing weapon-fire sound record from the map.
virtual void detonationMapAdd (const DtDetonationSoundMapRecord &record)
 Add a new detonation sound record to the map or change an existing record.
virtual void detonationMapRemove (const DtDetonationSoundMapRecord &record)
 Remove an existing detonation sound record from the map.
virtual void setFilename (const std::string &mtlFile)
 Set the sound mapping MTL filename.
virtual const std::string & filename () const
 Get the sound mapping MTL filename.

Protected Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 When the class Archive corresponds to an output archive, the & operator is defined similar to <<.
template<typename MapType >
MapType::iterator mapFind (DtEntitySoundMapRecord &record, MapType &sndMap) const
 General accessors for the sound map records.
template<typename MapType >
MapType::const_iterator mapFind (const DtEntitySoundMapRecord &record, MapType &sndMap) const
 General accessors for the sound map records.
template<typename RecType , typename MapType >
const RecType & at (unsigned int index, MapType &sndMap) const
 Get a reference to a record at a given index.
template<typename RecType , typename MapType >
unsigned int index (const RecType &record, MapType &sndMap) const
 Get the index of a record in the map.
template<typename MapType >
void clearMap (MapType &sndMap)
 General cleanup of the sound map records.

Protected Attributes

int myVolume
double mySoundRange
bool myAudioEnabled
bool mySoundRangeEnabled
EntityMapRecordList myEntitySounds
FireMapRecordList myWeaponFireSounds
DetonationMapRecordList myDetonationSounds
std::string myFilename
 Deprecated in record version 2.
bool myAudioOn
 Deprecated in record version 2.

Friends

class boost::serialization::access

Detailed Description

This record holds the state of the audio settings and entity to sound-file mappings.

Member Typedef Documentation

A vector of entity to sound-file maps.

A vector of weapon-fire to sound-file maps.

A vector of detonation to sound-file maps.

Constructor & Destructor Documentation

makVrv::DtAudioSettingsRecord::DtAudioSettingsRecord ( )

Default CTOR.

makVrv::DtAudioSettingsRecord::DtAudioSettingsRecord ( const DtAudioSettingsRecord other)

Copy CTOR.

Parameters
[in]otheris a DtAudioSettingsRecord to copy from.
virtual makVrv::DtAudioSettingsRecord::~DtAudioSettingsRecord ( )
virtual

Virtual DTOR.

Member Function Documentation

DtAudioSettingsRecord& makVrv::DtAudioSettingsRecord::operator= ( DtAudioSettingsRecord  rhs)

Assignment operator.

Parameters
[in]rhsis a DtAudioSettingsRecord to copy from.
Returns
A reference to this instance.
virtual void makVrv::DtAudioSettingsRecord::swap ( DtAudioSettingsRecord other)
virtual

No-fail, no-throw swap function, swaps this data with other data.

Parameters
[in]otheris a DtAudioSettingsRecord to swap data with.
Note
Derived classes should extend, but not overwrite.
virtual void makVrv::DtAudioSettingsRecord::sort ( )
virtual

Sort the contained list of records.

virtual void makVrv::DtAudioSettingsRecord::clearMaps ( )
virtual

Clear the contained list of records.

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

Set the master audio enable/disable state.

Parameters
[in]valis the new state ( true=enabled, false=disabled ).
virtual bool makVrv::DtAudioSettingsRecord::audioEnabled ( ) const
virtual

Get the master audio enable/disable state.

Return values
trueif enabled.
falseotherwise.
virtual void makVrv::DtAudioSettingsRecord::setVolume ( double  val)
virtual

Set the master audio volume.

Parameters
[in]valis the new volume ( 0.0 - 1.0 ).
virtual double makVrv::DtAudioSettingsRecord::volume ( ) const
virtual

Get the master audio volume.

Returns
The current volume ( 0.0 - 1.0 ).
virtual void makVrv::DtAudioSettingsRecord::setSoundRangeEnabled ( bool  val)
virtual

Set the master audio range enable/disable state.

Parameters
[in]valis the new state ( true=enabled, false=disabled ).
virtual bool makVrv::DtAudioSettingsRecord::soundRangeEnabled ( ) const
virtual

Get the master sound range enable/disable state.

Return values
trueif enabled.
falseotherwise.
virtual void makVrv::DtAudioSettingsRecord::setSoundRange ( double  val)
virtual

Set the master sound range.

Parameters
[in]valis the new maximum range ( in meters ).
virtual double makVrv::DtAudioSettingsRecord::soundRange ( ) const
virtual

Get the master sound range.

Returns
The current maximum range ( in meters ).
virtual unsigned int makVrv::DtAudioSettingsRecord::entityMapSize ( ) const
virtual

Get the number of entity to sound mapping records.

Returns
The number of records.
virtual unsigned int makVrv::DtAudioSettingsRecord::weaponFireMapSize ( ) const
virtual

Get the number of weapon-fire to sound mapping records.

Returns
The number of records.
virtual unsigned int makVrv::DtAudioSettingsRecord::detonationMapSize ( ) const
virtual

Get the number of detonation to sound mapping records.

Returns
The number of records.
virtual EntityMapRecordList& makVrv::DtAudioSettingsRecord::entityMap ( )
virtual

Get the list of entity sound maps.

Returns
The vector of maps.
virtual EntityMapRecordList::iterator makVrv::DtAudioSettingsRecord::entityMapFind ( DtEntitySoundMapRecord record)
virtual

Get the iterator of a sound map record in the entity map.

Parameters
[in]recordis the record to look for in the map.
Returns
An iterator to the record or the end-iterator if not found.
Note
Returns non-const iterator.
virtual EntityMapRecordList::const_iterator makVrv::DtAudioSettingsRecord::entityMapFind ( const DtEntitySoundMapRecord record)
virtual

Get the iterator of a sound map record in the entity map.

Parameters
[in]recordis the record to look for in the map.
Returns
An iterator to the record or the end-iterator if not found.
Note
Returns const iterator.
virtual const DtEntitySoundMapRecord& makVrv::DtAudioSettingsRecord::entityMapAt ( unsigned int  index) const
virtual

Get the sound map record at a specific index in the entity map.

Parameters
[in]indexis the index to the record in the map.
Returns
The to the record at the given index.
Exceptions
std::out_of_rangeon bad index.
virtual unsigned int makVrv::DtAudioSettingsRecord::entityMapIndex ( const DtEntitySoundMapRecord record) const
virtual

Get the index of a sound map record in the entity map.

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 FireMapRecordList& makVrv::DtAudioSettingsRecord::weaponFireMap ( )
virtual

Get the list of weapon-fire sound maps.

Returns
The vector of maps.
virtual FireMapRecordList::iterator makVrv::DtAudioSettingsRecord::weaponFireMapFind ( DtFireSoundMapRecord record)
virtual

Get the iterator of a sound map record in the weapon-fire map.

Parameters
[in]recordis the record to look for in the map.
Returns
An iterator to the record or the end-iterator if not found.
Note
Returns non-const iterator.
virtual FireMapRecordList::const_iterator makVrv::DtAudioSettingsRecord::weaponFireMapFind ( const DtFireSoundMapRecord record)
virtual

Get the iterator of a sound map record in the weapon-fire map.

Parameters
[in]recordis the record to look for in the map.
Returns
An iterator to the record or the end-iterator if not found.
Note
Returns const iterator.
virtual const DtEntitySoundMapRecord& makVrv::DtAudioSettingsRecord::weaponFireMapAt ( unsigned int  index) const
virtual

Get the sound map record at a specific index in the weapon-fire map.

Parameters
[in]indexis the index to the record in the map.
Returns
The to the record at the given index.
Exceptions
std::out_of_rangeon bad index.
virtual unsigned int makVrv::DtAudioSettingsRecord::weaponFireMapIndex ( const DtFireSoundMapRecord record) const
virtual

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

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 DetonationMapRecordList& makVrv::DtAudioSettingsRecord::detonationMap ( )
virtual

Get the list of detonation sound maps.

Returns
The vector of maps.
virtual DetonationMapRecordList::iterator makVrv::DtAudioSettingsRecord::detonationMapFind ( DtDetonationSoundMapRecord record)
virtual

Get the iterator of a sound map record in the detonation map.

Parameters
[in]recordis the record to look for in the map.
Returns
An iterator to the record or the end-iterator if not found.
Note
Returns non-const iterator.
virtual DetonationMapRecordList::const_iterator makVrv::DtAudioSettingsRecord::detonationMapFind ( const DtDetonationSoundMapRecord record)
virtual

Get the iterator of a sound map record in the detonation map.

Parameters
[in]recordis the record to look for in the map.
Returns
An iterator to the record or the end-iterator if not found.
Note
Returns const iterator.
virtual const DtEntitySoundMapRecord& makVrv::DtAudioSettingsRecord::detonationMapAt ( unsigned int  index) const
virtual

Get the sound map record at a specific index in the detonation map.

Parameters
[in]indexis the index to the record in the map.
Returns
The to the record at the given index.
Exceptions
std::out_of_rangeon bad index.
virtual unsigned int makVrv::DtAudioSettingsRecord::detonationMapIndex ( const DtDetonationSoundMapRecord record) const
virtual

Get the index of a sound map record in the detonation map.

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::DtAudioSettingsRecord::entityMapAdd ( const DtEntitySoundMapRecord record)
virtual

Add a new entity sound record to the map or change an existing record.

Parameters
[in]recordis the record add or change.
virtual void makVrv::DtAudioSettingsRecord::entityMapRemove ( const DtEntitySoundMapRecord record)
virtual

Remove an existing entity sound record from the map.

Parameters
[in]recordis the record to remove.
virtual void makVrv::DtAudioSettingsRecord::weaponFireMapAdd ( const DtFireSoundMapRecord record)
virtual

Add a new weapon-fire sound record to the map or change an existing record.

Parameters
[in]recordis the record add or change.
virtual void makVrv::DtAudioSettingsRecord::weaponFireMapRemove ( const DtFireSoundMapRecord record)
virtual

Remove an existing weapon-fire sound record from the map.

Parameters
[in]recordis the record to remove.
virtual void makVrv::DtAudioSettingsRecord::detonationMapAdd ( const DtDetonationSoundMapRecord record)
virtual

Add a new detonation sound record to the map or change an existing record.

Parameters
[in]recordis the record add or change.
virtual void makVrv::DtAudioSettingsRecord::detonationMapRemove ( const DtDetonationSoundMapRecord record)
virtual

Remove an existing detonation sound record from the map.

Parameters
[in]recordis the record to remove.
virtual void makVrv::DtAudioSettingsRecord::setFilename ( const std::string &  mtlFile)
virtual

Set the sound mapping MTL filename.

Parameters
[in]mtlFileis the name of the MTL file to set.
Note
Deprecated in record version 2
virtual const std::string& makVrv::DtAudioSettingsRecord::filename ( ) const
virtual

Get the sound mapping MTL filename.

Returns
The name of the MTL file.
Note
Deprecated in record version 2
template<class Archive >
void makVrv::DtAudioSettingsRecord::serialize ( Archive &  ar,
const unsigned int  version 
)
inlineprotected

When the class Archive corresponds to an output archive, the & operator is defined similar to <<.

Likewise, when the class Archive is a type of input archive the & operator is defined similar to >>.

template<typename MapType >
MapType::iterator makVrv::DtAudioSettingsRecord::mapFind ( DtEntitySoundMapRecord record,
MapType &  sndMap 
) const
inlineprotected

General accessors for the sound map records.

Parameters
[in]recordis the record to look for.
[in]sndMapis the map to look through for the record.
Returns
the iterator for the record on the end-iterator if not found.
Note
Returns non-const iterator.
template<typename MapType >
MapType::const_iterator makVrv::DtAudioSettingsRecord::mapFind ( const DtEntitySoundMapRecord record,
MapType &  sndMap 
) const
inlineprotected

General accessors for the sound map records.

Parameters
[in]recordis the record to look for.
[in]sndMapis the map to look through for the record.
Returns
the iterator for the record on the end-iterator if not found.
Note
Returns const iterator.
template<typename RecType , typename MapType >
const RecType& makVrv::DtAudioSettingsRecord::at ( unsigned int  index,
MapType &  sndMap 
) const
inlineprotected

Get a reference to a record at a given index.

Parameters
[in]indexis the index into the map for the record.
[in]sndMapis the map to look through for the record.
Returns
A reference to a sound record.
Exceptions
std::out_of_rangeon bad index.
template<typename RecType , typename MapType >
unsigned int makVrv::DtAudioSettingsRecord::index ( const RecType &  record,
MapType &  sndMap 
) const
inlineprotected

Get the index of a record in the map.

Parameters
[in]recordis the record to look up.
[in]sndMapis the map to look through for the index.
Returns
The index to the record or the size of the map on failure.

References makVrv::vrvTacticalGraphicUtilities::distance().

template<typename MapType >
void makVrv::DtAudioSettingsRecord::clearMap ( MapType &  sndMap)
inlineprotected

General cleanup of the sound map records.

Parameters
[in]sndMapis the map to be cleared.

Friends And Related Function Documentation

friend class boost::serialization::access
friend

Member Data Documentation

int makVrv::DtAudioSettingsRecord::myVolume
protected
double makVrv::DtAudioSettingsRecord::mySoundRange
protected
bool makVrv::DtAudioSettingsRecord::myAudioEnabled
protected
bool makVrv::DtAudioSettingsRecord::mySoundRangeEnabled
protected
EntityMapRecordList makVrv::DtAudioSettingsRecord::myEntitySounds
protected
FireMapRecordList makVrv::DtAudioSettingsRecord::myWeaponFireSounds
protected
DetonationMapRecordList makVrv::DtAudioSettingsRecord::myDetonationSounds
protected
std::string makVrv::DtAudioSettingsRecord::myFilename
protected

Deprecated in record version 2.

bool makVrv::DtAudioSettingsRecord::myAudioOn
protected

Deprecated in record version 2.


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

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)