summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElyse <kevincristian@outlook.com>2021-12-05 11:22:35 -0600
committerBrian Gianforcaro <b.gianfo@gmail.com>2021-12-24 00:19:01 -0800
commitce5f5f543fe437a3d0b2aad5f7d1810a9a081eba (patch)
treeb915da93b2b432e60040954c062efba518f1a356
parentc78a8b94c5e727d442fe02cd0c6778ee501e690e (diff)
downloadserenity-ce5f5f543fe437a3d0b2aad5f7d1810a9a081eba.zip
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.
-rw-r--r--Userland/Services/AudioServer/Mixer.h3
1 files changed, 3 insertions, 0 deletions
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<double>& 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<Audio::Buffer> 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<ClientConnection> m_client;
FadingProperty<double> m_volume { 1 };