diff options
author | Max Kellermann <max@duempel.org> | 2013-08-04 23:20:56 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-08-04 23:21:23 +0200 |
commit | 9e715089a4279d08b7cc8d7fbdb3eb8696230e65 (patch) | |
tree | e075d02a6355e58d2241109eb30009b6b5baa2bc /src/OutputCommands.cxx | |
parent | 1a852bc365971960b0c8fd180f71a14396c81d8c (diff) | |
download | mpd-9e715089a4279d08b7cc8d7fbdb3eb8696230e65.tar.gz mpd-9e715089a4279d08b7cc8d7fbdb3eb8696230e65.tar.xz mpd-9e715089a4279d08b7cc8d7fbdb3eb8696230e65.zip |
Commands: new command "toggleoutput"
Diffstat (limited to 'src/OutputCommands.cxx')
-rw-r--r-- | src/OutputCommands.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/OutputCommands.cxx b/src/OutputCommands.cxx index 7d626477a..5e4a145da 100644 --- a/src/OutputCommands.cxx +++ b/src/OutputCommands.cxx @@ -65,6 +65,22 @@ handle_disableoutput(Client *client, G_GNUC_UNUSED int argc, char *argv[]) } enum command_return +handle_toggleoutput(Client *client, gcc_unused int argc, char *argv[]) +{ + unsigned device; + if (!check_unsigned(client, &device, argv[1])) + return COMMAND_RETURN_ERROR; + + if (!audio_output_toggle_index(device)) { + command_error(client, ACK_ERROR_NO_EXIST, + "No such audio output"); + return COMMAND_RETURN_ERROR; + } + + return COMMAND_RETURN_OK; +} + +enum command_return handle_devices(Client *client, G_GNUC_UNUSED int argc, G_GNUC_UNUSED char *argv[]) { |