]> git.tdb.fi Git - libs/al.git/blob - source/streamer.h
Split Sound into SoundDecoder and Waveform parts
[libs/al.git] / source / streamer.h
1 #ifndef MSP_AL_STREAMER_H_
2 #define MSP_AL_STREAMER_H_
3
4 #include <list>
5 #include "source.h"
6
7 namespace Msp {
8 namespace AL {
9
10 class SoundDecoder;
11 class Buffer;
12
13 /**
14 A streamer transfers data from a SoundDecoder to a Source.  It is permanently
15 attached to the same Source, but can read from multiple decoders during its
16 lifetime.
17 */
18 class Streamer
19 {
20 private:
21         Source &src;
22         SoundDecoder *decoder;
23         std::list<Buffer *> buffers;
24
25 public:
26         Streamer(Source &);
27         ~Streamer();
28
29         void play(SoundDecoder &);
30         void stop();
31         void tick();
32 };
33
34 } // namespace AL
35 } // namespace Msp
36
37 #endif