FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
FIFE::SoundManager Class Reference

#include <soundmanager.h>

+ Inheritance diagram for FIFE::SoundManager:
+ Collaboration diagram for FIFE::SoundManager:

Public Member Functions

 SoundManager ()
 
 ~SoundManager ()
 
void init ()
 Initializes the audio system. More...
 
bool isActive () const
 Returns true if audio module is active. More...
 
ALCcontext * getContext () const
 Returns an openAL context. More...
 
void setVolume (float vol)
 Sets the Master Volume. More...
 
float getVolume () const
 Return the Master Volume. More...
 
void mute ()
 Mute. More...
 
void unmute ()
 Unmutes to volume before mute() was called. More...
 
void play ()
 Plays all SoundEmitters. More...
 
void pause ()
 Pauses all SoundEmitters. More...
 
void stop ()
 Stops all SoundEmitters. More...
 
void rewind ()
 Rewinds all SoundEmitters. More...
 
void setDistanceModel (SoundDistanceModelType model)
 Sets the distance model. More...
 
SoundDistanceModelType getDistanceModel () const
 Return the distance mode. More...
 
void setListenerPosition (const AudioSpaceCoordinate &position)
 Sets the position of the listener (alter ego). More...
 
AudioSpaceCoordinate getListenerPosition () const
 Return the position of the listener (alter ego). More...
 
void setListenerOrientation (const AudioSpaceCoordinate &orientation)
 Sets the orientation of the listener (alter ego). More...
 
AudioSpaceCoordinate getListenerOrientation () const
 Return the orientation of the listener (alter ego). More...
 
void setListenerVelocity (const AudioSpaceCoordinate &velocity)
 Sets the velocity of the listener (alter ego). More...
 
AudioSpaceCoordinate getListenerVelocity () const
 Return the velocity of the listener (alter ego). More...
 
void setDopplerFactor (float factor)
 Sets factor for doppler effect. More...
 
float getDopplerFactor () const
 Return factor for doppler effect. More...
 
void setListenerMaxDistance (float distance)
 Sets the maximal listener distance. More...
 
float getListenerMaxDistance () const
 Return the maximal listener distance. More...
 
void update ()
 Called once a frame and updates the sound objects. More...
 
SoundEmittergetEmitter (uint32_t emitterId) const
 Returns a pointer to an emitter-instance given by emitterId. More...
 
SoundEmittercreateEmitter ()
 Returns a pointer to an allocated emitter-instance. More...
 
SoundEmittercreateEmitter (const std::string &name)
 Returns a pointer to an allocated emitter-instance. More...
 
void releaseEmitter (uint32_t emitterId)
 Release an emitter-instance given by emitter-id. More...
 
void deleteEmitter (SoundEmitter *emitter)
 Release given emitter. More...
 
void releaseSource (SoundEmitter *emitter)
 Release the source handle. More...
 
SoundEffectcreateSoundEffect (SoundEffectType type)
 Creates SoundEffect of the specific type. More...
 
SoundEffectcreateSoundEffectPreset (SoundEffectPreset type)
 Creates EaxReverb SoundEffect and loads the specific preset type. More...
 
void deleteSoundEffect (SoundEffect *effect)
 Deletes given SoundEffect. More...
 
void enableSoundEffect (SoundEffect *effect)
 Enables given SoundEffect. More...
 
void disableSoundEffect (SoundEffect *effect)
 Disables given SoundEffect. More...
 
void addEmitterToSoundEffect (SoundEffect *effect, SoundEmitter *emitter)
 Adds given SoundEmitter to the specific SoundEffect. More...
 
void removeEmitterFromSoundEffect (SoundEffect *effect, SoundEmitter *emitter)
 Removes given SoundEmitter from the specific SoundEffect. More...
 
void addSoundFilterToSoundEffect (SoundEffect *effect, SoundFilter *filter)
 Adds given SoundFilter to the SoundEffect. More...
 
