summaryrefslogtreecommitdiff
path: root/Userland/Services/AudioServer/ClientConnection.cpp
diff options
context:
space:
mode:
authorkleines Filmröllchen <malu.bertsch@gmail.com>2021-08-27 23:47:09 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-12 23:38:57 +0200
commit152ec28da0d1a51ade18fe6799a34ac9b7aa07b0 (patch)
tree540e62552da0d9bb767e566f8951f081009e136a /Userland/Services/AudioServer/ClientConnection.cpp
parent2909c3a931439d0cbed3e4599d9eed47a6fdb446 (diff)
downloadserenity-152ec28da0d1a51ade18fe6799a34ac9b7aa07b0.zip
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.
Diffstat (limited to 'Userland/Services/AudioServer/ClientConnection.cpp')
-rw-r--r--Userland/Services/AudioServer/ClientConnection.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Services/AudioServer/ClientConnection.cpp b/Userland/Services/AudioServer/ClientConnection.cpp
index dc151b8ce5..a267b7126b 100644
--- a/Userland/Services/AudioServer/ClientConnection.cpp
+++ b/Userland/Services/AudioServer/ClientConnection.cpp
@@ -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);
}