1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:07:34 +00:00

Everywhere: Refactor 'muted' to 'main_mix_muted' in all AudioConnections

The 'muted' methods referred to the 'main mix muted' but it wasn't
really clear from the name. This change will be useful because in the
next commit, a 'self muted' state will be added to each audio client
connection.
This commit is contained in:
Elyse 2021-11-01 18:52:22 -06:00 committed by Brian Gianforcaro
parent 60fa8ac109
commit c78a8b94c5
9 changed files with 22 additions and 22 deletions

View file

@ -3,7 +3,7 @@
endpoint AudioClient
{
finished_playing_buffer(i32 buffer_id) =|
muted_state_changed(bool muted) =|
main_mix_muted_state_changed(bool muted) =|
main_mix_volume_changed(double volume) =|
client_volume_changed(double volume) =|
}

View file

@ -3,8 +3,8 @@
endpoint AudioServer
{
// Mixer functions
set_muted(bool muted) => ()
get_muted() => (bool muted)
set_main_mix_muted(bool muted) => ()
is_main_mix_muted() => (bool muted)
get_main_mix_volume() => (double volume)
set_main_mix_volume(double volume) => ()
get_self_volume() => (double volume)

View file

@ -43,9 +43,9 @@ void ClientConnection::did_finish_playing_buffer(Badge<ClientAudioStream>, int b
async_finished_playing_buffer(buffer_id);
}
void ClientConnection::did_change_muted_state(Badge<Mixer>, bool muted)
void ClientConnection::did_change_main_mix_muted_state(Badge<Mixer>, bool muted)
{
async_muted_state_changed(muted);
async_main_mix_muted_state_changed(muted);
}
void ClientConnection::did_change_main_mix_volume(Badge<Mixer>, double volume)
@ -140,12 +140,12 @@ Messages::AudioServer::GetPlayingBufferResponse ClientConnection::get_playing_bu
return id;
}
Messages::AudioServer::GetMutedResponse ClientConnection::get_muted()
Messages::AudioServer::IsMainMixMutedResponse ClientConnection::is_main_mix_muted()
{
return m_mixer.is_muted();
}
void ClientConnection::set_muted(bool muted)
void ClientConnection::set_main_mix_muted(bool muted)
{
m_mixer.set_muted(muted);
}

View file

@ -27,7 +27,7 @@ public:
void did_finish_playing_buffer(Badge<ClientAudioStream>, int buffer_id);
void did_change_client_volume(Badge<ClientAudioStream>, double volume);
void did_change_muted_state(Badge<Mixer>, bool muted);
void did_change_main_mix_muted_state(Badge<Mixer>, bool muted);
void did_change_main_mix_volume(Badge<Mixer>, double volume);
virtual void die() override;
@ -47,8 +47,8 @@ private:
virtual void set_paused(bool) override;
virtual void clear_buffer(bool) override;
virtual Messages::AudioServer::GetPlayingBufferResponse get_playing_buffer() override;
virtual Messages::AudioServer::GetMutedResponse get_muted() override;
virtual void set_muted(bool) override;
virtual Messages::AudioServer::IsMainMixMutedResponse is_main_mix_muted() override;
virtual void set_main_mix_muted(bool) override;
virtual void set_sample_rate(u32 sample_rate) override;
virtual Messages::AudioServer::GetSampleRateResponse get_sample_rate() override;

View file

@ -161,7 +161,7 @@ void Mixer::set_muted(bool muted)
request_setting_sync();
ClientConnection::for_each([muted](ClientConnection& client) {
client.did_change_muted_state({}, muted);
client.did_change_main_mix_muted_state({}, muted);
});
}