output/MultipleOutputs: SetVolume() throws on error
This reveals more about the nature of an error instead of just returning "problems setting volume".
This commit is contained in:
@@ -333,15 +333,11 @@ handle_getvol(Client &client, Request, Response &r)
|
||||
}
|
||||
|
||||
CommandResult
|
||||
handle_setvol(Client &client, Request args, Response &r)
|
||||
handle_setvol(Client &client, Request args, Response &)
|
||||
{
|
||||
unsigned level = args.ParseUnsigned(0, 100);
|
||||
|
||||
if (!volume_level_change(client.GetPartition().outputs, level)) {
|
||||
r.Error(ACK_ERROR_SYSTEM, "problems setting volume");
|
||||
return CommandResult::ERROR;
|
||||
}
|
||||
|
||||
volume_level_change(client.GetPartition().outputs, level);
|
||||
return CommandResult::OK;
|
||||
}
|
||||
|
||||
@@ -364,11 +360,8 @@ handle_volume(Client &client, Request args, Response &r)
|
||||
else if (new_volume > 100)
|
||||
new_volume = 100;
|
||||
|
||||
if (new_volume != old_volume &&
|
||||
!volume_level_change(outputs, new_volume)) {
|
||||
r.Error(ACK_ERROR_SYSTEM, "problems setting volume");
|
||||
return CommandResult::ERROR;
|
||||
}
|
||||
if (new_volume != old_volume)
|
||||
volume_level_change(outputs, new_volume);
|
||||
|
||||
return CommandResult::OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user