From 9cc37bdea2a55ca022c92902f943443badb94bce Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 4 Sep 2017 08:37:37 +0200 Subject: command/PlayerCommands: emit "volume" only if it is known The "-1" magic value is deprecated now. --- src/command/PlayerCommands.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/command/PlayerCommands.cxx') diff --git a/src/command/PlayerCommands.cxx b/src/command/PlayerCommands.cxx index a6bcf878f..400ed26fb 100644 --- a/src/command/PlayerCommands.cxx +++ b/src/command/PlayerCommands.cxx @@ -127,8 +127,12 @@ handle_status(Client &client, gcc_unused Request args, Response &r) } const playlist &playlist = client.GetPlaylist(); - r.Format("volume: %i\n" - COMMAND_STATUS_REPEAT ": %i\n" + + const auto volume = volume_level_get(client.GetPartition().outputs); + if (volume >= 0) + r.Format("volume: %i\n", volume); + + r.Format(COMMAND_STATUS_REPEAT ": %i\n" COMMAND_STATUS_RANDOM ": %i\n" COMMAND_STATUS_SINGLE ": %i\n" COMMAND_STATUS_CONSUME ": %i\n" @@ -136,7 +140,6 @@ handle_status(Client &client, gcc_unused Request args, Response &r) COMMAND_STATUS_PLAYLIST_LENGTH ": %i\n" COMMAND_STATUS_MIXRAMPDB ": %f\n" COMMAND_STATUS_STATE ": %s\n", - volume_level_get(client.GetPartition().outputs), playlist.GetRepeat(), playlist.GetRandom(), playlist.GetSingle(), -- cgit v1.2.3