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

Rooted singleton that holds value about current state of sound settings. More...

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

Public Member Functions

virtual ~DtAudioSettingsManager ()
 Virtual DTOR. More...
 
Controls for the sound settings.
virtual void setAudioEnabled (bool val)
 Set the master audio enabled state. More...
 
virtual bool audioEnabled () const
 Get the master audio enabled state. More...
 
virtual void setVolume (double val)
 Set the master audio volume. More...
 
virtual double volume () const
 Get the master audio volume. More...
 
virtual void setAudioPlaybackDevice (const std::string &val)
 Set the device that audio should be played back on. More...
 
virtual std::string audioPlaybackDevice () const
 get the name of the device that the audio should be played back on More...
 
virtual void setAudioCaptureDevice (const std::string &val)
 Set the device that audio should be captured from. More...
 
virtual std::string audioCaptureDevice () const
 get the name of the device that the audio should be captured from More...
 
virtual void setShowCaptureDeviceSettings (bool val)
 Set whether or not the capture device selection dialog is present in the audio settings dialog. More...
 
virtual bool showCaptureDeviceSettings () const
 Get whether or not the capture device selection dialog is present in the audio settings dialog. More...
 
virtual void setSpeedOfSound (double val)
 Set the speed of sound (in meters/second). More...
 
virtual double speedOfSound () const
 Get the speed of sound (in meters/second). More...
 
virtual void setMaxVoices (int val)
 Set the maximum number of simultaneous playing sounds. More...
 
virtual int maxVoices () const
 Get the number of maximum voices. More...
 
virtual void setMaximumOutputDecibelCapability (double val)
 Set the maximum loudness that the sound hardware that this application is playing on is capable of producing. More...
 
virtual double maximumOutputDecibelCapability () const
 Get the maximum loudness that the sound system can generate. More...
 
virtual void setEnvironmentalProcessingEnabled (bool val)
 Set the environmental processing enabled state. More...
 
virtual bool environmentalProcessingEnabled () const
 Get the environmental processing enabled state. More...
 
Setting Persistence Methods
void setFromRecord (const DtAudioSettingsRecord &rec)
 Set the current settings' state from the given record. More...
 
void getRecord (DtAudioSettingsRecord &rec) const
 Store the current settings' state in the given record. More...
 
- Public Member Functions inherited from makVrv::DtBaseSettingsManager< DtAudioSettingsRecord >
 DtBaseSettingsManager (DtDe &de, const std::string &name, const std::string &displayName, const std::string &ext)
 CTOR. More...
 
virtual ~DtBaseSettingsManager ()
 Virtual DTOR. More...
 
virtual void initializeBackup ()
 Creates a backup of the settings' current state. More...
 
- 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. More...
 
virtual ~DtCommonBaseSettingsManager ()
 Virtual DTOR. More...
 
virtual void autoSaveIfNecessary ()
 Saves the current settings as defaults if autosave is enabled. More...
 
virtual void setAutoSave (bool doit)
 Sets whether autosave is enabled for the settings manager. More...
 
virtual bool autoSave () const
 Gets whether autosave is enabled for the settings manager. More...
 
virtual void setUseDefaultSettingsRecord (bool useit)
 Sets whether setting initialization should check for a default record. More...
 
virtual bool useDefaultSettingsRecord () const
 Gets whether setting initialization should check for a default record. More...
 
virtual DtDeSettingssettings ()
 Accessor for the manager's DtDeSettings object. More...
 
virtual const DtDeSettingssettings () const
 Accessor for the manager's DtDeSettings object (const). More...
 
virtual DtSettingsBackupsettingsBackup ()
 Accessor for the manager's settings backup. More...
 
virtual const DtSettingsBackupsettingsBackup () const
 Accessor for the manager's settings backup (const). More...
 
virtual void loadDefaults ()
 Initializes the settings and creates a backup. More...
 
