mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
AudioServer: Add a 'self_muted' state to each client connection
This new state will allow us to ignore muted clients when computing the 'output mix' in the Mixer.
This commit is contained in:
parent
ce5f5f543f
commit
bb747c471f
Notes:
sideshowbarker
2024-07-17 22:17:17 +09:00
Author: https://github.com/elyse0 Commit: https://github.com/SerenityOS/serenity/commit/bb747c471f4 Pull-request: https://github.com/SerenityOS/serenity/pull/11161 Reviewed-by: https://github.com/sin-ack ✅
3 changed files with 18 additions and 0 deletions
|
@ -5,6 +5,8 @@ endpoint AudioServer
|
|||
// Mixer functions
|
||||
set_main_mix_muted(bool muted) => ()
|
||||
is_main_mix_muted() => (bool muted)
|
||||
set_self_muted(bool muted) => ()
|
||||
is_self_muted() => (bool muted)
|
||||
get_main_mix_volume() => (double volume)
|
||||
set_main_mix_volume(double volume) => ()
|
||||
get_self_volume() => (double volume)
|
||||
|
|
|
@ -149,4 +149,18 @@ void ClientConnection::set_main_mix_muted(bool muted)
|
|||
{
|
||||
m_mixer.set_muted(muted);
|
||||
}
|
||||
|
||||
Messages::AudioServer::IsSelfMutedResponse ClientConnection::is_self_muted()
|
||||
{
|
||||
if (m_queue)
|
||||
return m_queue->is_muted();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void ClientConnection::set_self_muted(bool muted)
|
||||
{
|
||||
if (m_queue)
|
||||
m_queue->set_muted(muted);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,6 +49,8 @@ private:
|
|||
virtual Messages::AudioServer::GetPlayingBufferResponse get_playing_buffer() override;
|
||||
virtual Messages::AudioServer::IsMainMixMutedResponse is_main_mix_muted() override;
|
||||
virtual void set_main_mix_muted(bool) override;
|
||||
virtual Messages::AudioServer::IsSelfMutedResponse is_self_muted() override;
|
||||
virtual void set_self_muted(bool) override;
|
||||
virtual void set_sample_rate(u32 sample_rate) override;
|
||||
virtual Messages::AudioServer::GetSampleRateResponse get_sample_rate() override;
|
||||
|
||||
|
|
Loading…
Reference in a new issue