void removeSoundFilterFromSoundEffect (SoundEffect *effect, SoundFilter *filter)
 Removes given SoundFilter from the SoundEffect. More...
 
void activateEffect (SoundEffect *effect, SoundEmitter *emitter)
 Internal function to do the OpenAL calls to activate the SoundEffect for the SoundEmitter. More...
 
void deactivateEffect (SoundEffect *effect, SoundEmitter *emitter)
 Internal function to do the OpenAL calls to deactivate the SoundEffect for the SoundEmitter. More...
 
SoundFiltercreateSoundFilter (SoundFilterType type)
 Creates SoundFilter of the specific type. More...
 
void deleteSoundFilter (SoundFilter *filter)
 Deletes given SoundFilter. More...
 
void enableDirectSoundFilter (SoundFilter *filter)
 Enables given direct SoundFilter. More...
 
void disableDirectSoundFilter (SoundFilter *filter)
 Disables given SoundFilter. More...
 
void addEmitterToDirectSoundFilter (SoundFilter *filter, SoundEmitter *emitter)
 Adds given SoundEmitter to the specific direct SoundFilter Note: A SoundEmitter can only have one direct filter. More...
 
void removeEmitterFromDirectSoundFilter (SoundFilter *filter, SoundEmitter *emitter)
 Removes given SoundEmitter from the specific direct SoundFilter. More...
 
void activateFilter (SoundFilter *filter, SoundEmitter *emitter)
 Internal function to do the OpenAL calls to activate the SoundFilter for the SoundEmitter. More...
 
void deactivateFilter (SoundFilter *filter, SoundEmitter *emitter)
 Internal function to do the OpenAL calls to deactivate the SoundFilter for the SoundEmitter. More...
 
void addToGroup (SoundEmitter *emitter)
 Adds the emitter to group. More...
 
void removeFromGroup (SoundEmitter *emitter)
 Removes the emitter from group. More...
 
void removeGroup (const std::string &group)
 Remove group and resets the group for the affected emitters. More...
 
void removeAllGroups ()
 Remove all groups and resets the group of affected emitters. More...
 
void play (const std::string &group)
 Plays all emitters of the group. More...
 
void pause (const std::string &group)
 Pauses all emitters of the group. More...
 
void stop (const std::string &group)
 Stops all emitters of the group. More...
 
void rewind (const std::string &group)
 Rewinds all emitters of the group. More...
 
void setGain (const std::string &group, float gain)
 Sets gain for all emitters of the group. More...
 
void setMaxGain (const std::string &group, float gain)
 Sets max gain for all emitters of the group. More...
 
void setMinGain (const std::string &group, float gain)
 Sets min gain for all emitters of the group. More...
 
- Public Member Functions inherited from FIFE::DynamicSingleton< SoundManager >
 DynamicSingleton ()
 
virtual ~DynamicSingleton ()
 

Private Types

typedef std::map< std::string, std::vector< SoundEmitter * > > EmitterGroups
 
typedef EmitterGroups::iterator EmitterGroupsIterator
 

Private Member Functions

void setEmitterSource (SoundEmitter *emitter)
 Sets the source handle. More...
 

Private Attributes

std::vector< SoundEmitter * > m_emitterVec
 emitter-vector, holds all emitters More...
 
ALCcontext * m_context
 OpenAL context. More...
 
ALCdevice * m_device
 OpenAL device. More...
 
float m_muteVol
 volume before mute() was called More...
 
float m_volume
 volume to support setVolume-calls before initialization More...
 
float m_maxDistance
 distance that removes a active Emitter More...
 
SoundDistanceModelType m_distanceModel
 Selected distance model. More...
 
SoundManagerState m_state
 State of the SoundManager. More...
 
ALuint m_sources [MAX_SOURCES]
 Holds handles for sources. More...
 
uint16_t m_createdSources
 Maximal created sources, can be different to MAX_SOURCES. More...
 
