diff options
author | Benoît Lormeau <blormeau@outlook.com> | 2020-07-21 03:16:48 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-21 19:02:25 +0200 |
commit | 60a7187db27f711c92243a437123e120a8ea9c5e (patch) | |
tree | bf00dad3c0e54aca05041de4de3d2a2dfde53a05 /Libraries | |
parent | e634fe6072a2608eaab92c2864ef985d5e0179cb (diff) | |
download | serenity-60a7187db27f711c92243a437123e120a8ea9c5e.zip |
AudioServer: Give the AudioClient a way to keep track of the main mix volume
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibAudio/ClientConnection.cpp | 6 | ||||
-rw-r--r-- | Libraries/LibAudio/ClientConnection.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Libraries/LibAudio/ClientConnection.cpp b/Libraries/LibAudio/ClientConnection.cpp index 7accf955e6..c446cf291f 100644 --- a/Libraries/LibAudio/ClientConnection.cpp +++ b/Libraries/LibAudio/ClientConnection.cpp @@ -116,4 +116,10 @@ void ClientConnection::handle(const Messages::AudioClient::MutedStateChanged& me on_muted_state_change(message.muted()); } +void ClientConnection::handle(const Messages::AudioClient::MainMixVolumeChanged& message) +{ + if (on_main_mix_volume_change) + on_main_mix_volume_change(message.volume()); +} + } diff --git a/Libraries/LibAudio/ClientConnection.h b/Libraries/LibAudio/ClientConnection.h index dd27103b4c..10d76f03ee 100644 --- a/Libraries/LibAudio/ClientConnection.h +++ b/Libraries/LibAudio/ClientConnection.h @@ -59,10 +59,12 @@ public: Function<void(i32 buffer_id)> on_finish_playing_buffer; Function<void(bool muted)> on_muted_state_change; + Function<void(int volume)> on_main_mix_volume_change; private: virtual void handle(const Messages::AudioClient::FinishedPlayingBuffer&) override; virtual void handle(const Messages::AudioClient::MutedStateChanged&) override; + virtual void handle(const Messages::AudioClient::MainMixVolumeChanged&) override; }; } |