aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/OutputCommands.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-27 08:20:25 +0100
committerMax Kellermann <max@duempel.org>2014-01-28 09:20:53 +0100
commitf5a923b9d16e4c63942a033d1bdb2ab150aae342 (patch)
tree6e3c39b305fd2a1da2a7b9c2b79a6737ca21a23b /src/command/OutputCommands.cxx
parent36bab6ef066c6898a791dd15054301f80757b3f6 (diff)
downloadmpd-f5a923b9d16e4c63942a033d1bdb2ab150aae342.tar.gz
mpd-f5a923b9d16e4c63942a033d1bdb2ab150aae342.tar.xz
mpd-f5a923b9d16e4c63942a033d1bdb2ab150aae342.zip
OutputAll: convert to class, move instance to class Partition
Another big chunk of code for multi-player support.
Diffstat (limited to '')
-rw-r--r--src/command/OutputCommands.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/command/OutputCommands.cxx b/src/command/OutputCommands.cxx
index 4ed3b89f1..03058d7ed 100644
--- a/src/command/OutputCommands.cxx
+++ b/src/command/OutputCommands.cxx
@@ -23,18 +23,17 @@
#include "output/OutputCommand.hxx"
#include "protocol/Result.hxx"
#include "protocol/ArgParser.hxx"
+#include "client/Client.hxx"
+#include "Partition.hxx"
CommandResult
handle_enableoutput(Client &client, gcc_unused int argc, char *argv[])
{
unsigned device;
- bool ret;
-
if (!check_unsigned(client, &device, argv[1]))
return CommandResult::ERROR;
- ret = audio_output_enable_index(device);
- if (!ret) {
+ if (!audio_output_enable_index(client.partition.outputs, device)) {
command_error(client, ACK_ERROR_NO_EXIST,
"No such audio output");
return CommandResult::ERROR;
@@ -47,13 +46,10 @@ CommandResult
handle_disableoutput(Client &client, gcc_unused int argc, char *argv[])
{
unsigned device;
- bool ret;
-
if (!check_unsigned(client, &device, argv[1]))
return CommandResult::ERROR;
- ret = audio_output_disable_index(device);
- if (!ret) {
+ if (!audio_output_disable_index(client.partition.outputs, device)) {
command_error(client, ACK_ERROR_NO_EXIST,
"No such audio output");
return CommandResult::ERROR;
@@ -69,7 +65,7 @@ handle_toggleoutput(Client &client, gcc_unused int argc, char *argv[])
if (!check_unsigned(client, &device, argv[1]))
return CommandResult::ERROR;
- if (!audio_output_toggle_index(device)) {
+ if (!audio_output_toggle_index(client.partition.outputs, device)) {
command_error(client, ACK_ERROR_NO_EXIST,
"No such audio output");
return CommandResult::ERROR;
@@ -82,7 +78,7 @@ CommandResult
handle_devices(Client &client,
gcc_unused int argc, gcc_unused char *argv[])
{
- printAudioDevices(client);
+ printAudioDevices(client, client.partition.outputs);
return CommandResult::OK;
}