std::queue< ALuint > m_freeSources
 Holds free handles for sources. More...
 
std::map< SoundEmitter *, ALuint > m_activeEmitters
 Map that holds active Emitters together with the used source handle. More...
 
SoundEffectManagerm_effectManager
 
EmitterGroups m_groups
 A map that holds the groups together with the appended emitters. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from FIFE::DynamicSingleton< SoundManager >
static SoundManagerinstance ()
 

Detailed Description

Definition at line 70 of file soundmanager.h.

Member Typedef Documentation

◆ EmitterGroups

typedef std::map<std::string, std::vector<SoundEmitter*> > FIFE::SoundManager::EmitterGroups
private

Definition at line 365 of file soundmanager.h.

◆ EmitterGroupsIterator

typedef EmitterGroups::iterator FIFE::SoundManager::EmitterGroupsIterator
private

Definition at line 366 of file soundmanager.h.

Constructor & Destructor Documentation

◆ SoundManager()

FIFE::SoundManager::SoundManager ( )

Definition at line 47 of file soundmanager.cpp.

◆ ~SoundManager()

FIFE::SoundManager::~SoundManager ( )

Member Function Documentation

◆ activateEffect()

void FIFE::SoundManager::activateEffect ( SoundEffect effect,
SoundEmitter emitter 
)

Internal function to do the OpenAL calls to activate the SoundEffect for the SoundEmitter.

Definition at line 464 of file soundmanager.cpp.

References FIFE::SoundEffectManager::activateEffect(), and m_effectManager.

Referenced by FIFE::SoundEmitter::activateEffects().

+ Here is the caller graph for this function:

◆ activateFilter()

void FIFE::SoundManager::activateFilter ( SoundFilter filter,
SoundEmitter emitter 
)

Internal function to do the OpenAL calls to activate the SoundFilter for the SoundEmitter.

Definition at line 496 of file soundmanager.cpp.

References FIFE::SoundEffectManager::activateFilter(), and m_effectManager.

Referenced by FIFE::SoundEmitter::activateEffects().

+ Here is the caller graph for this function:

◆ addEmitterToDirectSoundFilter()

void FIFE::SoundManager::addEmitterToDirectSoundFilter ( SoundFilter filter,
SoundEmitter emitter 
)

Adds given SoundEmitter to the specific direct SoundFilter Note: A SoundEmitter can only have one direct filter.

Definition at line 488 of file soundmanager.cpp.

References FIFE::SoundEffectManager::addEmitterToDirectSoundFilter(), and m_effectManager.

◆ addEmitterToSoundEffect()

void FIFE::SoundManager::addEmitterToSoundEffect ( SoundEffect effect,
SoundEmitter emitter 
)

Adds given SoundEmitter to the specific SoundEffect.

Note: A SoundEmitter can only have a limited number of effects, usually 4.

Definition at line 448 of file soundmanager.cpp.

References FIFE::SoundEffectManager::addEmitterToSoundEffect(), and m_effectManager.

◆ addSoundFilterToSoundEffect()

void FIFE::SoundManager::addSoundFilterToSoundEffect ( SoundEffect effect,
SoundFilter filter 
)

Adds given SoundFilter to the SoundEffect.

Note: A SoundEffect can only have one SoundFilter.

Definition at line 456 of file soundmanager.cpp.

References FIFE::SoundEffectManager::addSoundFilterToSoundEffect(), and m_effectManager.

◆ addToGroup()

void FIFE::SoundManager::addToGroup ( SoundEmitter emitter)

Adds the emitter to group.

Called from the emitter after a setGroup() call.

Parameters
emitterThe emitter-instance.

Definition at line 504 of file soundmanager.cpp.

References FIFE::SoundEmitter::getGroup(), and m_groups.

Referenced by FIFE::SoundEmitter::setGroup().

+ Here is the caller graph for this function:

◆ createEmitter() [1/2]

SoundEmitter * FIFE::SoundManager::createEmitter ( )

