X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fplaylist.h;fp=source%2Fplaylist.h;h=72226adf8e059ecf3a5aefffc81a4f2e718538e0;hb=d17577639d3842baa0e4bf9afcfd2b4a096dd01b;hp=0000000000000000000000000000000000000000;hpb=35b092aaa718dcb12933effd33324bda5d3b5cce;p=libs%2Fal.git diff --git a/source/playlist.h b/source/playlist.h new file mode 100644 index 0000000..72226ad --- /dev/null +++ b/source/playlist.h @@ -0,0 +1,56 @@ +#ifndef MSP_AL_PLAYLIST_H_ +#define MSP_AL_PLAYLIST_H_ + +#include +#include +#include + +namespace Msp { +namespace AL { + +class Playlist +{ +public: + class Loader: public DataFile::CollectionObjectLoader + { + public: + Loader(Playlist &); + Loader(Playlist &, Collection &); + private: + void init(); + + void track(const std::string &); + }; + +private: + struct Track + { + const DataFile::Collection *collection; + std::string filename; + + Track(); + Track(const std::string &); + }; + + bool shuffle; + std::vector tracks; + +public: + Playlist(); + + void add_track(const std::string &); + void remove_track(const std::string &); + void clear_tracks(); + void set_shuffle(bool); + const std::string &get_track(unsigned) const; + unsigned size() const { return tracks.size(); } + bool empty() const { return tracks.empty(); } + + unsigned advance(unsigned, int = 1) const; + IO::Seekable *open(unsigned) const; +}; + +} // namespace AL +} // namespace Msp + +#endif