From ce5f5f543fe437a3d0b2aad5f7d1810a9a081eba Mon Sep 17 00:00:00 2001 From: Elyse Date: Sun, 5 Dec 2021 11:22:35 -0600 Subject: [PATCH] AudioServer: Add 'mute' member and methods to ClientAudioStream When computing the 'output mix', the Mixer iterates over all client audio streams and computes a 'mixed sample' taking into account mainly the client's volume. This new member and methods will allow us to ignore a muted client when computing that mix. --- Userland/Services/AudioServer/Mixer.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Services/AudioServer/Mixer.h b/Userland/Services/AudioServer/Mixer.h index 3c0669a784..51e2939d2f 100644 --- a/Userland/Services/AudioServer/Mixer.h +++ b/Userland/Services/AudioServer/Mixer.h @@ -93,6 +93,8 @@ public: FadingProperty& volume() { return m_volume; } double volume() const { return m_volume; } void set_volume(double const volume) { m_volume = volume; } + bool is_muted() const { return m_muted; } + void set_muted(bool muted) { m_muted = muted; } private: RefPtr m_current; @@ -101,6 +103,7 @@ private: int m_remaining_samples { 0 }; int m_played_samples { 0 }; bool m_paused { false }; + bool m_muted { false }; WeakPtr m_client; FadingProperty m_volume { 1 };