]> git.tdb.fi Git - libs/al.git/blob - source/jukebox.h
Add a previous() method to Jukebox
[libs/al.git] / source / jukebox.h
1 /* $Id$
2
3 This file is part of libmspal
4 Copyright © 2009  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_AL_JUKEBOX_H_
9 #define MSP_AL_JUKEBOX_H_
10
11 #include <list>
12 #include <string>
13 #include <sigc++/signal.h>
14 #include "source.h"
15 #include "streamer.h"
16
17 namespace Msp {
18 namespace AL {
19
20 class Sound;
21
22 class Jukebox
23 {
24 public:
25         sigc::signal<void, const std::string &> signal_track_changed;
26
27 private:
28         Source source;
29         Streamer streamer;
30         Sound *sound;
31         std::list<std::string> tracks;
32         std::list<std::string>::iterator current_track;
33         bool shuffle;
34
35 public:
36         Jukebox();
37         ~Jukebox();
38
39         Source &get_source() { return source; }
40         void add_track(const std::string &);
41         void remove_track(const std::string &);
42         void clear_tracks();
43         const std::string &get_current_track() const;
44         void set_shuffle(bool);
45
46         void play();
47         void next();
48         void previous();
49         void stop();
50         void tick();
51 };
52
53 } // namespace AL
54 } // namespace Msp
55
56 #endif