mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:58:11 +00:00
AudioServer: Mixer: limit max volume to 200%
This commit is contained in:
parent
2a0f92ef1f
commit
ac98dc4f7c
1 changed files with 4 additions and 2 deletions
|
@ -116,10 +116,12 @@ void Mixer::set_main_volume(int volume)
|
|||
{
|
||||
if (volume < 0)
|
||||
m_main_volume = 0;
|
||||
else if (volume > 200)
|
||||
m_main_volume = 200;
|
||||
else
|
||||
m_main_volume = volume;
|
||||
ClientConnection::for_each([volume](ClientConnection& client) {
|
||||
client.did_change_main_mix_volume({}, volume);
|
||||
ClientConnection::for_each([&](ClientConnection& client) {
|
||||
client.did_change_main_mix_volume({}, m_main_volume);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue