1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:28:12 +00:00

LibAudio: Added playback control features to audio server

LibAudio now supports pausing playback, clearing the buffer queue,
retrieving the played samples since the last clear and retrieving
the currently playing shared buffer id
This commit is contained in:
Till Mayer 2019-11-04 19:39:17 +01:00 committed by Andreas Kling
parent e7ccbdbe30
commit 2f13517a1a
8 changed files with 109 additions and 9 deletions

View file

@ -46,3 +46,23 @@ int AClientConnection::get_remaining_samples()
{
return send_sync<AudioServer::GetRemainingSamples>()->remaining_samples();
}
int AClientConnection::get_played_samples()
{
return send_sync<AudioServer::GetPlayedSamples>()->played_samples();
}
void AClientConnection::set_paused(bool paused)
{
send_sync<AudioServer::SetPaused>(paused);
}
void AClientConnection::clear_buffer(bool paused)
{
send_sync<AudioServer::ClearBuffer>(paused);
}
int AClientConnection::get_playing_buffer()
{
return send_sync<AudioServer::GetPlayingBuffer>()->buffer_id();
}