20 #ifndef MPD_PLAYLIST_HXX
21 #define MPD_PLAYLIST_HXX
97 current(-1), queued(-1) {
196 #ifdef ENABLE_DATABASE
200 void DatabaseModified(
const Database &db);
217 const char *uri_utf8);
251 unsigned end,
int to);
260 unsigned start_position,
unsigned end_position,
264 unsigned song_id, uint8_t priority);
314 unsigned sonag_position,
321 unsigned song_id,
SongTime seek_time);
370 unsigned MoveOrderToCurrent(
unsigned old_order);
void UpdateQueuedSong(PlayerControl &pc, const DetachedSong *prev)
Updates the "queued song".
void DeleteInternal(PlayerControl &pc, unsigned song, const DetachedSong **queued_p)
void ClearSongIdTag(unsigned id, TagType tag_type)
void SongStarted()
Called when playback of a new song starts.
int current
The "current song pointer" (the order number).
uint32_t version
the current version number
unsigned GetLength() const
void StaleSong(PlayerControl &pc, const char *uri)
Mark the given song as "stale", i.e.
int queued
The "next" song to be played (the order number), when the current one finishes.
void AddSongIdTag(unsigned id, TagType tag_type, const char *value)
void Clear(PlayerControl &pc)
void PlayNext(PlayerControl &pc)
Throws std::runtime_error or #Error on error.
void SetConsume(bool new_value)
A time stamp within a song.
bool consume
remove each played files.
bool repeat
repeat playback when the end of the queue has been reached?
void QueueSongOrder(PlayerControl &pc, unsigned order)
Queue a song, addressed by its order number.
void SwapIds(PlayerControl &pc, unsigned id1, unsigned id2)
playlist(unsigned max_length, QueueListener &_listener)
void DeleteRange(PlayerControl &pc, unsigned start, unsigned end)
Deletes a range of songs from the playlist.
int PositionToId(unsigned position) const
void PlayPrevious(PlayerControl &pc)
Throws std::runtime_error or #Error on error.
void SetPriorityId(PlayerControl &pc, unsigned song_id, uint8_t priority)
void OnModified()
Called by all editing methods after a modification.
void SetSongIdRange(PlayerControl &pc, unsigned id, SongTime start, SongTime end)
Sets the start_time and end_time attributes on the song with the specified id.
void DeleteId(PlayerControl &pc, unsigned id)
void DeleteOrder(PlayerControl &pc, unsigned order)
void SetRandom(PlayerControl &pc, bool new_value)
void QueuedSongStarted(PlayerControl &pc)
Called when the player thread has started playing the "queued" song, i.e.
uint32_t GetVersion() const
unsigned error_count
Number of errors since playback was started.
unsigned PositionToId(unsigned position) const
void MoveRange(PlayerControl &pc, unsigned start, unsigned end, int to)
gcc_pure unsigned OrderToPosition(unsigned _order) const noexcept
gcc_pure const DetachedSong * GetQueuedSong() const noexcept
Returns the song object which is currently queued.
TagType
Codes for the type of a tag item.
bool stop_on_error
If true, then any error is fatal; if false, MPD will attempt to play the next song on non-fatal error...
void SeekSongOrder(PlayerControl &pc, unsigned song_order, SongTime seek_time)
Throws std::runtime_error or #Error on error.
void SyncWithPlayer(PlayerControl &pc)
This is the "PLAYLIST" event handler.
void PlayId(PlayerControl &pc, int id)
Throws std::runtime_error or #Error on error.
bool bulk_modified
Has the queue been modified during bulk edit mode?
unsigned GetLength() const
bool bulk_edit
If true, then a bulk edit has been initiated by BeginBulk(), and UpdateQueuedSong() and OnModified() ...
bool random
play back songs in random order?
bool single
play only current song.
Queue queue
The song queue - it contains the "real" playlist.
void SetRepeat(PlayerControl &pc, bool new_value)
gcc_pure int GetCurrentPosition() const noexcept
A variant of SongTime that is based on a signed integer.
gcc_pure int GetNextPosition() const noexcept
void MoveId(PlayerControl &pc, unsigned id, int to)
void PlayPosition(PlayerControl &pc, int position)
Throws std::runtime_error or #Error on error.
void SeekCurrent(PlayerControl &pc, SignedSongTime seek_time, bool relative)
Seek within the current song.
void DeletePosition(PlayerControl &pc, unsigned position)
A utility class that loads a DetachedSong object by its URI.
void Stop(PlayerControl &pc)
void SwapPositions(PlayerControl &pc, unsigned song1, unsigned song2)
void PlayOrder(PlayerControl &pc, unsigned order)
Throws std::runtime_error or #Error on error.
void Shuffle(PlayerControl &pc, unsigned start, unsigned end)
void SeekSongPosition(PlayerControl &pc, unsigned sonag_position, SongTime seek_time)
Throws std::runtime_error or #Error on error.
unsigned AppendURI(PlayerControl &pc, const SongLoader &loader, const char *uri_utf8)
Throws #std::runtime_error on error.
void SetPriorityRange(PlayerControl &pc, unsigned start_position, unsigned end_position, uint8_t priority)
const Storage const char * uri
void ResumePlayback(PlayerControl &pc)
The player has stopped for some reason.
void SeekSongId(PlayerControl &pc, unsigned song_id, SongTime seek_time)
Throws std::runtime_error or #Error on error.
bool playing
This value is true if the player is currently playing (or should be playing).
void SetSingle(PlayerControl &pc, bool new_value)
void TagModified(DetachedSong &&song)
A tag in the play queue has been modified by the player thread.
void CommitBulk(PlayerControl &pc)
unsigned AppendSong(PlayerControl &pc, DetachedSong &&song)
Throws PlaylistError if the queue would be too large.