Returns a pointer to an allocated emitter-instance.

Definition at line 370 of file soundmanager.cpp.

References m_emitterVec.

Referenced by createEmitter(), and FIFE::SoundSource::SoundSource().

+ Here is the caller graph for this function:

◆ createEmitter() [2/2]

SoundEmitter * FIFE::SoundManager::createEmitter ( const std::string &  name)

Returns a pointer to an allocated emitter-instance.

Parameters
nameThe name of the SoundClip.

Definition at line 386 of file soundmanager.cpp.

References createEmitter(), FIFE::DynamicSingleton< SoundClipManager >::instance(), and FIFE::SoundEmitter::setSoundClip().

◆ createSoundEffect()

SoundEffect * FIFE::SoundManager::createSoundEffect ( SoundEffectType  type)

Creates SoundEffect of the specific type.

Parameters
typeSee SoundEffectType

Definition at line 428 of file soundmanager.cpp.

References FIFE::SoundEffectManager::createSoundEffect(), and m_effectManager.

◆ createSoundEffectPreset()

SoundEffect * FIFE::SoundManager::createSoundEffectPreset ( SoundEffectPreset  type)

Creates EaxReverb SoundEffect and loads the specific preset type.

Parameters
typeSee SoundEffectPreset

Definition at line 432 of file soundmanager.cpp.

References FIFE::SoundEffectManager::createSoundEffectPreset(), and m_effectManager.

◆ createSoundFilter()

SoundFilter * FIFE::SoundManager::createSoundFilter ( SoundFilterType  type)

Creates SoundFilter of the specific type.

Parameters
typeSee SoundFilterType

Definition at line 472 of file soundmanager.cpp.

References FIFE::SoundEffectManager::createSoundFilter(), and m_effectManager.

◆ deactivateEffect()

void FIFE::SoundManager::deactivateEffect ( SoundEffect effect,
SoundEmitter emitter 
)

Internal function to do the OpenAL calls to deactivate the SoundEffect for the SoundEmitter.

Definition at line 468 of file soundmanager.cpp.

References FIFE::SoundEffectManager::deactivateEffect(), and m_effectManager.

Referenced by FIFE::SoundEmitter::deactivateEffects().

+ Here is the caller graph for this function:

◆ deactivateFilter()

void FIFE::SoundManager::deactivateFilter ( SoundFilter filter,
SoundEmitter emitter 
)

Internal function to do the OpenAL calls to deactivate the SoundFilter for the SoundEmitter.

Definition at line 500 of file soundmanager.cpp.

References FIFE::SoundEffectManager::deactivateFilter(), and m_effectManager.

Referenced by FIFE::SoundEmitter::deactivateEffects(), and FIFE::SoundEmitter::reset().

+ Here is the caller graph for this function:

◆ deleteEmitter()

void FIFE::SoundManager::deleteEmitter ( SoundEmitter emitter)

Release given emitter.

Parameters
emitterThe emitter-instance to destroy.

Definition at line 401 of file soundmanager.cpp.

References FIFE::SoundEmitter::getId(), and releaseEmitter().

◆ deleteSoundEffect()

void FIFE::SoundManager::deleteSoundEffect ( SoundEffect effect)

Deletes given SoundEffect.

Deactivates for SoundEmitters are automatically done.

Definition at line 436 of file soundmanager.cpp.

References FIFE::SoundEffectManager::deleteSoundEffect(), and m_effectManager.

◆ deleteSoundFilter()

void FIFE::SoundManager::deleteSoundFilter ( SoundFilter filter)

Deletes given SoundFilter.

Deactivates for SoundEmitters and Effects are automatically done.

Definition at line 476 of file soundmanager.cpp.

References FIFE::SoundEffectManager::deleteSoundFilter(), and m_effectManager.

◆ disableDirectSoundFilter()

void FIFE::SoundManager::disableDirectSoundFilter ( SoundFilter filter)

Disables given SoundFilter.

Only SoundFilters for SoundEmitters are meant.

Definition at line 484 of file soundmanager.cpp.

References FIFE::SoundEffectManager::disableDirectSoundFilter(), and m_effectManager.

◆ disableSoundEffect()

void FIFE::SoundManager::disableSoundEffect ( SoundEffect effect)

Disables given SoundEffect.

Definition at line 444 of file soundmanager.cpp.

References FIFE::SoundEffectManager::disableSoundEffect(), and m_effectManager.

◆ enableDirectSoundFilter()

void FIFE::SoundManager::enableDirectSoundFilter ( SoundFilter filter)

Enables given direct SoundFilter.

Only SoundFilters for SoundEmitters are meant.

Definition at line 480 of file soundmanager.cpp.

References FIFE::SoundEffectManager::enableDirectSoundFilter(), and m_effectManager.

◆ enableSoundEffect()

void FIFE::SoundManager::enableSoundEffect ( SoundEffect effect)

Enables given SoundEffect.

Definition at line 440 of file soundmanager.cpp.

References FIFE::SoundEffectManager::enableSoundEffect(), and m_effectManager.

◆ getContext()

ALCcontext * FIFE::SoundManager::getContext ( ) const

Returns an openAL context.

Definition at line 135 of file soundmanager.cpp.

References m_context.

◆ getDistanceModel()

SoundDistanceModelType FIFE::SoundManager::getDistanceModel ( ) const

Return the distance mode.

Definition at line 240 of file soundmanager.cpp.

References m_distanceModel.

◆ getDopplerFactor()

float FIFE::SoundManager::getDopplerFactor ( ) const

Return factor for doppler effect.

Definition at line 299 of file soundmanager.cpp.

References isActive().

◆ getEmitter()

SoundEmitter * FIFE::SoundManager::getEmitter ( uint32_t  emitterId) const

Returns a pointer to an emitter-instance given by emitterId.

Parameters
emitterIdThe id of the Emitter

Definition at line 366 of file soundmanager.cpp.

References m_emitterVec.

◆ getListenerMaxDistance()

float FIFE::SoundManager::getListenerMaxDistance ( ) const

Return the maximal listener distance.

Definition at line 310 of file soundmanager.cpp.

References m_maxDistance.

◆ getListenerOrientation()

AudioSpaceCoordinate FIFE::SoundManager::getListenerOrientation ( ) const

Return the orientation of the listener (alter ego).

Definition at line 267 of file soundmanager.cpp.

References isActive().

◆ getListenerPosition()

AudioSpaceCoordinate FIFE::SoundManager::getListenerPosition ( ) const

Return the position of the listener (alter ego).

Definition at line 250 of file soundmanager.cpp.

References isActive().

Referenced by update().

+ Here is the caller graph for this function:

◆ getListenerVelocity()

AudioSpaceCoordinate FIFE::SoundManager::getListenerVelocity ( ) const

Return the velocity of the listener (alter ego).

Definition at line 282 of file soundmanager.cpp.

References isActive().

◆ getVolume()

float FIFE::SoundManager::getVolume ( ) const

Return the Master Volume.

Definition at line 147 of file soundmanager.cpp.

References m_volume.

◆ init()

void FIFE::SoundManager::init ( )

◆ isActive()

bool FIFE::SoundManager::isActive ( ) const

◆ mute()

void FIFE::SoundManager::mute ( )

Mute.

Definition at line 151 of file soundmanager.cpp.

References isActive(), and m_muteVol.

◆ pause() [1/2]

void FIFE::SoundManager::pause ( )

Pauses all SoundEmitters.

Definition at line 175 of file soundmanager.cpp.

References m_emitterVec, m_state, FIFE::SoundEmitter::pause(), and FIFE::SM_STATE_PAUSE.

◆ pause() [2/2]

void FIFE::SoundManager::pause ( const std::string &  group)

Pauses all emitters of the group.

Parameters
groupThe group name.

Definition at line 576 of file soundmanager.cpp.

References FIFE::_log, FL_WARN, and m_groups.

◆ play() [1/2]

void FIFE::SoundManager::play ( )

Plays all SoundEmitters.

Definition at line 164 of file soundmanager.cpp.

References m_emitterVec, m_state, FIFE::SoundEmitter::play(), and FIFE::SM_STATE_PLAY.

◆ play() [2/2]

void FIFE::SoundManager::play ( const std::string &  group)

Plays all emitters of the group.

Parameters
groupThe group name.

Definition at line 564 of file soundmanager.cpp.

References FIFE::_log, FL_WARN, and m_groups.

◆ releaseEmitter()

void FIFE::SoundManager::releaseEmitter ( uint32_t  emitterId)

Release an emitter-instance given by emitter-id.

Parameters
emitterIdThe id of the Emitter.

Definition at line 392 of file soundmanager.cpp.

References m_emitterVec, and releaseSource().

Referenced by deleteEmitter(), FIFE::SoundEmitter::release(), and FIFE::SoundSource::~SoundSource().

+ Here is the caller graph for this function:

◆ releaseSource()

void FIFE::SoundManager::releaseSource ( SoundEmitter emitter)

Release the source handle.

Parameters
emitterThe emitter-instance.

Definition at line 415 of file soundmanager.cpp.

References FIFE::_log, FL_WARN, FIFE::SoundEmitter::isActive(), m_activeEmitters, m_freeSources, and FIFE::SoundEmitter::setSource().

Referenced by releaseEmitter(), FIFE::SoundEmitter::reset(), and update().

+ Here is the caller graph for this function:

◆ removeAllGroups()

void FIFE::SoundManager::removeAllGroups ( )

Remove all groups and resets the group of affected emitters.

Definition at line 553 of file soundmanager.cpp.

References m_groups, and removeGroup().

◆ removeEmitterFromDirectSoundFilter()

void FIFE::SoundManager::removeEmitterFromDirectSoundFilter ( SoundFilter filter,
SoundEmitter emitter 
)

Removes given SoundEmitter from the specific direct SoundFilter.

Definition at line 492 of file soundmanager.cpp.

References m_effectManager, and FIFE::SoundEffectManager::removeEmitterFromDirectSoundFilter().

◆ removeEmitterFromSoundEffect()

void FIFE::SoundManager::removeEmitterFromSoundEffect ( SoundEffect effect,
SoundEmitter emitter 
)

Removes given SoundEmitter from the specific SoundEffect.

Definition at line 452 of file soundmanager.cpp.

References m_effectManager, and FIFE::SoundEffectManager::removeEmitterFromSoundEffect().

Referenced by FIFE::SoundEmitter::reset().

+ Here is the caller graph for this function:

◆ removeFromGroup()

void FIFE::SoundManager::removeFromGroup ( SoundEmitter emitter)

Removes the emitter from group.

Called from the emitter if new group is different as the old.

Parameters
emitterThe emitter-instance.

Definition at line 510 of file soundmanager.cpp.

References FIFE::_log, FL_WARN, FIFE::SoundEmitter::getGroup(), and m_groups.

Referenced by FIFE::SoundEmitter::reset(), and FIFE::SoundEmitter::setGroup().

+ Here is the caller graph for this function:

◆ removeGroup()

void FIFE::SoundManager::removeGroup ( const std::string &  group)

Remove group and resets the group for the affected emitters.

Parameters
groupThe group name.

Definition at line 537 of file soundmanager.cpp.

References FIFE::_log, FL_WARN, and m_groups.

Referenced by removeAllGroups().

+ Here is the caller graph for this function:

◆ removeSoundFilterFromSoundEffect()

void FIFE::SoundManager::removeSoundFilterFromSoundEffect ( SoundEffect effect,
SoundFilter filter 
)

◆ rewind() [1/2]

void FIFE::SoundManager::rewind ( )

