1 #ifndef __STREAM_SOUND_SOURCE_H__
2 #define __STREAM_SOUND_SOURCE_H__
6 #include "sound_source.hpp"
10 class StreamSoundSource : public SoundSource
13 StreamSoundSource(SoundFile* file);
14 virtual ~StreamSoundSource();
16 enum FadeState { NoFading, FadingOn, FadingOff };
18 void setFading(FadeState state, float fadetime);
22 static const size_t STREAMBUFFERSIZE = 1024 * 500;
23 static const size_t STREAMFRAGMENTS = 5;
24 static const size_t STREAMFRAGMENTSIZE
25 = STREAMBUFFERSIZE / STREAMFRAGMENTS;
27 void fillBufferAndQueue(ALuint buffer);
29 ALuint buffers[STREAMFRAGMENTS];
33 Uint32 fade_start_ticks;