summaryrefslogtreecommitdiff
path: root/src/command/PlayerCommands.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-09-04 08:37:37 +0200
committerMax Kellermann <max@musicpd.org>2017-09-04 08:37:37 +0200
commit9cc37bdea2a55ca022c92902f943443badb94bce (patch)
tree5ac64fbd9886e902ece7a9b33462eee61e569e06 /src/command/PlayerCommands.cxx
parent3f754fd350c97088c8f5207fe9d4e25c4f8fca57 (diff)
command/PlayerCommands: emit "volume" only if it is known
The "-1" magic value is deprecated now.
Diffstat (limited to 'src/command/PlayerCommands.cxx')
-rw-r--r--src/command/PlayerCommands.cxx9
1 files changed, 6 insertions, 3 deletions
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(),