virtual void saveDefaultSettings ()
 Saves the current settings' state as the default (on disk). More...
 
virtual void loadDefaultSettings (bool loadOnlyFactorySettings)
 Loads the default settings from disk. More...
 
virtual void importSettings (const std::string &filePath)
 Load the settings' state from the given file. More...
 
virtual void exportSettings (const std::string &filePath) const
 Save the current settings' state to the given file. More...
 
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. More...
 
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. More...
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor. More...
 
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor. More...
 

Static Public Member Functions

static DtAudioSettingsManagerinstance (DtDe &de)
 Get an instance of the settings manager. More...
 

Public Attributes

Boost signals for changed settings
boost::signalslib::signal
< void(bool)> 
signal_enableAudioChanged
 Emitted when the audio enabled setting is changed. More...
 
boost::signalslib::signal
< void(double)> 
signal_volumeChanged
 Emitted when the audio volume is changed. More...
 
boost::signalslib::signal
< void(std::string)> 
signal_audioPlaybackDeviceChanged
 Emitted when the audio playback device setting is changed. More...
 
boost::signalslib::signal
< void(std::string)> 
signal_audioCaptureDeviceChanged
 Emitted when the audio capture device setting is changed. More...
 
boost::signalslib::signal
< void(bool)> 
signal_showCaptureDeviceSettingsChanged
 Emitted when the show audio capture device settings is changed. More...
 
boost::signalslib::signal
< void(double)> 
signal_speedOfSoundChanged
 Emitted when the speed of sound is changed. More...
 
boost::signalslib::signal
< void(double)> 
signal_maxVoicesChanged
 Emitted when the max voices are changed. More...
 
boost::signalslib::signal
< void(double)> 
signal_maximumOutputDecibelCapabilityChanged
 Emitted when the sound system capability changed. More...
 
boost::signalslib::signal
< void(bool)> 
signal_environmentalProcessingEnabledChanged
 Emitted when the environmental audio processing enabled setting is changed. More...
 

Protected Member Functions

 DtAudioSettingsManager (DtDe &de)
 Protected CTOR ( use instance(..) ). More...
 

Protected Attributes

bool myAudioEnabled
 
double myVolume
 
std::string myAudioPlaybackDevice
 
std::string myAudioCaptureDevice
 
bool myShowCaptureDeviceSettings
 
double mySpeedOfSound
 
int myMaxVoices
 
double myMaximumOutputDecibelCapability
 
bool myEnvironmentalProcessingEnabled
 
- Protected Attributes inherited from makVrv::DtCommonBaseSettingsManager< DtAudioSettingsRecord >
DtSignalConnectionManager myConnections
 
std::string myName
 
std::string myExtension
 
std::string myDisplayName
 
bool myUseDefaultSettingsRecordFlag
 
bool myAutoSaveFlag
 
DtSettingsBackupmySettingsBackup
 
DtDemyDe
 

Friends

template<typename ManagerClass >
ManagerClass & defaultManagerInstanceFunction (DtDe &, bool)
 Befriend the manager instance functions for instance retrieval/creation. More...
 
template<typename ManagerClass >
void defaultManagerRegisterInstanceFunction (DtDe &, ManagerClass *)
 Befriend the manager instance functions for instance retrieval/creation. More...
 

Additional Inherited Members

- Protected Types inherited from makVrv::DtBaseSettingsManager< DtAudioSettingsRecord >
typedef DtRecordSettingsBackup
< DtBaseSettingsManager
< DtAudioSettingsRecord >
, DtAudioSettingsRecord
RecordBackupType
 

Detailed Description

Rooted singleton that holds value about current state of sound settings.

Constructor & Destructor Documentation

virtual makVrv::DtAudioSettingsManager::~DtAudioSettingsManager ( )
virtual

Virtual DTOR.

makVrv::DtAudioSettingsManager::DtAudioSettingsManager ( DtDe de)
protected

