Orxonox
0.0.5 Codename: Arcturus
|
The SoundManager class manages the OpenAL device, context and listener position. More...
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/orxonox/sound/SoundManager.h>
Public Member Functions | |
SoundManager () | |
~SoundManager () | |
std::string | getDeviceName (unsigned int index) const |
bool | getMute (SoundType::Value type) |
float | getRealVolume (SoundType::Value type) |
std::shared_ptr< SoundBuffer > | getSoundBuffer (const std::string &filename) |
ALuint | getSoundSource (BaseSound *object) |
float | getVolume (SoundType::Value type) |
void | pauseAmbientSound (AmbientSound *ambient) |
virtual void | postUpdate (const Clock &time) override |
Gets called by Core after the framework was ticked (but before graphics are drawn). More... | |
virtual void | preUpdate (const Clock &time) override |
Gets called by Core before the framework is ticked. More... | |
void | registerAmbientSound (AmbientSound *newAmbient) |
void | releaseSoundBuffer (const std::shared_ptr< SoundBuffer > &buffer, bool bPoolBuffer) |
void | releaseSoundSource (ALuint source) |
void | setConfigValues () |
void | setListenerOrientation (const Quaternion &orientation) |
void | setListenerPosition (const Vector3 &position) |
void | setVolume (float vol, SoundType::Value type) |
void | toggleMute (SoundType::Value type) |
void | unregisterAmbientSound (AmbientSound *oldAmbient) |
Public Member Functions inherited from orxonox::Configurable | |
Configurable () | |
void | setConfigValues () |
Function to collect the SetConfigValue-macro calls. More... | |
Public Member Functions inherited from orxonox::Listable | |
Listable () | |
Constructor: Allocates space in the element list. More... | |
Listable (Context *context) | |
Constructor: Allocates space in the element list and assigns the context. More... | |
virtual | ~Listable () |
Destructor: Removes the object from the object-lists. More... | |
Context * | getContext () const |
void | setContext (Context *context) |
Changes the context. More... | |
void | unregisterObject () |
Removes this object from the object-lists. More... | |
Public Member Functions inherited from orxonox::Identifiable | |
Identifiable () | |
Constructor: Sets the default values. More... | |
virtual | ~Identifiable () |
ORX_FORCEINLINE void * | getDerivedPointer (unsigned int classID) |
Returns a valid pointer of any derived type that is registered in the class hierarchy. More... | |
template<class T > | |
ORX_FORCEINLINE T * | getDerivedPointer (unsigned int classID) |
Version of getDerivedPointer with template. More... | |
template<class T > | |
ORX_FORCEINLINE const T * | getDerivedPointer (unsigned int classID) const |
Const version of getDerivedPointer with template. More... | |
Identifier * | getIdentifier () const |
Returns the Identifier of the object. More... | |
bool | isA (const Identifier *identifier) |
Returns true if the object's class is of the given type or a derivative. More... | |
template<class B > | |
bool | isA (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is of the given type or a derivative. More... | |
bool | isA (const Identifiable *object) |
Returns true if the object's class is of the given type or a derivative. More... | |
bool | isChildOf (const Identifier *identifier) |
Returns true if the object's class is a child of the given type. More... | |
template<class B > | |
bool | isChildOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a child of the given type. More... | |
bool | isChildOf (const Identifiable *object) |
Returns true if the object's class is a child of the given type. More... | |
bool | isDirectChildOf (const Identifier *identifier) |
Returns true if the object's class is a direct child of the given type. More... | |
template<class B > | |
bool | isDirectChildOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isDirectChildOf (const Identifiable *object) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isDirectParentOf (const Identifier *identifier) |
Returns true if the object's class is a direct parent of the given type. More... | |
template<class B > | |
bool | isDirectParentOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a direct parent of the given type. More... | |
bool | isDirectParentOf (const Identifiable *object) |
Returns true if the object's class is a direct child of the given type. More... | |
bool | isExactlyA (const Identifier *identifier) |
Returns true if the object's class is exactly of the given type. More... | |
template<class B > | |
bool | isExactlyA (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is exactly of the given type. More... | |
bool | isExactlyA (const Identifiable *object) |
Returns true if the object's class is exactly of the given type. More... | |
bool | isParentOf (const Identifier *identifier) |
Returns true if the object's class is a parent of the given type. More... | |
template<class B > | |
bool | isParentOf (const SubclassIdentifier< B > *identifier) |
Returns true if the object's class is a parent of the given type. More... | |
bool | isParentOf (const Identifiable *object) |
Returns true if the object's class is a parent of the given type. More... | |
Public Member Functions inherited from orxonox::UpdateListener | |
UpdateListener () | |
Static Public Member Functions | |
static bool | exists () |
static std::string | getALErrorString (ALenum error) |
static SoundManager & | getInstance () |
Static Public Member Functions inherited from orxonox::Singleton< SoundManager > | |
static bool | exists () |
Tells whether the singleton has been created. More... | |
static SoundManager & | getInstance () |
Returns a reference to the singleton instance. More... | |
Private Types | |
typedef std::list< std::pair< AmbientSound *, bool > > | AmbientList |
typedef std::list< std::shared_ptr< SoundBuffer > > | EffectsPoolList |
typedef std::map< std::string, std::shared_ptr< SoundBuffer > > | SoundBufferMap |
Private Member Functions | |
void | checkAmbientVolumeValidity () |
void | checkEffectsVolumeValidity () |
void | checkFadeStepValidity () |
void | checkSoundVolumeValidity () |
void | checkVolumeValidity (SoundType::Value type) |
unsigned int | createSoundSources (unsigned int n) |
void | fadeIn (AmbientSound *sound) |
void | fadeOut (AmbientSound *sound) |
void | processCrossFading (float dt) |
void | updateVolume (SoundType::Value type) |
Private Attributes | |
AmbientList | ambientSounds_ |
std::vector< ALuint > | availableSoundSources_ |
bool | bDestructorCalled_ |
Becomes true if the destructor is called - used to prevent ambient sounds from registering after the lists were cleared. More... | |
ALCcontext * | context_ |
float | crossFadeStep_ |
Absolute change per second (0.1 means 10% of the nominal volume) for cross fading. More... | |
ALCdevice * | device_ |
std::vector< std::string > | deviceNames_ |
EffectsPoolList | effectsPool_ |
unsigned int | effectsPoolSize_ |
std::list< StrongPtr< AmbientSound > > | fadeInList_ |
std::list< StrongPtr< AmbientSound > > | fadeOutList_ |
unsigned int | maxSources_ |
unsigned int | minSources_ |
float | mute_ [3] |
SoundBufferMap | soundBuffers_ |
std::vector< std::pair< ALuint, BaseSound * > > | usedSoundSources_ |
float | volume_ [3] |
Static Private Attributes | |
static const unsigned int | maxEffectsPoolSize_s = 40 * 1024 * 1024 |
static SoundManager * | singletonPtr_s |
Friends | |
class | Singleton< SoundManager > |
Additional Inherited Members | |
Protected Member Functions inherited from orxonox::Singleton< SoundManager > | |
Singleton () | |
Constructor sets the singleton instance pointer. More... | |
virtual | ~Singleton () |
Destructor resets the singleton instance pointer. More... | |
The SoundManager class manages the OpenAL device, context and listener position.
|
private |
|
private |
|
private |
orxonox::SoundManager::SoundManager | ( | ) |
orxonox::SoundManager::~SoundManager | ( | ) |
|
inlineprivate |
|
inlineprivate |
|
private |
|
inlineprivate |
|
private |
|
private |
|
inlinestatic |
|
private |
|
private |
|
static |
|
inline |
|
inlinestatic |
bool orxonox::SoundManager::getMute | ( | SoundType::Value | type | ) |
float orxonox::SoundManager::getRealVolume | ( | SoundType::Value | type | ) |
std::shared_ptr< SoundBuffer > orxonox::SoundManager::getSoundBuffer | ( | const std::string & | filename | ) |
float orxonox::SoundManager::getVolume | ( | SoundType::Value | type | ) |
void orxonox::SoundManager::pauseAmbientSound | ( | AmbientSound * | ambient | ) |
Gets called by Core after the framework was ticked (but before graphics are drawn).
Implements orxonox::UpdateListener.
Gets called by Core before the framework is ticked.
Implements orxonox::UpdateListener.
|
private |
void orxonox::SoundManager::registerAmbientSound | ( | AmbientSound * | newAmbient | ) |
void orxonox::SoundManager::releaseSoundBuffer | ( | const std::shared_ptr< SoundBuffer > & | buffer, |
bool | bPoolBuffer | ||
) |
void orxonox::SoundManager::setListenerOrientation | ( | const Quaternion & | orientation | ) |
void orxonox::SoundManager::setListenerPosition | ( | const Vector3 & | position | ) |
void orxonox::SoundManager::setVolume | ( | float | vol, |
SoundType::Value | type | ||
) |
void orxonox::SoundManager::toggleMute | ( | SoundType::Value | type | ) |
void orxonox::SoundManager::unregisterAmbientSound | ( | AmbientSound * | oldAmbient | ) |
|
private |
|
friend |
|
private |
|
private |
|
private |
Becomes true if the destructor is called - used to prevent ambient sounds from registering after the lists were cleared.
|
private |
|
private |
Absolute change per second (0.1 means 10% of the nominal volume) for cross fading.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
|
private |