mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-23 09:48:56 +00:00
AudioServer: Mixer: limit max volume to 200%
This commit is contained in:
parent
2a0f92ef1f
commit
ac98dc4f7c
Notes:
sideshowbarker
2024-07-18 19:10:06 +09:00
Author: https://github.com/bcoles
Commit: ac98dc4f7c
Pull-request: https://github.com/SerenityOS/serenity/pull/6597
Issue: https://github.com/SerenityOS/serenity/issues/6596
1 changed files with 4 additions and 2 deletions
|
@ -116,10 +116,12 @@ void Mixer::set_main_volume(int volume)
|
||||||
{
|
{
|
||||||
if (volume < 0)
|
if (volume < 0)
|
||||||
m_main_volume = 0;
|
m_main_volume = 0;
|
||||||
|
else if (volume > 200)
|
||||||
|
m_main_volume = 200;
|
||||||
else
|
else
|
||||||
m_main_volume = volume;
|
m_main_volume = volume;
|
||||||
ClientConnection::for_each([volume](ClientConnection& client) {
|
ClientConnection::for_each([&](ClientConnection& client) {
|
||||||
client.did_change_main_mix_volume({}, volume);
|
client.did_change_main_mix_volume({}, m_main_volume);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue