aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
authorVladimir S Eremin <me@hidded.name>2009-02-08 06:21:00 +0100
committerMax Kellermann <max@duempel.org>2009-02-09 10:38:03 +0100
commitcde4cb944ebcc5b4db46afa5458a5d0a728c4866 (patch)
tree35a6ad35be59d1ca323c575ff1cd32a4eca5dc33 /src/command.c
parentb35896296043fb5612ea52f0fadda48479aca860 (diff)
downloadmpd-cde4cb944ebcc5b4db46afa5458a5d0a728c4866.tar.gz
mpd-cde4cb944ebcc5b4db46afa5458a5d0a728c4866.tar.xz
mpd-cde4cb944ebcc5b4db46afa5458a5d0a728c4866.zip
playlist: provide information about "next song"
In random mode, this patch allows clients to see the "next song" in the queue.
Diffstat (limited to '')
-rw-r--r--src/command.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/command.c b/src/command.c
index a8a72b670..3b8ae9567 100644
--- a/src/command.c
+++ b/src/command.c
@@ -62,6 +62,8 @@
#define COMMAND_STATUS_PLAYLIST_LENGTH "playlistlength"
#define COMMAND_STATUS_SONG "song"
#define COMMAND_STATUS_SONGID "songid"
+#define COMMAND_STATUS_NEXTSONG "nextsong"
+#define COMMAND_STATUS_NEXTSONGID "nextsongid"
#define COMMAND_STATUS_TIME "time"
#define COMMAND_STATUS_BITRATE "bitrate"
#define COMMAND_STATUS_ERROR "error"
@@ -508,6 +510,14 @@ handle_status(struct client *client,
getPlayerErrorStr());
}
+ song = getPlaylistNextSong(&g_playlist);
+ if (song >= 0) {
+ client_printf(client,
+ COMMAND_STATUS_NEXTSONG ": %i\n"
+ COMMAND_STATUS_NEXTSONGID ": %u\n",
+ song, getPlaylistSongId(&g_playlist, song));
+ }
+
return COMMAND_RETURN_OK;
}