1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:57:44 +00:00

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.
This commit is contained in:
Elyse 2021-12-05 11:22:35 -06:00 committed by Brian Gianforcaro
parent c78a8b94c5
commit ce5f5f543f

View file

@ -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 };