Client: add method GetPartition(), make partition private

This commit is contained in:
Max Kellermann
2017-02-25 09:58:58 +01:00
parent e3ee60e7af
commit c7396b0675
9 changed files with 72 additions and 58 deletions

View File

@@ -32,7 +32,7 @@ handle_enableoutput(Client &client, Request args, Response &r)
assert(args.size == 1);
unsigned device = args.ParseUnsigned(0);
if (!audio_output_enable_index(client.partition.outputs, device)) {
if (!audio_output_enable_index(client.GetPartition().outputs, device)) {
r.Error(ACK_ERROR_NO_EXIST, "No such audio output");
return CommandResult::ERROR;
}
@@ -46,7 +46,7 @@ handle_disableoutput(Client &client, Request args, Response &r)
assert(args.size == 1);
unsigned device = args.ParseUnsigned(0);
if (!audio_output_disable_index(client.partition.outputs, device)) {
if (!audio_output_disable_index(client.GetPartition().outputs, device)) {
r.Error(ACK_ERROR_NO_EXIST, "No such audio output");
return CommandResult::ERROR;
}
@@ -60,7 +60,7 @@ handle_toggleoutput(Client &client, Request args, Response &r)
assert(args.size == 1);
unsigned device = args.ParseUnsigned(0);
if (!audio_output_toggle_index(client.partition.outputs, device)) {
if (!audio_output_toggle_index(client.GetPartition().outputs, device)) {
r.Error(ACK_ERROR_NO_EXIST, "No such audio output");
return CommandResult::ERROR;
}
@@ -73,6 +73,6 @@ handle_devices(Client &client, gcc_unused Request args, Response &r)
{
assert(args.IsEmpty());
printAudioDevices(r, client.partition.outputs);
printAudioDevices(r, client.GetPartition().outputs);
return CommandResult::OK;
}