]> git.tdb.fi Git - libs/al.git/blob - source/streamer.h
7843e9e8a0497e265bda373c55a557e99fa2f4a0
[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 Sound;
11 class Buffer;
12
13 /**
14 A streamer transfers data from a Sound to a Source.  It is permanently attached
15 to the same Source, but can play multiple Sounds during its lifetime.  A single
16 Sound can only be played by one Streamer at a time.
17 */
18 class Streamer
19 {
20 private:
21         Source &src;
22         Sound *snd;
23         std::list<Buffer *> buffers;
24
25 public:
26         Streamer(Source &);
27         ~Streamer();
28
29         void play(Sound &);
30         void stop();
31         void tick();
32 };
33
34 } // namespace AL
35 } // namespace Msp
36
37 #endif