diff options
Diffstat (limited to 'Servers')
-rw-r--r-- | Servers/AudioServer/ASClientConnection.cpp | 2 | ||||
-rw-r--r-- | Servers/AudioServer/ASClientConnection.h | 5 | ||||
-rw-r--r-- | Servers/AudioServer/ASMixer.cpp | 8 | ||||
-rw-r--r-- | Servers/AudioServer/ASMixer.h | 8 |
4 files changed, 13 insertions, 10 deletions
diff --git a/Servers/AudioServer/ASClientConnection.cpp b/Servers/AudioServer/ASClientConnection.cpp index a231e1b91c..2eedfc9a51 100644 --- a/Servers/AudioServer/ASClientConnection.cpp +++ b/Servers/AudioServer/ASClientConnection.cpp @@ -105,7 +105,7 @@ OwnPtr<AudioServer::EnqueueBufferResponse> ASClientConnection::handle(const Audi if (m_queue->is_full()) return make<AudioServer::EnqueueBufferResponse>(false); - m_queue->enqueue(ABuffer::create_with_shared_buffer(*shared_buffer, message.sample_count())); + m_queue->enqueue(Audio::Buffer::create_with_shared_buffer(*shared_buffer, message.sample_count())); return make<AudioServer::EnqueueBufferResponse>(true); } diff --git a/Servers/AudioServer/ASClientConnection.h b/Servers/AudioServer/ASClientConnection.h index a55880eaed..608e360853 100644 --- a/Servers/AudioServer/ASClientConnection.h +++ b/Servers/AudioServer/ASClientConnection.h @@ -29,7 +29,10 @@ #include <AudioServer/AudioServerEndpoint.h> #include <LibIPC/IClientConnection.h> -class ABuffer; +namespace Audio { +class Buffer; +} + class ASBufferQueue; class ASMixer; diff --git a/Servers/AudioServer/ASMixer.cpp b/Servers/AudioServer/ASMixer.cpp index 2b0fff83bb..01730c9027 100644 --- a/Servers/AudioServer/ASMixer.cpp +++ b/Servers/AudioServer/ASMixer.cpp @@ -80,8 +80,8 @@ void ASMixer::mix() active_mix_queues.remove_all_matching([&](auto& entry) { return !entry->client(); }); - ASample mixed_buffer[1024]; - auto mixed_buffer_length = (int)(sizeof(mixed_buffer) / sizeof(ASample)); + Audio::Sample mixed_buffer[1024]; + auto mixed_buffer_length = (int)(sizeof(mixed_buffer) / sizeof(Audio::Sample)); // Mix the buffers together into the output for (auto& queue : active_mix_queues) { @@ -92,7 +92,7 @@ void ASMixer::mix() for (int i = 0; i < mixed_buffer_length; ++i) { auto& mixed_sample = mixed_buffer[i]; - ASample sample; + Audio::Sample sample; if (!queue->get_next_sample(sample)) break; mixed_sample += sample; @@ -145,7 +145,7 @@ ASBufferQueue::ASBufferQueue(ASClientConnection& client) { } -void ASBufferQueue::enqueue(NonnullRefPtr<ABuffer>&& buffer) +void ASBufferQueue::enqueue(NonnullRefPtr<Audio::Buffer>&& buffer) { m_remaining_samples += buffer->sample_count(); m_queue.enqueue(move(buffer)); diff --git a/Servers/AudioServer/ASMixer.h b/Servers/AudioServer/ASMixer.h index 5fd0ef0441..fdd599a246 100644 --- a/Servers/AudioServer/ASMixer.h +++ b/Servers/AudioServer/ASMixer.h @@ -45,9 +45,9 @@ public: ~ASBufferQueue() {} bool is_full() const { return m_queue.size() >= 3; } - void enqueue(NonnullRefPtr<ABuffer>&&); + void enqueue(NonnullRefPtr<Audio::Buffer>&&); - bool get_next_sample(ASample& sample) + bool get_next_sample(Audio::Sample& sample) { if (m_paused) return false; @@ -97,8 +97,8 @@ public: } private: - RefPtr<ABuffer> m_current; - Queue<NonnullRefPtr<ABuffer>> m_queue; + RefPtr<Audio::Buffer> m_current; + Queue<NonnullRefPtr<Audio::Buffer>> m_queue; int m_position { 0 }; int m_remaining_samples { 0 }; int m_played_samples { 0 }; |