From 60a7187db27f711c92243a437123e120a8ea9c5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Lormeau?= Date: Tue, 21 Jul 2020 03:16:48 +0200 Subject: AudioServer: Give the AudioClient a way to keep track of the main mix volume --- Libraries/LibAudio/ClientConnection.cpp | 6 ++++++ Libraries/LibAudio/ClientConnection.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'Libraries') 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 on_finish_playing_buffer; Function on_muted_state_change; + Function 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; }; } -- cgit v1.2.3