renamed all .h to .hpp
[supertux.git] / src / audio / stream_sound_source.hpp
1 #ifndef __STREAM_SOUND_SOURCE_H__
2 #define __STREAM_SOUND_SOURCE_H__
3
4 #include <stdio.h>
5 #include "sound_source.hpp"
6
7 class SoundFile;
8
9 class StreamSoundSource : public SoundSource
10 {
11 public:
12   StreamSoundSource(SoundFile* file);
13   virtual ~StreamSoundSource();
14
15   void update();
16   
17 private:
18   static const size_t STREAMBUFFERSIZE = 1024 * 500;
19   static const size_t STREAMFRAGMENTS = 5;
20   static const size_t STREAMFRAGMENTSIZE 
21     = STREAMBUFFERSIZE / STREAMFRAGMENTS;
22
23   void fillBufferAndQueue(ALuint buffer);
24   SoundFile* file;
25   ALuint buffers[STREAMFRAGMENTS];
26   ALenum format;
27
28   enum FadeState { NoFading, FadingOn, FadingOff };
29   FadeState fade_state;
30   // TODO
31 };
32
33 #endif
34