mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:58:13 +00:00
AudioServer: Allow muting the system audio
This patch adds muting to ASMixer, which works by substituting what we would normally send to the sound card with zero-filled memory instead. We do it this way to ensure that the queued sample buffers keep getting played (silently.) This is obviously not the perfect way of doing this, and in the future we should improve on this, and also find a way to utilize any hardware mixing functions in the sound card.
This commit is contained in:
parent
2b9ec22576
commit
107011f119
8 changed files with 72 additions and 15 deletions
|
@ -104,9 +104,21 @@ OwnPtr<AudioServer::ClearBufferResponse> ASClientConnection::handle(const AudioS
|
|||
return make<AudioServer::ClearBufferResponse>();
|
||||
}
|
||||
|
||||
OwnPtr<AudioServer::GetPlayingBufferResponse> ASClientConnection::handle(const AudioServer::GetPlayingBuffer&){
|
||||
OwnPtr<AudioServer::GetPlayingBufferResponse> ASClientConnection::handle(const AudioServer::GetPlayingBuffer&)
|
||||
{
|
||||
int id = -1;
|
||||
if(m_queue)
|
||||
if (m_queue)
|
||||
id = m_queue->get_playing_buffer();
|
||||
return make<AudioServer::GetPlayingBufferResponse>(id);
|
||||
}
|
||||
|
||||
OwnPtr<AudioServer::GetMutedResponse> ASClientConnection::handle(const AudioServer::GetMuted&)
|
||||
{
|
||||
return make<AudioServer::GetMutedResponse>(m_mixer.is_muted());
|
||||
}
|
||||
|
||||
OwnPtr<AudioServer::SetMutedResponse> ASClientConnection::handle(const AudioServer::SetMuted& message)
|
||||
{
|
||||
m_mixer.set_muted(message.muted());
|
||||
return make<AudioServer::SetMutedResponse>();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue