FIFE
be64c707dea6b3250bd4355bf5c825d25920087d
|
#include <soundmanager.h>
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... | |
SoundEmitter * | getEmitter (uint32_t emitterId) const |
Returns a pointer to an emitter-instance given by emitterId. More... | |
SoundEmitter * | createEmitter () |
Returns a pointer to an allocated emitter-instance. More... | |
SoundEmitter * | createEmitter (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... | |
SoundEffect * | createSoundEffect (SoundEffectType type) |
Creates SoundEffect of the specific type. More... | |
SoundEffect * | createSoundEffectPreset (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... | |
SoundFilter * | createSoundFilter (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... | |
SoundEffectManager * | m_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 SoundManager * | instance () |
Definition at line 70 of file soundmanager.h.
|
private |
Definition at line 365 of file soundmanager.h.
|
private |
Definition at line 366 of file soundmanager.h.
FIFE::SoundManager::SoundManager | ( | ) |
Definition at line 47 of file soundmanager.cpp.
FIFE::SoundManager::~SoundManager | ( | ) |
Definition at line 60 of file soundmanager.cpp.
References FIFE::_log, FL_ERR, m_context, m_createdSources, m_device, m_effectManager, m_emitterVec, and m_sources.
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().
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().
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.
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.
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.
void FIFE::SoundManager::addToGroup | ( | SoundEmitter * | emitter | ) |
Adds the emitter to group.
Called from the emitter after a setGroup() call.
emitter | The emitter-instance. |
Definition at line 504 of file soundmanager.cpp.
References FIFE::SoundEmitter::getGroup(), and m_groups.
Referenced by FIFE::SoundEmitter::setGroup().
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().
SoundEmitter * FIFE::SoundManager::createEmitter | ( | const std::string & | name | ) |
Returns a pointer to an allocated emitter-instance.
name | The name of the SoundClip. |
Definition at line 386 of file soundmanager.cpp.
References createEmitter(), FIFE::DynamicSingleton< SoundClipManager >::instance(), and FIFE::SoundEmitter::setSoundClip().
SoundEffect * FIFE::SoundManager::createSoundEffect | ( | SoundEffectType | type | ) |
Creates SoundEffect of the specific type.
type | See SoundEffectType |
Definition at line 428 of file soundmanager.cpp.
References FIFE::SoundEffectManager::createSoundEffect(), and m_effectManager.
SoundEffect * FIFE::SoundManager::createSoundEffectPreset | ( | SoundEffectPreset | type | ) |
Creates EaxReverb SoundEffect and loads the specific preset type.
type | See SoundEffectPreset |
Definition at line 432 of file soundmanager.cpp.
References FIFE::SoundEffectManager::createSoundEffectPreset(), and m_effectManager.
SoundFilter * FIFE::SoundManager::createSoundFilter | ( | SoundFilterType | type | ) |
Creates SoundFilter of the specific type.
type | See SoundFilterType |
Definition at line 472 of file soundmanager.cpp.
References FIFE::SoundEffectManager::createSoundFilter(), and m_effectManager.
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().
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().
void FIFE::SoundManager::deleteEmitter | ( | SoundEmitter * | emitter | ) |
Release given emitter.
emitter | The emitter-instance to destroy. |
Definition at line 401 of file soundmanager.cpp.
References FIFE::SoundEmitter::getId(), and releaseEmitter().
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.
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.
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.
void FIFE::SoundManager::disableSoundEffect | ( | SoundEffect * | effect | ) |
Disables given SoundEffect.
Definition at line 444 of file soundmanager.cpp.
References FIFE::SoundEffectManager::disableSoundEffect(), and m_effectManager.
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.
void FIFE::SoundManager::enableSoundEffect | ( | SoundEffect * | effect | ) |
Enables given SoundEffect.
Definition at line 440 of file soundmanager.cpp.
References FIFE::SoundEffectManager::enableSoundEffect(), and m_effectManager.
ALCcontext * FIFE::SoundManager::getContext | ( | ) | const |
SoundDistanceModelType FIFE::SoundManager::getDistanceModel | ( | ) | const |
Return the distance mode.
Definition at line 240 of file soundmanager.cpp.
References m_distanceModel.
float FIFE::SoundManager::getDopplerFactor | ( | ) | const |
Return factor for doppler effect.
Definition at line 299 of file soundmanager.cpp.
References isActive().
SoundEmitter * FIFE::SoundManager::getEmitter | ( | uint32_t | emitterId | ) | const |
Returns a pointer to an emitter-instance given by emitterId.
emitterId | The id of the Emitter |
Definition at line 366 of file soundmanager.cpp.
References m_emitterVec.
float FIFE::SoundManager::getListenerMaxDistance | ( | ) | const |
Return the maximal listener distance.
Definition at line 310 of file soundmanager.cpp.
References m_maxDistance.
AudioSpaceCoordinate FIFE::SoundManager::getListenerOrientation | ( | ) | const |
Return the orientation of the listener (alter ego).
Definition at line 267 of file soundmanager.cpp.
References isActive().
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().
AudioSpaceCoordinate FIFE::SoundManager::getListenerVelocity | ( | ) | const |
Return the velocity of the listener (alter ego).
Definition at line 282 of file soundmanager.cpp.
References isActive().
float FIFE::SoundManager::getVolume | ( | ) | const |
void FIFE::SoundManager::init | ( | ) |
Initializes the audio system.
Definition at line 84 of file soundmanager.cpp.
References FIFE::_log, FL_ERR, FIFE::SoundEffectManager::init(), m_context, m_createdSources, m_device, m_effectManager, m_freeSources, m_sources, m_state, m_volume, FIFE::MAX_SOURCES, and FIFE::SM_STATE_PLAY.
bool FIFE::SoundManager::isActive | ( | ) | const |
Returns true if audio module is active.
Definition at line 131 of file soundmanager.cpp.
References m_state, and FIFE::SM_STATE_INACTIV.
Referenced by getDopplerFactor(), getListenerOrientation(), getListenerPosition(), getListenerVelocity(), mute(), setDistanceModel(), setDopplerFactor(), setListenerOrientation(), setListenerPosition(), setListenerVelocity(), setVolume(), FIFE::SoundEmitter::SoundEmitter(), unmute(), and FIFE::SoundEmitter::~SoundEmitter().
void FIFE::SoundManager::mute | ( | ) |
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.
void FIFE::SoundManager::pause | ( | const std::string & | group | ) |
Pauses all emitters of the group.
group | The group name. |
Definition at line 576 of file soundmanager.cpp.
References FIFE::_log, FL_WARN, and m_groups.
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.
void FIFE::SoundManager::play | ( | const std::string & | group | ) |
Plays all emitters of the group.
group | The group name. |
Definition at line 564 of file soundmanager.cpp.
References FIFE::_log, FL_WARN, and m_groups.
void FIFE::SoundManager::releaseEmitter | ( | uint32_t | emitterId | ) |
Release an emitter-instance given by emitter-id.
emitterId | The 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().
void FIFE::SoundManager::releaseSource | ( | SoundEmitter * | emitter | ) |
Release the source handle.
emitter | The 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().
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().
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().
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().
void FIFE::SoundManager::removeFromGroup | ( | SoundEmitter * | emitter | ) |
Removes the emitter from group.
Called from the emitter if new group is different as the old.
emitter | The 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().
void FIFE::SoundManager::removeGroup | ( | const std::string & | group | ) |
Remove group and resets the group for the affected emitters.
group | The group name. |
Definition at line 537 of file soundmanager.cpp.
References FIFE::_log, FL_WARN, and m_groups.
Referenced by removeAllGroups().
void FIFE::SoundManager::removeSoundFilterFromSoundEffect | ( | SoundEffect * | effect, |
SoundFilter * | filter | ||
) |
Removes given SoundFilter from the SoundEffect.
Definition at line 460 of file soundmanager.cpp.
References m_effectManager, and FIFE::SoundEffectManager::removeSoundFilterFromSoundEffect().
void FIFE::SoundManager::rewind | ( | ) |
Rewinds all SoundEmitters.
Definition at line 197 of file soundmanager.cpp.
References m_emitterVec, and FIFE::SoundEmitter::rewind().
void FIFE::SoundManager::rewind | ( | const std::string & | group | ) |
Rewinds all emitters of the group.
group | The group name. |
Definition at line 600 of file soundmanager.cpp.
References FIFE::_log, FL_WARN, and m_groups.
void FIFE::SoundManager::setDistanceModel | ( | SoundDistanceModelType | model | ) |
Sets the distance model.
Definition at line 207 of file soundmanager.cpp.
References isActive(), m_distanceModel, FIFE::SD_DISTANCE_EXPONENT, FIFE::SD_DISTANCE_EXPONENT_CLAMPED, FIFE::SD_DISTANCE_INVERSE, FIFE::SD_DISTANCE_INVERSE_CLAMPED, FIFE::SD_DISTANCE_LINEAR, FIFE::SD_DISTANCE_LINEAR_CLAMPED, and FIFE::SD_DISTANCE_NONE.
void FIFE::SoundManager::setDopplerFactor | ( | float | factor | ) |
Sets factor for doppler effect.
Definition at line 291 of file soundmanager.cpp.
References isActive().
|
private |
Sets the source handle.
emitter | The 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().
void FIFE::SoundManager::setGain | ( | const std::string & | group, |
float | gain | ||
) |
Sets gain for all emitters of the group.
group | The group name. |
gain | The gain value. |
Definition at line 612 of file soundmanager.cpp.
References FIFE::_log, FL_WARN, and m_groups.
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.
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.
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.
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.
void FIFE::SoundManager::setMaxGain | ( | const std::string & | group, |
float | gain | ||
) |
Sets max gain for all emitters of the group.
group | The group name. |
gain | The max gain value. |
Definition at line 624 of file soundmanager.cpp.
References FIFE::_log, FL_WARN, and m_groups.
void FIFE::SoundManager::setMinGain | ( | const std::string & | group, |
float | gain | ||
) |
Sets min gain for all emitters of the group.
group | The group name. |
gain | The min gain value. |
Definition at line 636 of file soundmanager.cpp.
References FIFE::_log, FL_WARN, and m_groups.
void FIFE::SoundManager::setVolume | ( | float | vol | ) |
Sets the Master Volume.
vol | The 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().
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().
void FIFE::SoundManager::stop | ( | const std::string & | group | ) |
Stops all emitters of the group.
group | The group name. |
Definition at line 588 of file soundmanager.cpp.
References FIFE::_log, FL_WARN, and m_groups.
void FIFE::SoundManager::unmute | ( | ) |
Unmutes to volume before mute() was called.
Definition at line 158 of file soundmanager.cpp.
References isActive(), and m_muteVol.
void FIFE::SoundManager::update | ( | ) |
Called once a frame and updates the sound objects.
Definition at line 314 of file soundmanager.cpp.
References getListenerPosition(), FIFE::SoundEmitter::getPosition(), FIFE::SoundEmitter::getSoundClip(), FIFE::SoundEmitter::isActive(), FIFE::SoundEmitter::isFinished(), FIFE::SoundEmitter::isPosition(), m_activeEmitters, m_emitterVec, m_freeSources, m_maxDistance, m_state, releaseSource(), FIFE::SoundEmitter::setCheckDifference(), setEmitterSource(), FIFE::SM_STATE_PLAY, FIFE::Math< T >::Sqrt(), FIFE::SoundEmitter::update(), FIFE::PointType3D< T >::x, FIFE::PointType3D< T >::y, and FIFE::PointType3D< T >::z.
Referenced by FIFE::Engine::pump().
|
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().
|
private |
OpenAL context.
Definition at line 377 of file soundmanager.h.
Referenced by getContext(), init(), and ~SoundManager().
|
private |
Maximal created sources, can be different to MAX_SOURCES.
Definition at line 394 of file soundmanager.h.
Referenced by init(), and ~SoundManager().
|
private |
OpenAL device.
Definition at line 379 of file soundmanager.h.
Referenced by init(), and ~SoundManager().
|
private |
Selected distance model.
Definition at line 387 of file soundmanager.h.
Referenced by getDistanceModel(), and setDistanceModel().
|
private |
Definition at line 400 of file soundmanager.h.
Referenced by activateEffect(), activateFilter(), addEmitterToDirectSoundFilter(), addEmitterToSoundEffect(), addSoundFilterToSoundEffect(), createSoundEffect(), createSoundEffectPreset(), createSoundFilter(), deactivateEffect(), deactivateFilter(), deleteSoundEffect(), deleteSoundFilter(), disableDirectSoundFilter(), disableSoundEffect(), enableDirectSoundFilter(), enableSoundEffect(), init(), removeEmitterFromDirectSoundFilter(), removeEmitterFromSoundEffect(), removeSoundFilterFromSoundEffect(), and ~SoundManager().
|
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().
|
private |
Holds free handles for sources.
Definition at line 396 of file soundmanager.h.
Referenced by init(), releaseSource(), setEmitterSource(), and update().
|
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().
|
private |
distance that removes a active Emitter
Definition at line 385 of file soundmanager.h.
Referenced by getListenerMaxDistance(), setListenerMaxDistance(), and update().
|
private |
volume before mute() was called
Definition at line 381 of file soundmanager.h.
Referenced by mute(), setVolume(), and unmute().
|
private |
Holds handles for sources.
Definition at line 392 of file soundmanager.h.
Referenced by init(), and ~SoundManager().
|
private |
State of the SoundManager.
Definition at line 389 of file soundmanager.h.
Referenced by init(), isActive(), pause(), play(), stop(), and update().
|
private |
volume to support setVolume-calls before initialization
Definition at line 383 of file soundmanager.h.
Referenced by getVolume(), init(), and setVolume().