]> git.tdb.fi Git - libs/al.git/blobdiff - source/jukebox.h
Make sound format support optional
[libs/al.git] / source / jukebox.h
index 2b4e0cdf7c6d1667db823b1973a521535d082321..ea19723451649aa8ad0374b4ad19515318fba065 100644 (file)
@@ -1,45 +1,44 @@
-/* $Id$
-
-This file is part of libmspal
-Copyright © 2009  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_AL_JUKEBOX_H_
 #define MSP_AL_JUKEBOX_H_
 
 #include <list>
 #include <string>
+#include <sigc++/signal.h>
+#include <msp/io/seekable.h>
 #include "source.h"
 #include "streamer.h"
 
 namespace Msp {
 namespace AL {
 
-class Sound;
+class Playlist;
+class SoundDecoder;
 
 class Jukebox
 {
+public:
+       sigc::signal<void, unsigned> signal_track_changed;
+
 private:
        Source source;
        Streamer streamer;
-       Sound *sound;
-       std::list<std::string> tracks;
-       std::list<std::string>::iterator current_track;
-       bool shuffle;
+       IO::Seekable *in;
+       SoundDecoder *decoder;
+       const Playlist *playlist;
+       unsigned current;
 
 public:
        Jukebox();
        ~Jukebox();
 
        Source &get_source() { return source; }
-       void add_track(const std::string &);
-       void remove_track(const std::string &);
-       void clear_tracks();
-       void set_shuffle(bool);
+       void set_playlist(const Playlist *);
+       const Playlist *get_playlist() const { return playlist; }
+       unsigned get_current_track() const { return current; }
 
        void play();
        void next();
+       void previous();
        void stop();
        void tick();
 };