mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:48:10 +00:00
LibAudio: Expose blocking realtime enqueue to audio clients
This is just a delegate of the same function found in the shared queue itself.
This commit is contained in:
parent
836f28392d
commit
cc9192a1e7
2 changed files with 7 additions and 0 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <AK/Time.h>
|
||||
#include <AK/Types.h>
|
||||
#include <LibAudio/ConnectionToServer.h>
|
||||
#include <LibAudio/Queue.h>
|
||||
#include <LibAudio/UserSampleQueue.h>
|
||||
#include <LibCore/Event.h>
|
||||
#include <LibThreading/Mutex.h>
|
||||
|
@ -116,6 +117,11 @@ ErrorOr<void, AudioQueue::QueueStatus> ConnectionToServer::realtime_enqueue(Arra
|
|||
return m_buffer->try_enqueue(samples);
|
||||
}
|
||||
|
||||
ErrorOr<void> ConnectionToServer::blocking_realtime_enqueue(Array<Sample, AUDIO_BUFFER_SIZE> samples, Function<void()> wait_function)
|
||||
{
|
||||
return m_buffer->try_blocking_enqueue(samples, move(wait_function));
|
||||
}
|
||||
|
||||
unsigned ConnectionToServer::total_played_samples() const
|
||||
{
|
||||
return m_buffer->weak_tail() * AUDIO_BUFFER_SIZE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue