mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:37:35 +00:00
Audio: Change how volume works
Across the entire audio system, audio now works in 0-1 terms instead of 0-100 as before. Therefore, volume is now a double instead of an int. The master volume of the AudioServer changes smoothly through a FadingProperty, preventing clicks. Finally, volume computations are done with logarithmic scaling, which is more natural for the human ear. Note that this could be 4-5 different commits, but as they change each other's code all the time, it makes no sense to split them up.
This commit is contained in:
parent
2909c3a931
commit
152ec28da0
14 changed files with 190 additions and 45 deletions
|
@ -48,7 +48,7 @@ void ClientConnection::did_change_muted_state(Badge<Mixer>, bool muted)
|
|||
async_muted_state_changed(muted);
|
||||
}
|
||||
|
||||
void ClientConnection::did_change_main_mix_volume(Badge<Mixer>, int volume)
|
||||
void ClientConnection::did_change_main_mix_volume(Badge<Mixer>, double volume)
|
||||
{
|
||||
async_main_mix_volume_changed(volume);
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ Messages::AudioServer::GetMainMixVolumeResponse ClientConnection::get_main_mix_v
|
|||
return m_mixer.main_volume();
|
||||
}
|
||||
|
||||
void ClientConnection::set_main_mix_volume(i32 volume)
|
||||
void ClientConnection::set_main_mix_volume(double volume)
|
||||
{
|
||||
m_mixer.set_main_volume(volume);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue