]> git.tdb.fi Git - libs/al.git/blob - source/jukebox.h
Externalize playlist management from Jukebox
[libs/al.git] / source / jukebox.h
1 #ifndef MSP_AL_JUKEBOX_H_
2 #define MSP_AL_JUKEBOX_H_
3
4 #include <list>
5 #include <string>
6 #include <sigc++/signal.h>
7 #include <msp/io/seekable.h>
8 #include "source.h"
9 #include "streamer.h"
10
11 namespace Msp {
12 namespace AL {
13
14 class Playlist;
15 class SoundDecoder;
16
17 class Jukebox
18 {
19 public:
20         sigc::signal<void, unsigned> signal_track_changed;
21
22 private:
23         Source source;
24         Streamer streamer;
25         IO::Seekable *in;
26         SoundDecoder *decoder;
27         const Playlist *playlist;
28         unsigned current;
29
30 public:
31         Jukebox();
32         ~Jukebox();
33
34         Source &get_source() { return source; }
35         void set_playlist(const Playlist *);
36         const Playlist *get_playlist() const { return playlist; }
37         unsigned get_current_track() const { return current; }
38
39         void play();
40         void next();
41         void previous();
42         void stop();
43         void tick();
44 };
45
46 } // namespace AL
47 } // namespace Msp
48
49 #endif