Protected CTOR ( use instance(..) ).

Member Function Documentation

static DtAudioSettingsManager& makVrv::DtAudioSettingsManager::instance ( DtDe de)
static

Get an instance of the settings manager.

Parameters
[in]deis the display engine root for the singleton.
virtual void makVrv::DtAudioSettingsManager::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.

Reimplemented in makVrf::DtVrfAudioSettingsManager.

virtual bool makVrv::DtAudioSettingsManager::audioEnabled ( ) const
virtual

Get the master audio enabled state.

Return values
truefor audio is enabled.
falseotherwise.
See Also
setAudioEnabled()
virtual void makVrv::DtAudioSettingsManager::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::DtAudioSettingsManager::volume ( ) const
virtual

Get the master audio volume.

Returns
The master audio volume.
See Also
setVolume()
virtual void makVrv::DtAudioSettingsManager::setAudioPlaybackDevice ( const std::string &  val)
virtual

Set the device that audio should be played back on.

Parameters
[in]deviceNameis the name of the device that should be used for audio playback
virtual std::string makVrv::DtAudioSettingsManager::audioPlaybackDevice ( ) const
virtual

get the name of the device that the audio should be played back on

Returns
The name of the current audio device for audio playback
virtual void makVrv::DtAudioSettingsManager::setAudioCaptureDevice ( const std::string &  val)
virtual

Set the device that audio should be captured from.

Parameters
[in]deviceNameis the name of the device that should be used for audio capture
virtual std::string makVrv::DtAudioSettingsManager::audioCaptureDevice ( ) const
virtual

get the name of the device that the audio should be captured from

Returns
The name of the current audio device for audio capture
virtual void makVrv::DtAudioSettingsManager::setShowCaptureDeviceSettings ( bool  val)
virtual

Set whether or not the capture device selection dialog is present in the audio settings dialog.

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

Get whether or not the capture device selection dialog is present in the audio settings dialog.

See Also
setShowCaptureDeviceSettings()
virtual void makVrv::DtAudioSettingsManager::setSpeedOfSound ( double  val)
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

Parameters
[in]valis the new speed of sound.
See Also
DtAudioSettingsManager::setSpeedOfSound.
virtual double makVrv::DtAudioSettingsManager::speedOfSound ( ) const
virtual

Get the speed of sound (in meters/second).

Returns
The speed of sound.
See Also
setSpeedOfSound()
virtual void makVrv::DtAudioSettingsManager::setMaxVoices ( int  val)
virtual

Set the maximum number of simultaneous playing sounds.

Parameters
[in]valis the new number of active voices.
virtual int makVrv::DtAudioSettingsManager::maxVoices ( ) const
virtual

Get the number of maximum voices.

Returns
the number of maximum voices
See Also
setMaxVoices()
virtual void makVrv::DtAudioSettingsManager::setMaximumOutputDecibelCapability ( double  val)
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.

Parameters
[in]valis the loudness in decibels.
virtual double makVrv::DtAudioSettingsManager::maximumOutputDecibelCapability ( ) const
virtual

Get the maximum loudness that the sound system can generate.

Returns
the maximum decibels that the audio hardware can generate
See Also
setmaximumOutputDecibelCapability()
virtual void makVrv::DtAudioSettingsManager::setEnvironmentalProcessingEnabled ( bool  val)
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

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

Get the environmental processing enabled state.

Return values
truefor processing is enabled.
falseotherwise.
See Also
setEnvironmentalProcessingEnabled()
void makVrv::DtAudioSettingsManager::setFromRecord ( const DtAudioSettingsRecord rec)
virtual

Set the current settings' state from the given record.

Implements makVrv::DtBaseSettingsManager< DtAudioSettingsRecord >.

void makVrv::DtAudioSettingsManager::getRecord ( DtAudioSettingsRecord rec) const
virtual

Store the current settings' state in the given record.