Rewinds all SoundEmitters.

Definition at line 197 of file soundmanager.cpp.

References m_emitterVec, and FIFE::SoundEmitter::rewind().

◆ rewind() [2/2]

void FIFE::SoundManager::rewind ( const std::string &  group)

Rewinds all emitters of the group.

Parameters
groupThe group name.

Definition at line 600 of file soundmanager.cpp.

References FIFE::_log, FL_WARN, and m_groups.

◆ setDistanceModel()

◆ setDopplerFactor()

void FIFE::SoundManager::setDopplerFactor ( float  factor)

Sets factor for doppler effect.

Definition at line 291 of file soundmanager.cpp.

References isActive().

◆ setEmitterSource()

void FIFE::SoundManager::setEmitterSource ( SoundEmitter emitter)
private

Sets the source handle.

Parameters
emitterThe Emitter pointer.

Definition at line 405 of file soundmanager.cpp.

References FIFE::_log, FL_WARN, m_activeEmitters, m_freeSources, and FIFE::SoundEmitter::setSource().

Referenced by update().

+ Here is the caller graph for this function:

◆ setGain()

void FIFE::SoundManager::setGain ( const std::string &  group,
float  gain 
)

Sets gain for all emitters of the group.

Parameters
groupThe group name.
gainThe gain value.

Definition at line 612 of file soundmanager.cpp.

References FIFE::_log, FL_WARN, and m_groups.

◆ setListenerMaxDistance()

void FIFE::SoundManager::setListenerMaxDistance ( float  distance)

Sets the maximal listener distance.

If it is larger the emitter turns off, or on if it is smaller.

Definition at line 306 of file soundmanager.cpp.

References utf8::distance(), and m_maxDistance.

◆ setListenerOrientation()

void FIFE::SoundManager::setListenerOrientation ( const AudioSpaceCoordinate orientation)

Sets the orientation of the listener (alter ego).

Definition at line 259 of file soundmanager.cpp.

References isActive(), FIFE::PointType3D< T >::x, FIFE::PointType3D< T >::y, and FIFE::PointType3D< T >::z.

◆ setListenerPosition()

void FIFE::SoundManager::setListenerPosition ( const AudioSpaceCoordinate position)

Sets the position of the listener (alter ego).

Definition at line 244 of file soundmanager.cpp.

References isActive(), FIFE::PointType3D< T >::x, FIFE::PointType3D< T >::y, and FIFE::PointType3D< T >::z.

◆ setListenerVelocity()

void FIFE::SoundManager::setListenerVelocity ( const AudioSpaceCoordinate velocity)

Sets the velocity of the listener (alter ego).

Definition at line 276 of file soundmanager.cpp.

References isActive(), FIFE::PointType3D< T >::x, FIFE::PointType3D< T >::y, and FIFE::PointType3D< T >::z.

◆ setMaxGain()

void FIFE::SoundManager::setMaxGain ( const std::string &  group,
float  gain 
)

Sets max gain for all emitters of the group.

Parameters
groupThe group name.
gainThe max gain value.

Definition at line 624 of file soundmanager.cpp.

References FIFE::_log, FL_WARN, and m_groups.

◆ setMinGain()

void FIFE::SoundManager::setMinGain ( const std::string &  group,
float  gain 
)

Sets min gain for all emitters of the group.

Parameters
groupThe group name.
gainThe min gain value.

Definition at line 636 of file soundmanager.cpp.

References FIFE::_log, FL_WARN, and m_groups.

◆ setVolume()

void FIFE::SoundManager::setVolume ( float  vol)

Sets the Master Volume.

Parameters
volThe volume value. 0=silence ... 1.0=normal loudness.

Definition at line 139 of file soundmanager.cpp.

References isActive(), m_muteVol, and m_volume.

Referenced by FIFE::Engine::init().

+ Here is the caller graph for this function:

◆ stop() [1/2]

void FIFE::SoundManager::stop ( )

Stops all SoundEmitters.

