diff options
Diffstat (limited to 'src/Playlist.hxx')
-rw-r--r-- | src/Playlist.hxx | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/Playlist.hxx b/src/Playlist.hxx index 7d7e9b154..09980155e 100644 --- a/src/Playlist.hxx +++ b/src/Playlist.hxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2013 The Music Player Daemon Project + * Copyright (C) 2003-2014 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -20,11 +20,15 @@ #ifndef MPD_PLAYLIST_HXX #define MPD_PLAYLIST_HXX -#include "Queue.hxx" +#include "queue/Queue.hxx" #include "PlaylistError.hxx" +enum TagType : uint8_t; struct PlayerControl; -struct Song; +class DetachedSong; +class Database; +class Error; +class SongLoader; struct playlist { /** @@ -98,7 +102,7 @@ struct playlist { * none if there is none (yet?) or if MPD isn't playing. */ gcc_pure - const Song *GetQueuedSong() const; + const DetachedSong *GetQueuedSong() const; /** * This is the "PLAYLIST" event handler. It is invoked by the @@ -123,7 +127,7 @@ protected: * @param prev the song which was previously queued, as * determined by playlist_get_queued_song() */ - void UpdateQueuedSong(PlayerControl &pc, const Song *prev); + void UpdateQueuedSong(PlayerControl &pc, const DetachedSong *prev); public: void Clear(PlayerControl &pc); @@ -133,34 +137,27 @@ public: * thread. Apply the given song's tag to the current song if * the song matches. */ - void TagModified(Song &&song); + void TagModified(DetachedSong &&song); +#ifdef ENABLE_DATABASE /** * The database has been modified. Pull all updates. */ - void DatabaseModified(); + void DatabaseModified(const Database &db); +#endif PlaylistResult AppendSong(PlayerControl &pc, - Song *song, - unsigned *added_id=nullptr); - - /** - * Appends a local file (outside the music database) to the - * playlist. - * - * Note: the caller is responsible for checking permissions. - */ - PlaylistResult AppendFile(PlayerControl &pc, - const char *path_utf8, + DetachedSong &&song, unsigned *added_id=nullptr); PlaylistResult AppendURI(PlayerControl &pc, + const SongLoader &loader, const char *uri_utf8, unsigned *added_id=nullptr); protected: void DeleteInternal(PlayerControl &pc, - unsigned song, const Song **queued_p); + unsigned song, const DetachedSong **queued_p); public: PlaylistResult DeletePosition(PlayerControl &pc, @@ -182,7 +179,7 @@ public: PlaylistResult DeleteRange(PlayerControl &pc, unsigned start, unsigned end); - void DeleteSong(PlayerControl &pc, const Song &song); + void DeleteSong(PlayerControl &pc, const char *uri); void Shuffle(PlayerControl &pc, unsigned start, unsigned end); @@ -205,6 +202,10 @@ public: PlaylistResult SetPriorityId(PlayerControl &pc, unsigned song_id, uint8_t priority); + bool AddSongIdTag(unsigned id, TagType tag_type, const char *value, + Error &error); + bool ClearSongIdTag(unsigned id, TagType tag_type, Error &error); + void Stop(PlayerControl &pc); PlaylistResult PlayPosition(PlayerControl &pc, int position); |