2009-01-23 16:34:27 +01:00
|
|
|
/*
|
2021-01-01 19:54:25 +01:00
|
|
|
* Copyright 2003-2021 The Music Player Daemon Project
|
2009-01-23 16:34:27 +01:00
|
|
|
* http://www.musicpd.org
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2009-03-13 18:43:16 +01:00
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
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;
|
2012-08-29 19:27:03 +02:00
|
|
|
class SongFilter;
|
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
|
2017-02-24 13:56:13 +01:00
|
|
|
playlist_print_info(Response &r, const playlist &playlist,
|
2009-02-04 22:09:04 +01:00
|
|
|
unsigned start, unsigned end);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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,
|
2012-08-29 19:27:03 +02:00
|
|
|
const SongFilter &filter);
|
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,
|
|
|
|
unsigned start, unsigned end);
|
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,
|
|
|
|
unsigned start, unsigned end);
|
2009-01-23 16:34:27 +01:00
|
|
|
|
|
|
|
#endif
|