1 #ifndef __STREAM_SOUND_SOURCE_H__
2 #define __STREAM_SOUND_SOURCE_H__
6 #include "sound_source.hpp"
10 class StreamSoundSource : public SoundSource
14 virtual ~StreamSoundSource();
16 void set_sound_file(SoundFile* file);
18 enum FadeState { NoFading, FadingOn, FadingOff };
20 void set_fading(FadeState state, float fadetime);
21 FadeState get_fade_state() const
27 void set_looping(bool looping)
29 this->looping = looping;
31 bool get_looping() const
37 static const size_t STREAMBUFFERSIZE = 1024 * 500;
38 static const size_t STREAMFRAGMENTS = 5;
39 static const size_t STREAMFRAGMENTSIZE
40 = STREAMBUFFERSIZE / STREAMFRAGMENTS;
42 bool fillBufferAndQueue(ALuint buffer);
44 ALuint buffers[STREAMFRAGMENTS];
47 Uint32 fade_start_ticks;