Implements makVrv::DtBaseSettingsManager< DtAudioSettingsRecord >.

Friends And Related Function Documentation

template<typename ManagerClass >
ManagerClass& defaultManagerInstanceFunction ( DtDe de,
bool  allowedInSlave 
)
friend

Befriend the manager instance functions for instance retrieval/creation.

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.

* 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.

* Manager& Manager::instance(DtDe& de)
* {
* return defaultManagerInstanceFunction<Manager>(de);
* }
*
template<typename ManagerClass >
void defaultManagerRegisterInstanceFunction ( DtDe de,
ManagerClass *  mgr 
)
friend

Befriend the manager instance functions for instance retrieval/creation.

Befriend the manager instance functions for instance retrieval/creation.

* static void Manager::registerInstance(DtDe& de, Manager* mgr)
* {
* }
* ...else where call.
* // Assuming class NewManager : public Manager
* Manager::registerInstance(de,new NewManager(de));
*

Member Data Documentation

boost::signalslib::signal<void(bool)> makVrv::DtAudioSettingsManager::signal_enableAudioChanged

Emitted when the audio enabled setting is changed.

See Also
DtSharedAudioSettings::setAudioEnabled.
boost::signalslib::signal<void(double)> makVrv::DtAudioSettingsManager::signal_volumeChanged

Emitted when the audio volume is changed.

See Also
DtSharedAudioSettings::setVolume.
boost::signalslib::signal<void(std::string)> makVrv::DtAudioSettingsManager::signal_audioPlaybackDeviceChanged

Emitted when the audio playback device setting is changed.

See Also
DtSharedAudioSettings::setAudioPlaybackDevice.
boost::signalslib::signal<void(std::string)> makVrv::DtAudioSettingsManager::signal_audioCaptureDeviceChanged

Emitted when the audio capture device setting is changed.

See Also
DtSharedAudioSettings::setAudioCaptureDevice.
boost::signalslib::signal<void(bool)> makVrv::DtAudioSettingsManager::signal_showCaptureDeviceSettingsChanged

Emitted when the show audio capture device settings is changed.

See Also
DtSharedAudioSettings::setShowCaptureDeviceSettings.
boost::signalslib::signal<void(double)> makVrv::DtAudioSettingsManager::signal_speedOfSoundChanged

Emitted when the speed of sound is changed.

See Also
DtSharedAudioSettings::setSpeedOfSound.
boost::signalslib::signal<void(double)> makVrv::DtAudioSettingsManager::signal_maxVoicesChanged

Emitted when the max voices are changed.

See Also
DtSharedAudioSettings::setMaxVoices.
boost::signalslib::signal<void(double)> makVrv::DtAudioSettingsManager::signal_maximumOutputDecibelCapabilityChanged

Emitted when the sound system capability changed.

See Also
DtSharedAudioSettings::setmaximumOutputDecibelCapability.
boost::signalslib::signal<void(bool)> makVrv::DtAudioSettingsManager::signal_environmentalProcessingEnabledChanged

Emitted when the environmental audio processing enabled setting is changed.

See Also
DtSharedAudioSettings::setEnvironmentalProcessingEnabled.
bool makVrv::DtAudioSettingsManager::myAudioEnabled
protected
double makVrv::DtAudioSettingsManager::myVolume
protected
std::string makVrv::DtAudioSettingsManager::myAudioPlaybackDevice
protected
std::string makVrv::DtAudioSettingsManager::myAudioCaptureDevice
protected
bool makVrv::DtAudioSettingsManager::myShowCaptureDeviceSettings
protected
double makVrv::DtAudioSettingsManager::mySpeedOfSound
protected
int makVrv::DtAudioSettingsManager::myMaxVoices
protected
double makVrv::DtAudioSettingsManager::myMaximumOutputDecibelCapability
protected
bool makVrv::DtAudioSettingsManager::myEnvironmentalProcessingEnabled
protected

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

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)