Definition at line 186 of file soundmanager.cpp.

References m_emitterVec, m_state, FIFE::SM_STATE_STOP, and FIFE::SoundEmitter::stop().

◆ stop() [2/2]

void FIFE::SoundManager::stop ( const std::string &  group)

Stops all emitters of the group.

Parameters
groupThe group name.

Definition at line 588 of file soundmanager.cpp.

References FIFE::_log, FL_WARN, and m_groups.

◆ unmute()

void FIFE::SoundManager::unmute ( )

Unmutes to volume before mute() was called.

Definition at line 158 of file soundmanager.cpp.

References isActive(), and m_muteVol.

◆ update()

Member Data Documentation

◆ m_activeEmitters

std::map<SoundEmitter*, ALuint> FIFE::SoundManager::m_activeEmitters
private

Map that holds active Emitters together with the used source handle.

Definition at line 398 of file soundmanager.h.

Referenced by releaseSource(), setEmitterSource(), and update().

◆ m_context

ALCcontext* FIFE::SoundManager::m_context
private

OpenAL context.

Definition at line 377 of file soundmanager.h.

Referenced by getContext(), init(), and ~SoundManager().

◆ m_createdSources

uint16_t FIFE::SoundManager::m_createdSources
private

Maximal created sources, can be different to MAX_SOURCES.

Definition at line 394 of file soundmanager.h.

Referenced by init(), and ~SoundManager().

◆ m_device

ALCdevice* FIFE::SoundManager::m_device
private

OpenAL device.

Definition at line 379 of file soundmanager.h.

Referenced by init(), and ~SoundManager().

◆ m_distanceModel

SoundDistanceModelType FIFE::SoundManager::m_distanceModel
private

Selected distance model.

Definition at line 387 of file soundmanager.h.

Referenced by getDistanceModel(), and setDistanceModel().

◆ m_effectManager

◆ m_emitterVec

std::vector<SoundEmitter*> FIFE::SoundManager::m_emitterVec
private

emitter-vector, holds all emitters

Definition at line 375 of file soundmanager.h.

Referenced by createEmitter(), getEmitter(), pause(), play(), releaseEmitter(), rewind(), stop(), update(), and ~SoundManager().

◆ m_freeSources

std::queue<ALuint> FIFE::SoundManager::m_freeSources
private

Holds free handles for sources.

Definition at line 396 of file soundmanager.h.

Referenced by init(), releaseSource(), setEmitterSource(), and update().

◆ m_groups

EmitterGroups FIFE::SoundManager::m_groups
private

A map that holds the groups together with the appended emitters.

Definition at line 403 of file soundmanager.h.

Referenced by addToGroup(), pause(), play(), removeAllGroups(), removeFromGroup(), removeGroup(), rewind(), setGain(), setMaxGain(), setMinGain(), and stop().

◆ m_maxDistance

float FIFE::SoundManager::m_maxDistance
private

distance that removes a active Emitter

Definition at line 385 of file soundmanager.h.

Referenced by getListenerMaxDistance(), setListenerMaxDistance(), and update().

◆ m_muteVol

float FIFE::SoundManager::m_muteVol
private

volume before mute() was called

Definition at line 381 of file soundmanager.h.

Referenced by mute(), setVolume(), and unmute().

◆ m_sources

ALuint FIFE::SoundManager::m_sources[MAX_SOURCES]
private

Holds handles for sources.

Definition at line 392 of file soundmanager.h.

Referenced by init(), and ~SoundManager().

◆ m_state

SoundManagerState FIFE::SoundManager::m_state
private

State of the SoundManager.

Definition at line 389 of file soundmanager.h.

Referenced by init(), isActive(), pause(), play(), stop(), and update().

◆ m_volume

float FIFE::SoundManager::m_volume
private

volume to support setVolume-calls before initialization

Definition at line 383 of file soundmanager.h.

Referenced by getVolume(), init(), and setVolume().


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