diff options
author | Max Kellermann <max@duempel.org> | 2015-08-06 22:10:25 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-08-12 08:41:05 +0200 |
commit | 7652a2986b0d0ad55b2776685130f1c68d7108c7 (patch) | |
tree | b4d45e60e97757454f1ff8e4dc793a1e7d852c36 /src/queue/QueuePrint.cxx | |
parent | b1480167be487d09ff46bb86ad02041fb28acff1 (diff) | |
download | mpd-7652a2986b0d0ad55b2776685130f1c68d7108c7.tar.gz mpd-7652a2986b0d0ad55b2776685130f1c68d7108c7.tar.xz mpd-7652a2986b0d0ad55b2776685130f1c68d7108c7.zip |
client/Response: new Client wrapper class for writing responses
Diffstat (limited to '')
-rw-r--r-- | src/queue/QueuePrint.cxx | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/queue/QueuePrint.cxx b/src/queue/QueuePrint.cxx index c5bda5607..5ae1a3036 100644 --- a/src/queue/QueuePrint.cxx +++ b/src/queue/QueuePrint.cxx @@ -22,7 +22,7 @@ #include "Queue.hxx" #include "SongFilter.hxx" #include "SongPrint.hxx" -#include "client/Client.hxx" +#include "client/Response.hxx" /** * Send detailed information about a range of songs in the queue to a @@ -33,70 +33,70 @@ * @param end the index of the last song (excluding) */ static void -queue_print_song_info(Client &client, const Queue &queue, +queue_print_song_info(Response &r, Partition &partition, const Queue &queue, unsigned position) { - song_print_info(client, queue.Get(position)); - client_printf(client, "Pos: %u\nId: %u\n", - position, queue.PositionToId(position)); + song_print_info(r, partition, queue.Get(position)); + r.Format("Pos: %u\nId: %u\n", + position, queue.PositionToId(position)); uint8_t priority = queue.GetPriorityAtPosition(position); if (priority != 0) - client_printf(client, "Prio: %u\n", priority); + r.Format("Prio: %u\n", priority); } void -queue_print_info(Client &client, const Queue &queue, +queue_print_info(Response &r, Partition &partition, const Queue &queue, unsigned start, unsigned end) { assert(start <= end); assert(end <= queue.GetLength()); for (unsigned i = start; i < end; ++i) - queue_print_song_info(client, queue, i); + queue_print_song_info(r, partition, queue, i); } void -queue_print_uris(Client &client, const Queue &queue, +queue_print_uris(Response &r, Partition &partition, const Queue &queue, unsigned start, unsigned end) { assert(start <= end); assert(end <= queue.GetLength()); for (unsigned i = start; i < end; ++i) { - client_printf(client, "%i:", i); - song_print_uri(client, queue.Get(i)); + r.Format("%i:", i); + song_print_uri(r, partition, queue.Get(i)); } } void -queue_print_changes_info(Client &client, const Queue &queue, +queue_print_changes_info(Response &r, Partition &partition, const Queue &queue, uint32_t version) { for (unsigned i = 0; i < queue.GetLength(); i++) { if (queue.IsNewerAtPosition(i, version)) - queue_print_song_info(client, queue, i); + queue_print_song_info(r, partition, queue, i); } } void -queue_print_changes_position(Client &client, const Queue &queue, +queue_print_changes_position(Response &r, const Queue &queue, uint32_t version) { for (unsigned i = 0; i < queue.GetLength(); i++) if (queue.IsNewerAtPosition(i, version)) - client_printf(client, "cpos: %i\nId: %i\n", - i, queue.PositionToId(i)); + r.Format("cpos: %i\nId: %i\n", + i, queue.PositionToId(i)); } void -queue_find(Client &client, const Queue &queue, +queue_find(Response &r, Partition &partition, const Queue &queue, const SongFilter &filter) { for (unsigned i = 0; i < queue.GetLength(); i++) { const DetachedSong &song = queue.Get(i); if (filter.Match(song)) - queue_print_song_info(client, queue, i); + queue_print_song_info(r, partition, queue, i); } } |