![]() |
VR-Forces 4.7 Class Documentation
|
Rooted singleton that holds value about current state of sound and entity to sound-file mappings. More...

Public Member Functions | |
| virtual | ~DtSharedAudioSettingsManager () |
| Virtual DTOR. | |
| virtual void | slot_backupRestored (const DtSettingsBackup *s) |
| Called when a mapping is restored, save out if auto save is true. | |
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 | setAudioPlaybackDevice (const std::string &val) |
| Set the device that audio should be played back on. | |
| virtual std::string | audioPlaybackDevice () const |
| get the name of the device that the audio should be played back on | |
| virtual void | setAudioCaptureDevice (const std::string &val) |
| Set the device that audio should be captured from. | |
| virtual std::string | audioCaptureDevice () const |
| get the name of the device that the audio should be captured from | |
| virtual void | setShowCaptureDeviceSettings (bool val) |
| Set whether or not the capture device selection dialog is present in the audio settings dialog. | |
| virtual bool | showCaptureDeviceSettings () const |
| Get whether or not the capture device selection dialog is present in the audio settings dialog. | |
| virtual void | setSpeedOfSound (double val) |
| Set the speed of sound (in meters/second). | |
| virtual double | speedOfSound () const |
| Get the speed of sound (in meters/second). | |
| virtual void | setMaxVoices (int val) |
| Set the maximum number of simultaneous playing sounds. | |
| virtual int | maxVoices () const |
| Get the number of maximum voices. | |
| virtual void | setMaximumOutputDecibelCapability (double val) |
| Set the maximum loudness that the sound hardware that this application is playing on is capable of producing. | |
| virtual double | maximumOutputDecibelCapability () const |
| Get the maximum loudness that the sound system can generate. | |
| virtual void | setEnvironmentalProcessingEnabled (bool val) |
| Set the environmental processing enabled state. | |
| virtual bool | environmentalProcessingEnabled () const |
| Get the environmental processing enabled state. | |
| virtual bool | environmentalProcessingAvailable () const |
| Get the environmental processing available state. | |
| virtual std::vector< std::string > | playbackDeviceList () const |
| Get the list of audio playback devices available. | |
| virtual std::vector< std::string > | captureDeviceList () const |
| Get the list of audio capture devices available. | |
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. | |
Public Member Functions inherited from makVrv::DtBaseSharedSettingsManager< DtAudioSettingsRecord, DtSharedAudioSettings > | |
| DtBaseSharedSettingsManager (DtDe &de, const std::string &name, const std::string &displayName, const std::string &ext) | |
| CTOR. | |
| virtual | ~DtBaseSharedSettingsManager () |
| Virtual DTOR. | |
| virtual void | initializeBackup () |
| Creates a backup of the settings' current state. | |
| virtual void | setFromRecord (const DtAudioSettingsRecord &record) |
| Set the current settings' state from the given record. | |
| virtual void | getRecord (DtAudioSettingsRecord &record) const |
| Store the current settings' state in the given record. | |
Public Member Functions inherited from makVrv::DtCommonBaseSettingsManager< DtAudioSettingsRecord > | |
| DtCommonBaseSettingsManager (DtDe &de, const std::string &name, const std::string &displayName, const std::string &ext) | |
| CTOR The name, displayName, and extension parameters are used for creating the settings object (DtDeSettings) and backup, and for constructing the filename when readin/writing the records to disk. | |
| virtual | ~DtCommonBaseSettingsManager () |
| Virtual DTOR. | |
| virtual void | autoSaveIfNecessary () |
| Saves the current settings as defaults if autosave is enabled. | |
| virtual void | setAutoSave (bool doit) |
| Sets whether autosave is enabled for the settings manager. | |
| virtual bool | autoSave () const |
| Gets whether autosave is enabled for the settings manager. | |
| virtual void | setUseDefaultSettingsRecord (bool useit) |
| Sets whether setting initialization should check for a default record. | |
| virtual bool | useDefaultSettingsRecord () const |
| Gets whether setting initialization should check for a default record. | |
| virtual DtDeSettings * | settings () |
| Accessor for the manager's DtDeSettings object. | |
| virtual const DtDeSettings * | settings () const |
| Accessor for the manager's DtDeSettings object (const). | |
| virtual DtSettingsBackup * | settingsBackup () |
| Accessor for the manager's settings backup. | |
| virtual const DtSettingsBackup * | settingsBackup () const |
| Accessor for the manager's settings backup (const). | |
| virtual void | loadDefaults () |
| Initializes the settings and creates a backup. | |
| virtual void | saveDefaultSettings () |
| Saves the current settings' state as the default (on disk). | |
| virtual void | loadDefaultSettings (bool loadOnlyFactorySettings) |
| Loads the default settings from disk. | |
| virtual void | importSettings (const std::string &filePath) |
| Load the settings' state from the given file. | |
| virtual void | exportSettings (const std::string &filePath) const |
| Save the current settings' state to the given file. | |
| virtual void | getSplitRecord (std::vector< DtAudioSettingsRecord > &rec, std::vector< std::string > &fileNames) |
| For directory support, split the main record into different sub-records and give them each a file name. | |
| virtual void | addRecords (DtAudioSettingsRecord &rec, DtAudioSettingsRecord &combinedRec) |
| For directory support, when reading in a directory, add the records from each file to the combined record. | |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| Do nothing constructor. | |
| virtual | ~DtVirtualBaseClass () |
| Virtual do nothing destructor. | |
Static Public Member Functions | |
| static DtSharedAudioSettingsManager & | instance (DtDe &de) |
| Get an instance of the settings manager. | |
Public Attributes | |
Audio data change signals. | |
| boost::signal< void(bool)> | signal_AudioEnabledUpdated |
| Signals emitted when the audio data has changed. | |
| boost::signal< void(double)> | signal_VolumeUpdated |
| boost::signal< void(std::string)> | signal_playbackDeviceUpdated |
| boost::signal< void(std::string)> | signal_captureDeviceUpdated |
| boost::signal< void(bool)> | signal_showCaptureDeviceSettingsUpdated |
| boost::signal< void(double)> | signal_SpeedOfSoundUpdated |
| boost::signal< void(double)> | signal_MaxVoicesUpdated |
| boost::signal< void(double)> | signal_maximumOutputDecibelCapabilityUpdated |
| boost::signal< void(bool)> | signal_EnvironmentalProcessingEnabledUpdated |
Protected Member Functions | |
| DtSharedAudioSettingsManager (DtDe &de) | |
| Protected CTOR ( use instance(..) ). | |
Friends | |
| template<typename ManagerClass > | |
| ManagerClass & | defaultManagerInstanceFunction (DtDe &, bool) |
| Befriend the manager instance functions for instance retrieval/creation. | |
| template<typename ManagerClass > | |
| void | defaultManagerRegisterInstanceFunction (DtDe &, ManagerClass *) |
| Befriend the manager instance functions for instance retrieval/creation. | |
Additional Inherited Members | |
Protected Types inherited from makVrv::DtBaseSharedSettingsManager< DtAudioSettingsRecord, DtSharedAudioSettings > | |
| typedef DtSharedRecordSettingsBackup < DtSharedAudioSettings, DtAudioSettingsRecord > | SharedRecordBackupType |
Protected Attributes inherited from makVrv::DtCommonBaseSettingsManager< DtAudioSettingsRecord > | |
| DtSignalConnectionManager | myConnections |
| std::string | myName |
| std::string | myExtension |
| std::string | myDisplayName |
| bool | myUseDefaultSettingsRecordFlag |
| bool | myAutoSaveFlag |
| DtSettingsBackup * | mySettingsBackup |
| DtDe & | myDe |
Rooted singleton that holds value about current state of sound and entity to sound-file mappings.
|
virtual |
Virtual DTOR.
|
protected |
Protected CTOR ( use instance(..) ).
|
static |
Get an instance of the settings manager.
| [in] | de | is the display engine root for the singleton. |
|
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.
| [in] | val | is the new enabled state: true for on, false for off. |
|
virtual |
Get the master audio enabled state.
| true | for audio is enabled. |
| false | otherwise. |
|
virtual |
Set the master audio volume.
This value controls the gain as heard from the listener's position.
| [in] | val | is the new volume. |
|
virtual |
|
virtual |
Set the device that audio should be played back on.
| [in] | deviceName | is the name of the device that should be used for audio playback |
|
virtual |
get the name of the device that the audio should be played back on
|
virtual |
Set the device that audio should be captured from.
| [in] | deviceName | is the name of the device that should be used for audio capture |
|
virtual |
get the name of the device that the audio should be captured from
|
virtual |
Set whether or not the capture device selection dialog is present in the audio settings dialog.
| [in] | val | is the new enabled state: true for on, false for off. |
|
virtual |
Get whether or not the capture device selection dialog is present in the audio settings dialog.
|
virtual |
Set the speed of sound (in meters/second).
This value controls the speed of sound which can depend on many external factors. This allows the user to choose the speed for their situation
| [in] | val | is the new speed of sound. |
|
virtual |
|
virtual |
Set the maximum number of simultaneous playing sounds.
| [in] | val | is the new number of active voices. |
|
virtual |
|
virtual |
Set the maximum loudness that the sound hardware that this application is playing on is capable of producing.
This is used to calibrate where played sounds start to falloff sounds.
| [in] | val | is the loudness in decibels. |
|
virtual |
Get the maximum loudness that the sound system can generate.
|
virtual |
Set the environmental processing enabled state.
When set, this switch will allow all sounds to be played with environmental effects processing such as lowpass filtering based on distance, so high frequency sounds get filtered out the further a sound source is. When not set, all sounds will be played without filtering
| [in] | val | is the new enabled state: true for on, false for off. |
|
virtual |
Get the environmental processing enabled state.
| true | for processing is enabled. |
| false | otherwise. |
|
virtual |
Get the environmental processing available state.
| true | for processing is available on current hardware. |
| false | otherwise. |
|
virtual |
Get the list of audio playback devices available.
|
virtual |
Get the list of audio capture devices available.
Get the number of sound mapping records for entity types.
Get the number of sound mapping records for weapon-fire types.
Get the number of sound mapping records for detonation types.
|
virtual |
Get a reference to an entity to sound-file map record.
| [in] | index | is the index of the record to locate. |
| std::out_of_range | on bad index. |
|
virtual |
Get a reference to a weapon-fire to sound-file map record.
| [in] | index | is the index of the record to locate. |
| std::out_of_range | on bad index. |
|
virtual |
Get a reference to a detonation to sound-file map record.
| [in] | index | is the index of the record to locate. |
| std::out_of_range | on bad index. |
|
virtual |
Get the index of a sound-file map record for an entity.
| [in] | record | is the record to look for in the map. |
|
virtual |
Get the index of a sound-file map record for a weapon-fire.
| [in] | record | is the record to look for in the map. |
|
virtual |
Get the index of a sound-file map record for a detonation.
| [in] | record | is the record to look for in the map. |
|
virtual |
Add a new entity to sound-file map record.
| [in] | record | is the new sound-file map record to be added. |
| [in] | reload | is a flag forcing currently playing sounds to be reloaded from the new sound-file. |
|
virtual |
Remove an entity to sound-file map record.
| [in] | record | is the sound-file map record to be remove. |
| [in] | reload | is a flag forcing currently playing sounds to be reloaded from their sound-file. |
|
virtual |
Add a new weapon-fire to sound-file map record.
| [in] | record | is the new sound-file map record to be added. |
| [in] | reload | is a flag forcing currently playing sounds to be reloaded from the new sound-file. |
|
virtual |
Remove a weapon-fire to sound-file map record.
| [in] | record | is the sound-file map record to be remove. |
| [in] | reload | is a flag forcing currently playing sounds to be reloaded from their sound-file. |
|
virtual |
Add a new detonation to sound-file map record.
| [in] | record | is the new sound-file map record to be added. |
| [in] | reload | is a flag forcing currently playing sounds to be reloaded from the new sound-file. |
|
virtual |
Remove a detonation to sound-file map record.
| [in] | record | is the sound-file map record to be remove. |
| [in] | reload | is a flag forcing currently playing sounds to be reloaded from their sound-file. |
|
virtual |
Called when a mapping is restored, save out if auto save is true.
|
friend |
Befriend the manager instance functions for instance retrieval/creation.
Manager requirements:
1) Static instance function
2) Protected DtSignalConnectionManager named myConnections.
3) Member functioned called loadDefaults which takes no arguments.
and loads the default settings of the manager or factory from disk.
4) define defaultManagerInstanceFunction as friend.
5) define defaultManagerRegisterInstanceFunction as friend (see below).
5) Protected Constructor which only takes a DtDe reference.
@code
class Manager { public: static Manager& instance(DtDe& de); void loadDefaults(); protected: template <typename managerclass>=""> friend ManagerClass& defaultManagerInstanceFunction(DtDe& de, bool); template <typename managerclass>=""> friend void defaultManagerRegisterInstanceFunction(DtDe& de, ManagerClass* mgr) Manager(DtDe&); DtSignalConnectionManager myConnections; };
Then simply in the implementation of instance call defaultManagerInstanceFunction with the de object and return the return value. @code
Manager& Manager::instance(DtDe& de) { return defaultManagerInstanceFunction<Manager>(de); }
|
friend |
Befriend the manager instance functions for instance retrieval/creation.
@code
static void Manager::registerInstance(DtDe& de, Manager* mgr) { defaultManagerRegisterInstanceFunction(de,mgr); } ...else where call. // Assuming class NewManager : public Manager Manager::registerInstance(de,new NewManager(de));
| boost::signal<void (bool)> makVrv::DtSharedAudioSettingsManager::signal_AudioEnabledUpdated |
Signals emitted when the audio data has changed.
| boost::signal<void (double)> makVrv::DtSharedAudioSettingsManager::signal_VolumeUpdated |
| boost::signal<void (std::string)> makVrv::DtSharedAudioSettingsManager::signal_playbackDeviceUpdated |
| boost::signal<void (std::string)> makVrv::DtSharedAudioSettingsManager::signal_captureDeviceUpdated |
| boost::signal<void (bool)> makVrv::DtSharedAudioSettingsManager::signal_showCaptureDeviceSettingsUpdated |
| boost::signal<void (double)> makVrv::DtSharedAudioSettingsManager::signal_SpeedOfSoundUpdated |
| boost::signal<void (double)> makVrv::DtSharedAudioSettingsManager::signal_MaxVoicesUpdated |
| boost::signal<void (double)> makVrv::DtSharedAudioSettingsManager::signal_maximumOutputDecibelCapabilityUpdated |
| boost::signal<void (bool)> makVrv::DtSharedAudioSettingsManager::signal_EnvironmentalProcessingEnabledUpdated |