mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:17:46 +00:00
AudioServer: Broadcast muted state changes to all clients
This commit is contained in:
parent
00ab9488ad
commit
84cb91de38
6 changed files with 37 additions and 1 deletions
|
@ -77,6 +77,14 @@ int AClientConnection::get_playing_buffer()
|
|||
return send_sync<AudioServer::GetPlayingBuffer>()->buffer_id();
|
||||
}
|
||||
|
||||
void AClientConnection::handle(const AudioClient::FinishedPlayingBuffer&)
|
||||
void AClientConnection::handle(const AudioClient::FinishedPlayingBuffer& message)
|
||||
{
|
||||
if (on_finish_playing_buffer)
|
||||
on_finish_playing_buffer(message.buffer_id());
|
||||
}
|
||||
|
||||
void AClientConnection::handle(const AudioClient::MutedStateChanged& message)
|
||||
{
|
||||
if (on_muted_state_change)
|
||||
on_muted_state_change(message.muted());
|
||||
}
|
||||
|
|
|
@ -29,6 +29,10 @@ public:
|
|||
void set_paused(bool paused);
|
||||
void clear_buffer(bool paused = false);
|
||||
|
||||
Function<void(i32 buffer_id)> on_finish_playing_buffer;
|
||||
Function<void(bool muted)> on_muted_state_change;
|
||||
|
||||
private:
|
||||
virtual void handle(const AudioClient::FinishedPlayingBuffer&) override;
|
||||
virtual void handle(const AudioClient::MutedStateChanged&) override;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue