command: add command "getvol"

Closes https://github.com/MusicPlayerDaemon/MPD/issues/979
This commit is contained in:
Max Kellermann
2020-10-16 17:46:58 +02:00
parent 08360e401d
commit 871bf3b88f
5 changed files with 28 additions and 0 deletions

View File

@@ -318,6 +318,18 @@ handle_rescan(Client &client, Request args, Response &r)
return handle_update(client, args, r, true);
}
CommandResult
handle_getvol(Client &client, Request, Response &r)
{
auto &partition = client.GetPartition();
const auto volume = volume_level_get(partition.outputs);
if (volume >= 0)
r.Format("volume: %i\n", volume);
return CommandResult::OK;
}
CommandResult
handle_setvol(Client &client, Request args, Response &r)
{