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

AudioServer: Added ability to get count of samples in the buffer queue

Now the AClientConnection can get the count of samples still in the
buffer queue.
This commit is contained in:
Till Mayer 2019-10-19 19:10:53 +02:00 committed by Andreas Kling
parent 8bb919d1cc
commit 406aabff23
7 changed files with 28 additions and 0 deletions

View file

@ -71,3 +71,12 @@ OwnPtr<AudioServer::EnqueueBufferResponse> ASClientConnection::handle(const Audi
m_queue->enqueue(ABuffer::create_with_shared_buffer(*shared_buffer, message.sample_count()));
return make<AudioServer::EnqueueBufferResponse>(true);
}
OwnPtr<AudioServer::GetRemainingSamplesResponse> ASClientConnection::handle(const AudioServer::GetRemainingSamples&)
{
int remaining = 0;
if(m_queue)
remaining = m_queue->get_remaining_samples();
return make<AudioServer::GetRemainingSamplesResponse>(remaining);
}