mixer/Memento: move IDLE_MIXER out of SetVolume()
Make this idle event per-partition.
This commit is contained in:
parent
4b4f47002b
commit
69f741e8a6
|
@ -338,6 +338,7 @@ handle_setvol(Client &client, Request args, Response &)
|
||||||
|
|
||||||
auto &partition = client.GetPartition();
|
auto &partition = client.GetPartition();
|
||||||
partition.mixer_memento.SetVolume(partition.outputs, level);
|
partition.mixer_memento.SetVolume(partition.outputs, level);
|
||||||
|
partition.EmitIdle(IDLE_MIXER);
|
||||||
return CommandResult::OK;
|
return CommandResult::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,8 +363,10 @@ handle_volume(Client &client, Request args, Response &r)
|
||||||
else if (new_volume > 100)
|
else if (new_volume > 100)
|
||||||
new_volume = 100;
|
new_volume = 100;
|
||||||
|
|
||||||
if (new_volume != old_volume)
|
if (new_volume != old_volume) {
|
||||||
mixer_memento.SetVolume(outputs, new_volume);
|
mixer_memento.SetVolume(outputs, new_volume);
|
||||||
|
partition.EmitIdle(IDLE_MIXER);
|
||||||
|
}
|
||||||
|
|
||||||
return CommandResult::OK;
|
return CommandResult::OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,8 +68,6 @@ MixerMemento::SetVolume(MultipleOutputs &outputs, unsigned volume)
|
||||||
|
|
||||||
volume_software_set = volume;
|
volume_software_set = volume;
|
||||||
|
|
||||||
idle_add(IDLE_MIXER);
|
|
||||||
|
|
||||||
SetHardwareVolume(outputs, volume);
|
SetHardwareVolume(outputs, volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,8 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Throws on error.
|
* Throws on error.
|
||||||
|
*
|
||||||
|
* Note: the caller is responsible for emitting #IDLE_MIXER.
|
||||||
*/
|
*/
|
||||||
void SetVolume(MultipleOutputs &outputs, unsigned volume);
|
void SetVolume(MultipleOutputs &outputs, unsigned volume);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue