2023-03-06 14:42:04 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
// Copyright The Music Player Daemon Project
|
2009-01-23 16:34:27 +01:00
|
|
|
|
2012-08-29 20:17:13 +02:00
|
|
|
#ifndef MPD_PLAYLIST_PRINT_HXX
|
|
|
|
#define MPD_PLAYLIST_PRINT_HXX
|
2009-01-23 16:34:27 +01:00
|
|
|
|
2020-03-13 01:08:53 +01:00
|
|
|
#include <cstdint>
|
2009-02-04 21:04:30 +01:00
|
|
|
|
2009-02-04 22:09:04 +01:00
|
|
|
struct playlist;
|
2021-02-15 19:25:36 +01:00
|
|
|
struct RangeArg;
|
2022-02-12 08:19:36 +01:00
|
|
|
struct QueueSelection;
|
2015-08-06 22:10:25 +02:00
|
|
|
class Response;
|
2009-02-04 22:09:04 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sends the whole playlist to the client, song URIs only.
|
|
|
|
*/
|
|
|
|
void
|
2017-02-24 13:56:13 +01:00
|
|
|
playlist_print_uris(Response &r, const playlist &playlist);
|
2009-02-04 22:09:04 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sends a range of the playlist to the client, including all known
|
|
|
|
* information about the songs. The "end" offset is decreased
|
|
|
|
* automatically if it is too large; passing UINT_MAX is allowed.
|
|
|
|
* This function however fails when the start offset is invalid.
|
2016-02-28 11:52:39 +01:00
|
|
|
*
|
|
|
|
* Throws #PlaylistError if the range is invalid.
|
2009-02-04 22:09:04 +01:00
|
|
|
*/
|
2016-02-28 11:52:39 +01:00
|
|
|
void
|
2021-02-15 19:25:36 +01:00
|
|
|
playlist_print_info(Response &r, const playlist &playlist, RangeArg range);
|
2009-02-04 22:09:04 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sends the song with the specified id to the client.
|
|
|
|
*
|
2016-02-28 11:52:39 +01:00
|
|
|
* Throws #PlaylistError if the range is invalid.
|
2009-02-04 22:09:04 +01:00
|
|
|
*/
|
2016-02-28 11:52:39 +01:00
|
|
|
void
|
2017-02-24 13:56:13 +01:00
|
|
|
playlist_print_id(Response &r, const playlist &playlist, unsigned id);
|
2009-02-04 22:09:04 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sends the current song to the client.
|
|
|
|
*
|
|
|
|
* @return true on success, false if there is no current song
|
|
|
|
*/
|
|
|
|
bool
|
2017-02-24 13:56:13 +01:00
|
|
|
playlist_print_current(Response &r, const playlist &playlist);
|
2009-02-04 22:09:04 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Find songs in the playlist.
|
|
|
|
*/
|
|
|
|
void
|
2017-02-24 13:56:13 +01:00
|
|
|
playlist_print_find(Response &r, const playlist &playlist,
|
2022-02-12 08:19:36 +01:00
|
|
|
const QueueSelection &selection);
|
2009-02-04 22:09:04 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Print detailed changes since the specified playlist version.
|
|
|
|
*/
|
|
|
|
void
|
2017-02-24 13:56:13 +01:00
|
|
|
playlist_print_changes_info(Response &r, const playlist &playlist,
|
2015-10-27 20:35:40 +01:00
|
|
|
uint32_t version,
|
2021-02-15 19:25:36 +01:00
|
|
|
RangeArg range);
|
2009-02-04 22:09:04 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Print changes since the specified playlist version, position only.
|
|
|
|
*/
|
|
|
|
void
|
2015-08-06 22:10:25 +02:00
|
|
|
playlist_print_changes_position(Response &r,
|
2013-10-19 18:48:38 +02:00
|
|
|
const playlist &playlist,
|
2015-10-27 20:35:40 +01:00
|
|
|
uint32_t version,
|
2021-02-15 19:25:36 +01:00
|
|
|
RangeArg range);
|
2009-01-23 16:34:27 +01:00
|
|
|
|
|
|
|
#endif
|