22 #ifndef FIFE_SOUNDEMITTER_H_
23 #define FIFE_SOUNDEMITTER_H_
30 #include <boost/function.hpp>
36 #include "vfs/raw/rawdata.h"
37 #include "util/time/timeevent.h"
39 #include "soundclip.h"
50 typedef boost::function0<void> type_callback;
68 alSourcei(m_source, AL_SOURCE_RELATIVE, relative ? AL_TRUE : AL_FALSE);
76 alSourcef (m_source, AL_ROLLOFF_FACTOR, rolloff);
95 void reset(
bool defaultall =
false);
117 alSourcePause(m_source);
126 alSourcef(m_source, AL_GAIN, gain);
135 alGetSourcef(m_source, AL_GAIN, &tmp);
154 return m_soundclip->
getDecoder()->getBitResolution();
163 return m_soundclip->
getDecoder()->getSampleRate();
172 return m_soundclip->
getDecoder()->getDecodedLength();
182 double samplerate =
static_cast<double>(
getSampleRate()) / 1000.0;
185 double stereo = (
isStereo() ? 2.0 : 1.0);
186 double time = ( size / (samplerate * bitres) ) / stereo;
188 return static_cast<unsigned long>(time);
204 alSource3f(m_source, AL_POSITION, x, y, z);
210 alSource3f(m_source, AL_VELOCITY, x, y, z);
216 virtual void updateEvent(
unsigned long time);
220 void attachSoundClip();
222 SoundManager* m_manager;
226 unsigned int m_soundclipid;
227 unsigned int m_streamid;
228 unsigned int m_emitterid;
230 type_callback m_callback;