playlist: provide information about "next song"
In random mode, this patch allows clients to see the "next song" in the queue.
This commit is contained in:
committed by
Max Kellermann
parent
b358962960
commit
cde4cb944e
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user