summaryrefslogtreecommitdiff
path: root/Servers/AudioServer/ASClientConnection.cpp
diff options
context:
space:
mode:
authorTill Mayer <till.mayer@web.de>2019-10-19 19:10:53 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-10-19 20:05:13 +0200
commit406aabff233d2f6d312a5dc9131e616d7f8e4261 (patch)
tree30e18ef99b77b3ca22cb8b7329c02a351609f9e9 /Servers/AudioServer/ASClientConnection.cpp
parent8bb919d1cc9bab052eb1764d78069cfdf41c97c9 (diff)
downloadserenity-406aabff233d2f6d312a5dc9131e616d7f8e4261.zip
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.
Diffstat (limited to 'Servers/AudioServer/ASClientConnection.cpp')
-rw-r--r--Servers/AudioServer/ASClientConnection.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Servers/AudioServer/ASClientConnection.cpp b/Servers/AudioServer/ASClientConnection.cpp
index 0ec2b0d13c..43e2e5e813 100644
--- a/Servers/AudioServer/ASClientConnection.cpp
+++ b/Servers/AudioServer/ASClientConnection.cpp
@@ -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);
+}