]> git.tdb.fi Git - libs/al.git/blob - source/jukebox.h
Fix some uninitialized variables and memory leaks
[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 "source.h"
14 #include "streamer.h"
15
16 namespace Msp {
17 namespace AL {
18
19 class Sound;
20
21 class Jukebox
22 {
23 private:
24         Source source;
25         Streamer streamer;
26         Sound *sound;
27         std::list<std::string> tracks;
28         std::list<std::string>::iterator current_track;
29         bool shuffle;
30
31 public:
32         Jukebox();
33         ~Jukebox();
34
35         Source &get_source() { return source; }
36         void add_track(const std::string &);
37         void remove_track(const std::string &);
38         void clear_tracks();
39         void set_shuffle(bool);
40
41         void play();
42         void next();
43         void stop();
44         void tick();
45 };
46
47 } // namespace AL
48 } // namespace Msp
49
50 #endif