FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::SoundEmitter Class Reference

The class for playing audio files. More...

#include <soundemitter.h>

+ Collaboration diagram for FIFE::SoundEmitter:

Classes

struct  internData
 buffers OpenAL data More...
 

Public Member Functions

 SoundEmitter (SoundManager *manager, uint32_t uid)
 
 ~SoundEmitter ()
 
void setSource (ALuint source)
 Sets openAl-source. More...
 
ALuint getSource () const
 Return openAl-source. More...
 
bool isActive () const
 Return if the Emitter is active / have an openAl-source. More...
 
void update ()
 Called once a frame from the SoundManager. More...
 
uint32_t getId () const
 Returns the emitter-id. More...
 
void setRelativePositioning (bool relative)
 Sets Positioning-Type Default is false. More...
 
bool isRelativePositioning () const
 Return Positioning-Type. More...
 
void setReferenceDistance (float distance)
 Sets the distance under which the volume for the SoundEmitter would normally drop by half (before being influenced by rolloff factor or max distance. More...
 
float getReferenceDistance () const
 Return the reference distance. More...
 
void setMaxDistance (float distance)
 Sets the max distance used with the Inverse Clamped Distance Model to set the distance where there will no longer be any attenuation of the source. More...
 
float getMaxDistance () const
 Return the max distance. More...
 
void setRolloff (float rolloff)
 Sets the AL_ROLEOFF_FACTOR. More...
 
float getRolloff () const
 Return the AL_ROLEOFF_FACTOR. More...
 
void setSoundClip (SoundClipPtr soundClip)
 Sets the sound clip to be used by this emitter. More...
 
SoundClipPtr getSoundClip ()
 Get the current sound clip used by this emitter. More...
 
void setSoundClip (const std::string &name)
 Sets the sound clip to be used by this emitter. More...
 
void reset (bool defaultall=false)
 Reset the emitter, free all internal buffers. More...
 
void release ()
 Releases the emitter. More...
 
void setLooping (bool loop)
 Sets the playing mode. More...
 
bool isLooping () const
 Return playing mode. More...
 
void play ()
 Plays the associated audio file. More...
 
void play (float inTime, float outTime)
 Plays the associated audio file with fade in and / or out. More...
 
void stop ()
 Stops playing the audio file and rewinds to the beginning. More...
 
void stop (float time)
 Stops playing the audio file after time with fade out. More...
 
void pause ()
 Pauses playing the audio file. More...
 
void rewind ()
 Rewinds the associated audio file. More...
 
void setGain (float gain)
 Sets the gain of the emitter. More...
 
float getGain () const
 Returns the gain of the emitter. More...
 
void setMaxGain (float gain)
 Sets the max. More...
 
float getMaxGain () const
 Returns the max. More...
 
void setMinGain (float gain)
 Sets the min. More...
 
float getMinGain () const
 Returns the min. More...
 
bool isStereo ()
 Tests if the audio data is stereo data or mono. More...
 
int16_t getBitResolution ()
 Returns the bit resolution. More...
 
uint64_t getSampleRate ()
 Returns the sample rate. More...
 
uint64_t getDecodedLength ()
 Returns the length of the decoded length in bytes. More...
 
uint64_t getDuration ()
 Returns the duration of the sound clip in milliseconds. More...
 
uint32_t getPlayTimestamp ()
 Returns timestamp of the last play start in milliseconds. More...
 
bool isFinished ()
 Returns true if clip is finished. More...
 
void setCursor (SoundPositionType type, float value)
 Sets the cursor position in the audio file. More...
 
float getCursor (SoundPositionType type)
 Returns the cursor position in the audio file. More...
 
void setPosition (const AudioSpaceCoordinate &position)
 Sets the position of the SoundEmitter in the virtual audio space. More...
 
AudioSpaceCoordinate getPosition () const
 Return the position of the SoundEmitter in the virtual audio space. More...
 
bool isPosition () const
 Return if it is a positional SoundEmitter. More...
 
void setDirection (const AudioSpaceCoordinate &direction)
 Sets the direction of the SoundEmitter in the virtual audio space. More...
 
AudioSpaceCoordinate getDirection () const
 Return the direction of the SoundEmitter in the virtual audio space. More...
 
void setPitch (float pitch)
 Sets pitch multiplier. More...
 
float getPitch () const
 Return pitch multiplier. More...
 
void setVelocity (const AudioSpaceCoordinate &velocity)
 Sets the velocity of the SoundEmitter in the virtual audio space. More...
 
AudioSpaceCoordinate getVelocity () const
 Return the velocity of the SoundEmitter in the virtual audio space. More...
 
void setConeInnerAngle (float inner)
 Sets inner angle of the sound cone, in degrees. More...
 
float getConeInnerAngle () const
 Return inner angle of the sound cone, in degrees. More...
 
void setConeOuterAngle (float outer)
 Sets outer angle of the sound cone, in degrees. More...
 
float getConeOuterAngle () const
 Return outer angle of the sound cone, in degrees. More...
 
void setConeOuterGain (float gain)
 Sets the gain when outside the oriented cone. More...
 
float getConeOuterGain () const
 Return the gain when outside the oriented cone. More...
 
SoundStateType getState ()
 Returns the state of the audio file. More...
 
void setGroup (const std::string &group)
 Sets the group name. More...
 
const std::string & getGroup ()
 Return the group name. More...
 
void addEffect (SoundEffect *effect)
 Adds effect. More...
 
void removeEffect (SoundEffect *effect)
 Removes effect. More...
 
uint8_t getEffectCount ()
 Return the number of effects. More...
 
uint8_t getEffectNumber (SoundEffect *effect)
 Return the number of the given effect. More...
 
void setDirectFilter (SoundFilter *filter)
 Sets the direct filter. More...
 
SoundFiltergetDirectFilter ()
 Return the direct filter. More...
 
void activateEffects ()
 Activates effects if the Emitter got the openAL-source. More...
 
void deactivateEffects ()
 Deactivates effects if the Emitter loses the openAL-source. More...
 
void setCheckDifference ()
 Sets the time difference between play and the first check if it's playable. More...
 
void addListener (SoundEmitterListener *listener)
 Adds new SoundEmitter listener. More...
 
void removeListener (SoundEmitterListener *listener)
 Removes associated SoundEmitter listener. More...
 

Private Member Functions

void attachSoundClip ()
 Internal function to attach a SoundClip to the source. More...
 
void detachSoundClip ()
 Internal function to detach a SoundClip from the source. More...
 
void syncData ()
 Updates OpenAL with collected data. More...
 
void checkFade ()
 Updates fade in and out. More...
 
void resetInternData ()
 Resets collected data to defaults. More...
 
void callOnSoundFinished ()
 Calls the Listeners if a sound finished. More...
 

Private Attributes

SoundManagerm_manager
 Access to the SoundManager. More...
 
ALuint m_source
 The openAL-source. More...
 
SoundFilterm_directFilter
 Applied direct sound filter. More...
 
SoundClipPtr m_soundClip
 The attached sound clip. More...
 
uint32_t m_soundClipId
 Id of the attached sound clip. More...
 
uint32_t m_streamId
 The id of the stream. More...
 
uint32_t m_emitterId
 The emitter-id. More...
 
struct FIFE::SoundEmitter::internData m_internData
 
std::string m_group
 the group name More...
 
float m_samplesOffset
 saves sample offset for played stream parts More...
 
bool m_active
 is active More...
 
bool m_fadeIn
 fade in clip More...
 
bool m_fadeOut
 fade out clip More...
 
float m_origGain
 original gain More...
 
uint32_t m_fadeInStartTimestamp
 fade in start time More...
 
uint32_t m_fadeInEndTimestamp
 fade in end time More...
 
uint32_t m_fadeOutStartTimestamp
 fade out start time More...
 
uint32_t m_fadeOutEndTimestamp
 fade out end time More...
 
uint32_t m_playCheckDifference
 time difference between play and first check More...
 
std::vector< SoundEffect * > m_effects
 holds pointer to applied SoundEffects More...
 
std::vector< SoundEmitterListener * > m_listeners
 listeners for sound related events More...
 

Detailed Description

The class for playing audio files.

Definition at line 70 of file soundemitter.h.

Constructor & Destructor Documentation

FIFE::SoundEmitter::SoundEmitter ( SoundManager manager,
uint32_t  uid 
)

Definition at line 44 of file soundemitter.cpp.

References FIFE::SoundManager::isActive(), m_manager, and resetInternData().

FIFE::SoundEmitter::~SoundEmitter ( )

Definition at line 71 of file soundemitter.cpp.

References FIFE::SoundManager::isActive(), m_manager, and reset().

Member Function Documentation

void FIFE::SoundEmitter::activateEffects ( )

Activates effects if the Emitter got the openAL-source.

Definition at line 853 of file soundemitter.cpp.

References FIFE::SoundManager::activateEffect(), FIFE::SoundManager::activateFilter(), m_directFilter, m_effects, and m_manager.

Referenced by setSource().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::addEffect ( SoundEffect effect)

Adds effect.

Used from SoundEffectManager.

Definition at line 801 of file soundemitter.cpp.

References m_effects.

Referenced by FIFE::SoundEffectManager::addEmitterToSoundEffect().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::addListener ( SoundEmitterListener listener)

Adds new SoundEmitter listener.

Parameters
listenerto add

Definition at line 881 of file soundemitter.cpp.

References m_listeners.

void FIFE::SoundEmitter::callOnSoundFinished ( )
private

Calls the Listeners if a sound finished.

Definition at line 898 of file soundemitter.cpp.

References m_emitterId, m_listeners, and m_soundClipId.

Referenced by stop().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::checkFade ( )
private
void FIFE::SoundEmitter::deactivateEffects ( )

Deactivates effects if the Emitter loses the openAL-source.

Definition at line 864 of file soundemitter.cpp.

References FIFE::SoundManager::deactivateEffect(), FIFE::SoundManager::deactivateFilter(), m_directFilter, m_effects, and m_manager.

Referenced by setSource().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::detachSoundClip ( )
private
int16_t FIFE::SoundEmitter::getBitResolution ( )

Returns the bit resolution.

Definition at line 454 of file soundemitter.cpp.

References FIFE::SoundDecoder::getBitResolution(), FIFE::SoundClip::getDecoder(), and m_soundClip.

Referenced by getCursor(), getDuration(), and setCursor().

+ Here is the caller graph for this function:

float FIFE::SoundEmitter::getConeInnerAngle ( ) const

Return inner angle of the sound cone, in degrees.

Definition at line 657 of file soundemitter.cpp.

References FIFE::SoundEmitter::internData::coneInnerAngle, and m_internData.

float FIFE::SoundEmitter::getConeOuterAngle ( ) const

Return outer angle of the sound cone, in degrees.

Definition at line 668 of file soundemitter.cpp.

References FIFE::SoundEmitter::internData::coneOuterAngle, and m_internData.

float FIFE::SoundEmitter::getConeOuterGain ( ) const

Return the gain when outside the oriented cone.

Definition at line 679 of file soundemitter.cpp.

References FIFE::SoundEmitter::internData::coneOuterGain, and m_internData.

float FIFE::SoundEmitter::getCursor ( SoundPositionType  type)

Returns the cursor position in the audio file.

Definition at line 563 of file soundemitter.cpp.

References FIFE::_log, CHECK_OPENAL_LOG, getBitResolution(), getSampleRate(), isActive(), isStereo(), FIFE::SoundClip::isStream(), FIFE::LogManager::LEVEL_ERROR, m_samplesOffset, m_soundClip, m_source, FIFE::SD_BYTE_POS, FIFE::SD_SAMPLE_POS, and FIFE::SD_TIME_POS.

Referenced by play().

+ Here is the caller graph for this function:

uint64_t FIFE::SoundEmitter::getDecodedLength ( )

Returns the length of the decoded length in bytes.

Definition at line 468 of file soundemitter.cpp.

References FIFE::SoundDecoder::getDecodedLength(), FIFE::SoundClip::getDecoder(), and m_soundClip.

Referenced by getDuration().

+ Here is the caller graph for this function:

SoundFilter * FIFE::SoundEmitter::getDirectFilter ( )

Return the direct filter.

Used from SoundEffectManager.

Definition at line 849 of file soundemitter.cpp.

References m_directFilter.

Referenced by FIFE::SoundEffectManager::addEmitterToDirectSoundFilter().

+ Here is the caller graph for this function:

AudioSpaceCoordinate FIFE::SoundEmitter::getDirection ( ) const

Return the direction of the SoundEmitter in the virtual audio space.

Definition at line 181 of file soundemitter.cpp.

References FIFE::SoundEmitter::internData::direction, and m_internData.

uint64_t FIFE::SoundEmitter::getDuration ( )

Returns the duration of the sound clip in milliseconds.

Definition at line 475 of file soundemitter.cpp.

References getBitResolution(), getDecodedLength(), getSampleRate(), isStereo(), and m_soundClip.

Referenced by isFinished(), play(), and syncData().

+ Here is the caller graph for this function:

uint8_t FIFE::SoundEmitter::getEffectCount ( )

Return the number of effects.

Used from SoundEffectManager.

Definition at line 824 of file soundemitter.cpp.

References m_effects.

Referenced by FIFE::SoundEffectManager::addEmitterToSoundEffect().

+ Here is the caller graph for this function:

uint8_t FIFE::SoundEmitter::getEffectNumber ( SoundEffect effect)

Return the number of the given effect.

Used from SoundEffectManager.

Definition at line 834 of file soundemitter.cpp.

References m_effects.

Referenced by FIFE::SoundEffectManager::activateEffect(), and FIFE::SoundEffectManager::deactivateEffect().

+ Here is the caller graph for this function:

float FIFE::SoundEmitter::getGain ( ) const

Returns the gain of the emitter.

Returns
The gain value. 0=silence ... 1.0=normal loudness.

Definition at line 421 of file soundemitter.cpp.

References m_internData, and FIFE::SoundEmitter::internData::volume.

const std::string & FIFE::SoundEmitter::getGroup ( )

Return the group name.

Definition at line 720 of file soundemitter.cpp.

References m_group.

Referenced by FIFE::SoundManager::addToGroup(), and FIFE::SoundManager::removeFromGroup().

+ Here is the caller graph for this function:

uint32_t FIFE::SoundEmitter::getId ( ) const

Returns the emitter-id.

Definition at line 158 of file soundemitter.cpp.

References m_emitterId.

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

+ Here is the caller graph for this function:

float FIFE::SoundEmitter::getMaxDistance ( ) const

Return the max distance.

Definition at line 635 of file soundemitter.cpp.

References m_internData, and FIFE::SoundEmitter::internData::maxDistance.

float FIFE::SoundEmitter::getMaxGain ( ) const

Returns the max.

gain of the emitter

Returns
The gain value. 0=silence ... 1.0=normal loudness.

Definition at line 432 of file soundemitter.cpp.

References m_internData, and FIFE::SoundEmitter::internData::maxVolume.

float FIFE::SoundEmitter::getMinGain ( ) const

Returns the min.

gain of the emitter

Returns
The gain value. 0=silence ... 1.0=normal loudness.

Definition at line 443 of file soundemitter.cpp.

References m_internData, and FIFE::SoundEmitter::internData::minVolume.

float FIFE::SoundEmitter::getPitch ( ) const

Return pitch multiplier.

Can only be positiv.

Definition at line 194 of file soundemitter.cpp.

References m_internData, and FIFE::SoundEmitter::internData::pitch.

uint32_t FIFE::SoundEmitter::getPlayTimestamp ( )

Returns timestamp of the last play start in milliseconds.

Definition at line 490 of file soundemitter.cpp.

References m_internData, and FIFE::SoundEmitter::internData::playTimestamp.

AudioSpaceCoordinate FIFE::SoundEmitter::getPosition ( ) const

Return the position of the SoundEmitter in the virtual audio space.

Definition at line 608 of file soundemitter.cpp.

References m_internData, and FIFE::SoundEmitter::internData::position.

Referenced by FIFE::SoundManager::update().

+ Here is the caller graph for this function:

float FIFE::SoundEmitter::getReferenceDistance ( ) const

Return the reference distance.

Definition at line 624 of file soundemitter.cpp.

References m_internData, and FIFE::SoundEmitter::internData::refDistance.

float FIFE::SoundEmitter::getRolloff ( ) const

Return the AL_ROLEOFF_FACTOR.

Rolloff factor judges the strength of attenuation over distance.

Definition at line 205 of file soundemitter.cpp.

References m_internData, and FIFE::SoundEmitter::internData::rolloff.

uint64_t FIFE::SoundEmitter::getSampleRate ( )

Returns the sample rate.

Definition at line 461 of file soundemitter.cpp.

References FIFE::SoundClip::getDecoder(), FIFE::SoundDecoder::getSampleRate(), and m_soundClip.

Referenced by getCursor(), getDuration(), and setCursor().

+ Here is the caller graph for this function:

SoundClipPtr FIFE::SoundEmitter::getSoundClip ( )

Get the current sound clip used by this emitter.

Returns
A SoundClipPtr of the sound clip.

Definition at line 274 of file soundemitter.cpp.

References m_soundClip.

Referenced by FIFE::SoundManager::update().

+ Here is the caller graph for this function:

ALuint FIFE::SoundEmitter::getSource ( ) const

Return openAl-source.

Definition at line 99 of file soundemitter.cpp.

References m_source.

Referenced by FIFE::SoundEffectManager::activateEffect(), FIFE::SoundEffectManager::activateFilter(), FIFE::SoundEffectManager::deactivateEffect(), and FIFE::SoundEffectManager::deactivateFilter().

+ Here is the caller graph for this function:

SoundStateType FIFE::SoundEmitter::getState ( )
AudioSpaceCoordinate FIFE::SoundEmitter::getVelocity ( ) const

Return the velocity of the SoundEmitter in the virtual audio space.

Definition at line 646 of file soundemitter.cpp.

References m_internData, and FIFE::SoundEmitter::internData::velocity.

bool FIFE::SoundEmitter::isFinished ( )
bool FIFE::SoundEmitter::isLooping ( ) const

Return playing mode.

Definition at line 339 of file soundemitter.cpp.

References FIFE::SoundEmitter::internData::loop, and m_internData.

Referenced by isFinished(), and FIFE::SoundSource::setActionAudio().

+ Here is the caller graph for this function:

bool FIFE::SoundEmitter::isPosition ( ) const

Return if it is a positional SoundEmitter.

Definition at line 612 of file soundemitter.cpp.

References FIFE::Math< T >::Equal(), m_internData, FIFE::SoundEmitter::internData::position, FIFE::PointType3D< T >::x, FIFE::PointType3D< T >::y, and FIFE::PointType3D< T >::z.

Referenced by FIFE::SoundManager::update().

+ Here is the caller graph for this function:

bool FIFE::SoundEmitter::isRelativePositioning ( ) const

Return Positioning-Type.

Definition at line 169 of file soundemitter.cpp.

References m_internData, and FIFE::SoundEmitter::internData::relative.

bool FIFE::SoundEmitter::isStereo ( )

Tests if the audio data is stereo data or mono.

Returns
Returns true if the audio data is stereo, false if mono.

Definition at line 447 of file soundemitter.cpp.

References FIFE::SoundClip::getDecoder(), FIFE::SoundDecoder::isStereo(), and m_soundClip.

Referenced by getCursor(), getDuration(), and setCursor().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::pause ( )

Pauses playing the audio file.

Definition at line 394 of file soundemitter.cpp.

References isActive(), m_internData, m_soundClip, m_source, FIFE::SD_PAUSED_STATE, and FIFE::SoundEmitter::internData::soundState.

Referenced by FIFE::SoundManager::pause().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::release ( )

Releases the emitter.

Definition at line 257 of file soundemitter.cpp.

References m_emitterId, m_manager, and FIFE::SoundManager::releaseEmitter().

void FIFE::SoundEmitter::removeEffect ( SoundEffect effect)

Removes effect.

Used from SoundEffectManager.

Definition at line 815 of file soundemitter.cpp.

References m_effects.

Referenced by FIFE::SoundEffectManager::removeEmitterFromSoundEffect().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::removeListener ( SoundEmitterListener listener)

Removes associated SoundEmitter listener.

Parameters
listenerto remove

Definition at line 885 of file soundemitter.cpp.

References FIFE::_log, FL_WARN, and m_listeners.

void FIFE::SoundEmitter::reset ( bool  defaultall = false)
void FIFE::SoundEmitter::rewind ( )

Rewinds the associated audio file.

Definition at line 401 of file soundemitter.cpp.

References isActive(), FIFE::SoundClip::isStream(), m_internData, m_samplesOffset, m_soundClip, m_source, FIFE::SoundEmitter::internData::playTimestamp, FIFE::SD_BYTE_POS, and setCursor().

Referenced by FIFE::SoundManager::rewind(), FIFE::SoundSource::setActionAudio(), and stop().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setCheckDifference ( )

Sets the time difference between play and the first check if it's playable.

Definition at line 875 of file soundemitter.cpp.

References getState(), FIFE::TimeManager::getTime(), FIFE::DynamicSingleton< TimeManager >::instance(), m_internData, m_playCheckDifference, FIFE::SoundEmitter::internData::playTimestamp, and FIFE::SD_PLAYING_STATE.

Referenced by FIFE::SoundManager::update().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setConeInnerAngle ( float  inner)

Sets inner angle of the sound cone, in degrees.

Default 360

Definition at line 650 of file soundemitter.cpp.

References FIFE::SoundEmitter::internData::coneInnerAngle, isActive(), m_internData, and m_source.

Referenced by syncData(), and FIFE::SoundSource::updateSoundEmitter().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setConeOuterAngle ( float  outer)

Sets outer angle of the sound cone, in degrees.

Default 360

Definition at line 661 of file soundemitter.cpp.

References FIFE::SoundEmitter::internData::coneOuterAngle, isActive(), m_internData, and m_source.

Referenced by syncData(), and FIFE::SoundSource::updateSoundEmitter().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setConeOuterGain ( float  gain)

Sets the gain when outside the oriented cone.

Definition at line 672 of file soundemitter.cpp.

References FIFE::SoundEmitter::internData::coneOuterGain, isActive(), m_internData, and m_source.

Referenced by syncData(), and FIFE::SoundSource::updateSoundEmitter().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setDirectFilter ( SoundFilter filter)

Sets the direct filter.

Used from SoundEffectManager.

Definition at line 845 of file soundemitter.cpp.

References m_directFilter.

Referenced by FIFE::SoundEffectManager::addEmitterToDirectSoundFilter(), and FIFE::SoundEffectManager::removeEmitterFromDirectSoundFilter().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setDirection ( const AudioSpaceCoordinate direction)

Sets the direction of the SoundEmitter in the virtual audio space.

Definition at line 173 of file soundemitter.cpp.

References FIFE::SoundEmitter::internData::direction, isActive(), m_internData, m_source, FIFE::PointType3D< T >::x, FIFE::PointType3D< T >::y, and FIFE::PointType3D< T >::z.

Referenced by FIFE::SoundSource::setDirection(), and syncData().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setGain ( float  gain)

Sets the gain of the emitter.

Parameters
gainThe gain value. 0=silence ... 1.0=normal loudness.

Definition at line 414 of file soundemitter.cpp.

References isActive(), m_internData, m_source, and FIFE::SoundEmitter::internData::volume.

Referenced by checkFade(), play(), syncData(), and FIFE::SoundSource::updateSoundEmitter().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setGroup ( const std::string &  group)

Sets the group name.

Adds the emitter automatically to the group.

Definition at line 708 of file soundemitter.cpp.

References FIFE::SoundManager::addToGroup(), m_group, m_manager, and FIFE::SoundManager::removeFromGroup().

Referenced by FIFE::SoundSource::updateSoundEmitter().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setLooping ( bool  loop)

Sets the playing mode.

Definition at line 328 of file soundemitter.cpp.

References isActive(), FIFE::SoundClip::isStream(), FIFE::SoundEmitter::internData::loop, m_internData, m_soundClip, and m_source.

Referenced by syncData(), and FIFE::SoundSource::updateSoundEmitter().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setMaxDistance ( float  distance)

Sets the max distance used with the Inverse Clamped Distance Model to set the distance where there will no longer be any attenuation of the source.

Definition at line 628 of file soundemitter.cpp.

References utf8::distance(), isActive(), m_internData, m_source, and FIFE::SoundEmitter::internData::maxDistance.

Referenced by syncData(), and FIFE::SoundSource::updateSoundEmitter().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setMaxGain ( float  gain)

Sets the max.

gain of the emitter

Parameters
gainThe gain value. 0=silence ... 1.0=normal loudness.

Definition at line 425 of file soundemitter.cpp.

References isActive(), m_internData, m_source, and FIFE::SoundEmitter::internData::maxVolume.

Referenced by syncData(), and FIFE::SoundSource::updateSoundEmitter().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setMinGain ( float  gain)

Sets the min.

gain of the emitter

Parameters
gainThe gain value. 0=silence ... 1.0=normal loudness.

Definition at line 436 of file soundemitter.cpp.

References isActive(), m_internData, m_source, and FIFE::SoundEmitter::internData::minVolume.

Referenced by syncData(), and FIFE::SoundSource::updateSoundEmitter().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setPitch ( float  pitch)

Sets pitch multiplier.

Can only be positiv.

Definition at line 185 of file soundemitter.cpp.

References isActive(), m_internData, m_source, and FIFE::SoundEmitter::internData::pitch.

Referenced by syncData(), and FIFE::SoundSource::updateSoundEmitter().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setPosition ( const AudioSpaceCoordinate position)

Sets the position of the SoundEmitter in the virtual audio space.

Definition at line 601 of file soundemitter.cpp.

References isActive(), m_internData, m_source, FIFE::SoundEmitter::internData::position, FIFE::PointType3D< T >::x, FIFE::PointType3D< T >::y, and FIFE::PointType3D< T >::z.

Referenced by FIFE::SoundSource::setPosition(), syncData(), and FIFE::SoundSource::updateSoundEmitter().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setReferenceDistance ( float  distance)

Sets the distance under which the volume for the SoundEmitter would normally drop by half (before being influenced by rolloff factor or max distance.

Default 1.0

Definition at line 617 of file soundemitter.cpp.

References utf8::distance(), isActive(), m_internData, m_source, and FIFE::SoundEmitter::internData::refDistance.

Referenced by syncData(), and FIFE::SoundSource::updateSoundEmitter().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setRelativePositioning ( bool  relative)

Sets Positioning-Type Default is false.

Parameters
relativeIf set to true, the emitters position will be interpreted relative to the listener object

Definition at line 162 of file soundemitter.cpp.

References isActive(), m_internData, m_source, and FIFE::SoundEmitter::internData::relative.

Referenced by syncData(), and FIFE::SoundSource::updateSoundEmitter().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setRolloff ( float  rolloff)

Sets the AL_ROLEOFF_FACTOR.

Rolloff factor judges the strength of attenuation over distance.

Parameters
rolloffRolloff factor. You'll need to do a lot of testing to find a value which suits your needs. Default 1.0

Definition at line 198 of file soundemitter.cpp.

References isActive(), m_internData, m_source, and FIFE::SoundEmitter::internData::rolloff.

Referenced by syncData(), and FIFE::SoundSource::updateSoundEmitter().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setSoundClip ( SoundClipPtr  soundClip)

Sets the sound clip to be used by this emitter.

Parameters
soundClipSoundClipPtr of the sound to be used.

Definition at line 261 of file soundemitter.cpp.

References attachSoundClip(), detachSoundClip(), FIFE::IResource::getHandle(), m_soundClip, and m_soundClipId.

Referenced by FIFE::SoundManager::createEmitter(), setSoundClip(), and FIFE::SoundSource::updateSoundEmitter().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setSoundClip ( const std::string &  name)

Sets the sound clip to be used by this emitter.

Parameters
nameThe name of the sound to be used.

Definition at line 278 of file soundemitter.cpp.

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

void FIFE::SoundEmitter::setSource ( ALuint  source)

Sets openAl-source.

Definition at line 79 of file soundemitter.cpp.

References activateEffects(), deactivateEffects(), m_active, m_source, and syncData().

Referenced by FIFE::SoundManager::releaseSource(), and FIFE::SoundManager::setEmitterSource().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::setVelocity ( const AudioSpaceCoordinate velocity)

Sets the velocity of the SoundEmitter in the virtual audio space.

Definition at line 639 of file soundemitter.cpp.

References isActive(), m_internData, m_source, FIFE::SoundEmitter::internData::velocity, FIFE::PointType3D< T >::x, FIFE::PointType3D< T >::y, and FIFE::PointType3D< T >::z.

Referenced by syncData(), and FIFE::SoundSource::updateSoundEmitter().

+ Here is the caller graph for this function:

void FIFE::SoundEmitter::stop ( )
void FIFE::SoundEmitter::stop ( float  time)

Member Data Documentation

bool FIFE::SoundEmitter::m_active
private

is active

Definition at line 451 of file soundemitter.h.

Referenced by isActive(), and setSource().

SoundFilter* FIFE::SoundEmitter::m_directFilter
private

Applied direct sound filter.

Definition at line 415 of file soundemitter.h.

Referenced by activateEffects(), deactivateEffects(), getDirectFilter(), reset(), and setDirectFilter().

std::vector<SoundEffect*> FIFE::SoundEmitter::m_effects
private

holds pointer to applied SoundEffects

Definition at line 469 of file soundemitter.h.

Referenced by activateEffects(), addEffect(), deactivateEffects(), getEffectCount(), getEffectNumber(), removeEffect(), and reset().

uint32_t FIFE::SoundEmitter::m_emitterId
private

The emitter-id.

Definition at line 423 of file soundemitter.h.

Referenced by callOnSoundFinished(), getId(), and release().

bool FIFE::SoundEmitter::m_fadeIn
private

fade in clip

Definition at line 453 of file soundemitter.h.

Referenced by checkFade(), play(), reset(), and update().

uint32_t FIFE::SoundEmitter::m_fadeInEndTimestamp
private

fade in end time

Definition at line 461 of file soundemitter.h.

Referenced by checkFade(), and play().

uint32_t FIFE::SoundEmitter::m_fadeInStartTimestamp
private

fade in start time

Definition at line 459 of file soundemitter.h.

Referenced by checkFade(), and play().

bool FIFE::SoundEmitter::m_fadeOut
private

fade out clip

Definition at line 455 of file soundemitter.h.

Referenced by checkFade(), play(), reset(), stop(), and update().

uint32_t FIFE::SoundEmitter::m_fadeOutEndTimestamp
private

fade out end time

Definition at line 465 of file soundemitter.h.

Referenced by checkFade(), play(), and stop().

uint32_t FIFE::SoundEmitter::m_fadeOutStartTimestamp
private

fade out start time

Definition at line 463 of file soundemitter.h.

Referenced by checkFade(), play(), and stop().

std::string FIFE::SoundEmitter::m_group
private

the group name

Definition at line 447 of file soundemitter.h.

Referenced by getGroup(), reset(), and setGroup().

std::vector<SoundEmitterListener*> FIFE::SoundEmitter::m_listeners
private

listeners for sound related events

Definition at line 471 of file soundemitter.h.

Referenced by addListener(), callOnSoundFinished(), and removeListener().

SoundManager* FIFE::SoundEmitter::m_manager
private
float FIFE::SoundEmitter::m_origGain
private

original gain

Definition at line 457 of file soundemitter.h.

Referenced by checkFade(), play(), reset(), and stop().

uint32_t FIFE::SoundEmitter::m_playCheckDifference
private

time difference between play and first check

Definition at line 467 of file soundemitter.h.

Referenced by isFinished(), play(), setCheckDifference(), and syncData().

float FIFE::SoundEmitter::m_samplesOffset
private

saves sample offset for played stream parts

Definition at line 449 of file soundemitter.h.

Referenced by getCursor(), reset(), rewind(), setCursor(), and update().

uint32_t FIFE::SoundEmitter::m_soundClipId
private

Id of the attached sound clip.

Definition at line 419 of file soundemitter.h.

Referenced by callOnSoundFinished(), detachSoundClip(), reset(), and setSoundClip().

uint32_t FIFE::SoundEmitter::m_streamId
private

The id of the stream.

Definition at line 421 of file soundemitter.h.

Referenced by attachSoundClip(), detachSoundClip(), reset(), setCursor(), and update().


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