![]() |
VR-Forces 4.10 Class Documentation
|
DtAudioManager manages the sounds in vantange. More...

Public Types | |
| enum | ListenerLocationType { ObserverListener, EntityListener, ExplicitListener } |
| This enumeration is used to determine what type of listener the the audio manager uses. More... | |
Public Member Functions | |
| virtual bool | init () |
| Inits the sound system and create the audio context. More... | |
| virtual bool | isEnabled () |
| Return whether the audio manager is enabled. More... | |
| virtual void | setEnabled (bool enable) |
| Sets whether the audio manager is enabled. More... | |
| virtual double | soundVolume () |
| Return the volume of the sound. More... | |
| virtual void | setSoundVolume (double volume) |
| Sets the volume of the sound. More... | |
| virtual void | setListenerLocationType (ListenerLocationType listenerType) |
| Set the type of listener the audio manager should use. More... | |
| virtual ListenerLocationType | listenerLocationType () const |
| Get the current listener type. More... | |
| virtual void | setEntityListener (DtElementID listenerEntity) |
| If listener type is set to EntityListener, look up the object specified by the listenerEntity element ID. More... | |
| virtual DtElementID | entityListener () const |
| Get the entity listener's element ID (may be (DtUniqueID) -1) More... | |
| virtual void | setListenerLocation (const DtVector &location) |
| Set a location to use (local coords) when the listener type is set to ExplicitListener. More... | |
| virtual const DtVector & | listenerLocation () const |
| Get the audio manager's current listener location (local coords) More... | |
| virtual void | setListenerVelocity (const DtVector &velocity) |
| Set a velocity to use (local coords) when the listener type is set to ExplicitListener. More... | |
| virtual const DtVector & | listenerVelocity () const |
| Get the audio manager's current listener velocity (local coords) More... | |
| virtual void | setListenerFront (const DtVector &frontVec) |
| Set a front vector (local coords) to use when the listener type is set to ExplicitListener. More... | |
| virtual const DtVector & | listenerFront () const |
| Get the audio manager's current listener front vector (local coords) More... | |
| virtual void | setListenerUp (const DtVector &upVec) |
| Set an up vector (local coords) to use when the listener type is set to ExplicitListener. More... | |
| virtual const DtVector & | listenerUp () const |
| Get the audio manager's current listener up vector (local coords) More... | |
| virtual int | maxVoices () |
| Return the maximum number of voice allowed in the scene. More... | |
| virtual void | setMaxVoices (int numVoices) |
| Sets the maximum number of voice allowed in the scene. More... | |
| virtual double | speedOfSound () |
| Gets the speed of the sound in m/s. More... | |
| virtual void | setSpeedOfSound (double c) |
| Sets the speed of the sound in m/s. More... | |
| virtual float | maximumOutputDecibelCapability () |
| Gets the maximum decibel. More... | |
| virtual void | setMaximumOutputDecibelCapability (float max) |
| Sets the maximum decibel. More... | |
| virtual bool | environmentalProcessingAvailable () |
| Return whether the environmental processing is available. More... | |
| virtual bool | isEnvironmentalProcessingEnabled () |
| Return whethe the environmental processing is enabled. More... | |
| virtual void | setEnvironmentalProcessingEnabled (bool enable) |
| Sets whethe the environmental processing is enabled. More... | |
| virtual void | loadDefaults () |
| Load the default definitions. More... | |
| virtual bool | environmentalProcessingAvailable () const |
| Get the environmental processing available state. More... | |
| virtual std::vector< std::string > | playbackDeviceList () const |
| Get the list of audio playback devices available. More... | |
| virtual std::vector< std::string > | captureDeviceList () const |
| Get the list of audio capture devices available. 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 DtAudioManager & | instance (DtDe &de) |
| Get an instance of the DtAudioManager. More... | |
Protected Member Functions | |
| DtAudioManager (DtDe &) | |
| CTOR. More... | |
| virtual | ~DtAudioManager () |
| DTOR. More... | |
| void | connectSignals () |
| Connects all the signals. More... | |
| virtual void | tick () |
| Updates the sound system per tick. More... | |
| virtual void | shutdown () |
| Shut down the sound system, destory the context and release all the sound resources. More... | |
| virtual void | kinStateFromObserver () |
| If listenerLocationType is ObserverListener, this method is called by tick to set myListenerLocation, myListenerFront, myListenerUp, and myListenerVelocity from the current observer. More... | |
| virtual void | kinStateFromEntity () |
| If listenerLocationType is EntityListener, this method is called by tick to set myListenerLocation, myListenerFront, myListenerUp, and myListenerVelocity from myListenerEntity If the entity is not found, the values are unchanged. More... | |
| virtual void | slot_AudioEnabledUpdated (bool enabled) |
| Methods connected to audio signals. More... | |
| virtual void | slot_VolumeUpdated (double volume) |
| Slot when the volume of the audio changes. More... | |
| virtual void | slot_playbackDeviceUpdated (const std::string &device) |
| Slot when the playback device changes. More... | |
| virtual void | slot_captureDeviceUpdated (const std::string &device) |
| Slot when the capture device changes. More... | |
| virtual void | slot_showCaptureDeviceSettingsUpdated (bool show) |
| Slot when show/hide the capture device settings. More... | |
| virtual void | slot_SpeedOfSoundUpdated (double speed) |
| Slot when the speed of the sound changes. More... | |
| virtual void | slot_MaxVoicesUpdated (double numOfVoices) |
| Slot when the number of the maximum voice allowed changes. More... | |
| virtual void | slot_maximumOutputDecibelCapabilityUpdated (double decibel) |
| Slot when the maximum output decibel allowed changes. More... | |
| virtual void | slot_EnvironmentalProcessingEnabledUpdated (bool enabled) |
| Slot when enables/disables the environmental processing. More... | |
Private Member Functions | |
| DtAudioManager () | |
| Default Constructor not implemented – default constructor not allowed. More... | |
| DtAudioManager (const DtAudioManager &) | |
| Copy Constructor not implemented – Copy not allowed. More... | |
| DtAudioManager & | operator= (const DtAudioManager &) |
| Assignment Operator not implemented – Copy not allowed. More... | |
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... | |
DtAudioManager manages the sounds in vantange.
It updates the listener's position, etc.
|
protected |
CTOR.
|
protectedvirtual |
DTOR.
|
private |
Default Constructor not implemented – default constructor not allowed.
|
private |
Copy Constructor not implemented – Copy not allowed.
|
static |
Get an instance of the DtAudioManager.
|
virtual |
Inits the sound system and create the audio context.
|
virtual |
Return whether the audio manager is enabled.
|
virtual |
Sets whether the audio manager is enabled.
If set to false, audio manage will stop playing any sound.
|
virtual |
Return the volume of the sound.
|
virtual |
Sets the volume of the sound.
|
virtual |
Set the type of listener the audio manager should use.
listenerType will be one of ObserverListener, EntityListener, or ExplicitListener. If the listener type is set to ObserverListener, then the audio manager will retrieve and use the current observer's location, orientation, and velocity. If the listener type is set to EntityListener, then the audio manager will look up the entity set with setEntityListener() and take its kinematic input from there. Finally, if the listener type is set to ExplicitListener, then the audio manager will use whatever values are currently in its kinematic member variables, which can be set through the API
|
virtual |
Get the current listener type.
|
virtual |
If listener type is set to EntityListener, look up the object specified by the listenerEntity element ID.
|
virtual |
Get the entity listener's element ID (may be (DtUniqueID) -1)
|
virtual |
Set a location to use (local coords) when the listener type is set to ExplicitListener.
|
virtual |
Get the audio manager's current listener location (local coords)
|
virtual |
Set a velocity to use (local coords) when the listener type is set to ExplicitListener.
|
virtual |
Get the audio manager's current listener velocity (local coords)
|
virtual |
Set a front vector (local coords) to use when the listener type is set to ExplicitListener.
|
virtual |
Get the audio manager's current listener front vector (local coords)
|
virtual |
Set an up vector (local coords) to use when the listener type is set to ExplicitListener.
|
virtual |
Get the audio manager's current listener up vector (local coords)
|
virtual |
Return the maximum number of voice allowed in the scene.
|
virtual |
Sets the maximum number of voice allowed in the scene.
Call this function with caution, it can hurt performance. It must be in the range [0,256].
|
virtual |
Gets the speed of the sound in m/s.
the speed of sound. Currently returns the standard speed of sound in dry air at sea level. But one could calculate it and set it below.
|
virtual |
Sets the speed of the sound in m/s.
the speed of sound. Currently returns the standard speed of sound in dry air at sea level. But one could calculate it and set it below.
|
virtual |
Gets the maximum decibel.
The maximum decibel output of the sound system that the application is being played on. Used to tune the sound falloff distances to match the loudness of the system so that they sound realistic within the capabilities of the speakers being used. This defaults to 70 decibels, which is about the level a desktop computer will play loud audio at (or headphones). If the audio system is capable of playing louder than 70 dB, then increase this to the expected maximum output of the system.
|
virtual |
Sets the maximum decibel.
The maximum decibel output of the sound system that the application is being played on. Used to tune the sound falloff distances to match the loudness of the system so that they sound realistic within the capabilities of the speakers being used. This defaults to 70 decibels, which is about the level a desktop computer will play loud audio at (or headphones). If the audio system is capable of playing louder than 70 dB, then increase this to the expected maximum output of the system.
|
virtual |
Return whether the environmental processing is available.
Environmental processing enables low pass filtering on sounds so that at a distance only the lower frequencies are heard, since higher frequencies are absorbed by air at a faster rate. Uses a standard day to calculate absorption rate
|
virtual |
Return whethe the environmental processing is enabled.
Environmental processing enables low pass filtering on sounds so that at a distance only the lower frequencies are heard, since higher frequencies are absorbed by air at a faster rate. Uses a standard day to calculate absorption rate
|
virtual |
Sets whethe the environmental processing is enabled.
Environmental processing enables low pass filtering on sounds so that at a distance only the lower frequencies are heard, since higher frequencies are absorbed by air at a faster rate. Uses a standard day to calculate absorption rate
|
virtual |
Load the default definitions.
|
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.
|
protected |
Connects all the signals.
Non virtual, called in CTOR.
|
protectedvirtual |
Updates the sound system per tick.
Mainly update the listener and sounds.
|
protectedvirtual |
Shut down the sound system, destory the context and release all the sound resources.
|
protectedvirtual |
If listenerLocationType is ObserverListener, this method is called by tick to set myListenerLocation, myListenerFront, myListenerUp, and myListenerVelocity from the current observer.
|
protectedvirtual |
If listenerLocationType is EntityListener, this method is called by tick to set myListenerLocation, myListenerFront, myListenerUp, and myListenerVelocity from myListenerEntity If the entity is not found, the values are unchanged.
|
protectedvirtual |
Methods connected to audio signals.
Slot when enables/disables the audio.
|
protectedvirtual |
Slot when the volume of the audio changes.
|
protectedvirtual |
Slot when the playback device changes.
|
protectedvirtual |
Slot when the capture device changes.
|
protectedvirtual |
Slot when show/hide the capture device settings.
|
protectedvirtual |
Slot when the speed of the sound changes.
|
protectedvirtual |
Slot when the number of the maximum voice allowed changes.
|
protectedvirtual |
Slot when the maximum output decibel allowed changes.
|
protectedvirtual |
Slot when enables/disables the environmental processing.
|
private |
Assignment Operator not implemented – Copy not allowed.
|
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.
Then simply in the implementation of instance call defaultManagerInstanceFunction with the de object and return the return value.
|
friend |
Befriend the manager instance functions for instance retrieval/creation.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |