FIFE
2008.0
|
#include <soundemitter.h>
Public Member Functions | |
unsigned int | getId () const |
void | setPositioning (bool relative) |
void | setRolloff (float rolloff) |
void | setSoundClip (unsigned int sound_id) |
void | setCallback (const type_callback &cb) |
void | reset (bool defaultall=false) |
void | release () |
void | setLooping (bool loop) |
void | play () |
void | stop () |
void | pause () |
void | setGain (float gain) |
float | getGain () |
bool | isStereo () const |
short | getBitResolution () const |
unsigned long | getSampleRate () const |
unsigned long | getDecodedLength () const |
unsigned long | getDuration () const |
void | setCursor (SoundPositionType type, float value) |
float | getCursor (SoundPositionType type) |
void | setPosition (float x, float y, float z) |
void | setVelocity (float x, float y, float z) |
The class for playing audio files
Definition at line 48 of file soundemitter.h.
short FIFE::SoundEmitter::getBitResolution | ( | ) | const [inline] |
Returns the bit resolution
Definition at line 152 of file soundemitter.h.
References FIFE::SoundClip::getDecoder().
Referenced by getDuration().
float FIFE::SoundEmitter::getCursor | ( | SoundPositionType | type | ) |
Returns the cursor position in the audio file
Definition at line 246 of file soundemitter.cpp.
References FIFE::SoundClip::getStreamPos(), and FIFE::SoundClip::isStream().
unsigned long FIFE::SoundEmitter::getDecodedLength | ( | ) | const [inline] |
Returns the length of the decoded length in bytes
Definition at line 170 of file soundemitter.h.
References FIFE::SoundClip::getDecoder().
Referenced by getDuration().
unsigned long FIFE::SoundEmitter::getDuration | ( | ) | const [inline] |
Returns the duration of the sound clip in milliseconds
Definition at line 180 of file soundemitter.h.
References getBitResolution(), getDecodedLength(), getSampleRate(), and isStereo().
float FIFE::SoundEmitter::getGain | ( | ) | [inline] |
Returns the gain of the emitter
Definition at line 133 of file soundemitter.h.
unsigned int FIFE::SoundEmitter::getId | ( | ) | const [inline] |
Returns the emitter-id
Definition at line 57 of file soundemitter.h.
unsigned long FIFE::SoundEmitter::getSampleRate | ( | ) | const [inline] |
Returns the sample rate
Definition at line 161 of file soundemitter.h.
References FIFE::SoundClip::getDecoder().
Referenced by getDuration().
bool FIFE::SoundEmitter::isStereo | ( | ) | const [inline] |
Tests if the audio data is stereo data or mono.
Definition at line 143 of file soundemitter.h.
References FIFE::SoundClip::getDecoder().
Referenced by getDuration().
void FIFE::SoundEmitter::pause | ( | ) | [inline] |
Pauses playing the audio file
Definition at line 115 of file soundemitter.h.
void FIFE::SoundEmitter::play | ( | ) |
Plays the associated audio file.
Definition at line 176 of file soundemitter.cpp.
References FIFE::SoundClip::isStream(), and FIFE::TimeEvent::setPeriod().
void FIFE::SoundEmitter::release | ( | ) |
Releases the emitter
Definition at line 94 of file soundemitter.cpp.
void FIFE::SoundEmitter::reset | ( | bool | defaultall = false | ) |
Reset the emitter, free all internal buffers
defaultall | If set to true, emitter position, velocity, gain and type will be set to the default values |
Definition at line 65 of file soundemitter.cpp.
References FIFE::SoundClip::isStream(), FIFE::SoundClip::quitStreaming(), FIFE::Pool::release(), setGain(), FIFE::TimeEvent::setPeriod(), setPosition(), setPositioning(), and setVelocity().
void FIFE::SoundEmitter::setCallback | ( | const type_callback & | cb | ) |
Sets the callback to use when the STREAM has finished being played. NOTE: This only works with streaming audio.
cb | function callback |
Definition at line 106 of file soundemitter.cpp.
void FIFE::SoundEmitter::setCursor | ( | SoundPositionType | type, |
float | value | ||
) |
Sets the cursor position in the audio file
Definition at line 198 of file soundemitter.cpp.
References FIFE::SoundClip::acquireStream(), FIFE::SoundClip::getBuffers(), FIFE::SoundClip::isStream(), FIFE::TimeEvent::setPeriod(), and FIFE::SoundClip::setStreamPos().
Referenced by stop().
void FIFE::SoundEmitter::setGain | ( | float | gain | ) | [inline] |
Sets the gain of the emitter
gain | The gain value. 0=silence ... 1.0=normal loudness. |
Definition at line 125 of file soundemitter.h.
Referenced by reset().
void FIFE::SoundEmitter::setLooping | ( | bool | loop | ) |
Sets the playing mode
Definition at line 165 of file soundemitter.cpp.
References FIFE::SoundClip::isStream().
void FIFE::SoundEmitter::setPosition | ( | float | x, |
float | y, | ||
float | z | ||
) | [inline] |
Sets the position of the SoundEmitter in the virtual audio space.
Definition at line 203 of file soundemitter.h.
Referenced by reset().
void FIFE::SoundEmitter::setPositioning | ( | bool | relative | ) | [inline] |
Sets Positioning-Type Default is false
relative | If set to true, the emitters position will be interpreted relative to the listener object |
Definition at line 67 of file soundemitter.h.
Referenced by reset().
void FIFE::SoundEmitter::setRolloff | ( | float | rolloff | ) | [inline] |
Sets the AL_ROLEOFF_FACTOR. Rolloff factor judges the strength of attenuation over distance.
rolloff | Rolloff factor. You'll need to do a lot of testing to find a value which suits your needs. |
Definition at line 75 of file soundemitter.h.
void FIFE::SoundEmitter::setSoundClip | ( | unsigned int | sound_id | ) |
Sets the sound clip to be used by this emitter.
sound_id | SoundClipPool id of the sound to be used. |
Definition at line 98 of file soundemitter.cpp.
References FIFE::FifeClass::addRef().
void FIFE::SoundEmitter::setVelocity | ( | float | x, |
float | y, | ||
float | z | ||
) | [inline] |
Sets the velocity of the SoundEmitter in the virtual audio space.
Definition at line 209 of file soundemitter.h.
Referenced by reset().
void FIFE::SoundEmitter::stop | ( | ) |
Stops playing the audio file and rewinds to the beginning
Definition at line 185 of file soundemitter.cpp.
References FIFE::SoundClip::isStream(), setCursor(), and FIFE::TimeEvent::setPeriod().