From 5300c9e6b4203b45ef86af89a917689740336e42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Fri, 27 Aug 2021 23:52:43 +0200 Subject: AudioServer: Rename BufferQueue to ClientAudioStream Although the old name is more technically correct, it doesn't reflect what the class is actually doing in the context of the audio server logic. --- Userland/Services/AudioServer/ClientConnection.cpp | 2 +- Userland/Services/AudioServer/ClientConnection.h | 4 ++-- Userland/Services/AudioServer/Mixer.cpp | 8 ++++---- Userland/Services/AudioServer/Mixer.h | 10 +++++----- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'Userland/Services/AudioServer') diff --git a/Userland/Services/AudioServer/ClientConnection.cpp b/Userland/Services/AudioServer/ClientConnection.cpp index a267b7126b..e22009ba73 100644 --- a/Userland/Services/AudioServer/ClientConnection.cpp +++ b/Userland/Services/AudioServer/ClientConnection.cpp @@ -38,7 +38,7 @@ void ClientConnection::die() s_connections.remove(client_id()); } -void ClientConnection::did_finish_playing_buffer(Badge, int buffer_id) +void ClientConnection::did_finish_playing_buffer(Badge, int buffer_id) { async_finished_playing_buffer(buffer_id); } diff --git a/Userland/Services/AudioServer/ClientConnection.h b/Userland/Services/AudioServer/ClientConnection.h index c5276e1097..00b0a9076c 100644 --- a/Userland/Services/AudioServer/ClientConnection.h +++ b/Userland/Services/AudioServer/ClientConnection.h @@ -17,7 +17,7 @@ class Buffer; namespace AudioServer { -class BufferQueue; +class ClientAudioStream; class Mixer; class ClientConnection final : public IPC::ClientConnection { @@ -49,7 +49,7 @@ private: virtual Messages::AudioServer::GetSampleRateResponse get_sample_rate() override; Mixer& m_mixer; - RefPtr m_queue; + RefPtr m_queue; }; } diff --git a/Userland/Services/AudioServer/Mixer.cpp b/Userland/Services/AudioServer/Mixer.cpp index 386b79857a..e694cc2bb0 100644 --- a/Userland/Services/AudioServer/Mixer.cpp +++ b/Userland/Services/AudioServer/Mixer.cpp @@ -49,9 +49,9 @@ Mixer::~Mixer() { } -NonnullRefPtr Mixer::create_queue(ClientConnection& client) +NonnullRefPtr Mixer::create_queue(ClientConnection& client) { - auto queue = adopt_ref(*new BufferQueue(client)); + auto queue = adopt_ref(*new ClientAudioStream(client)); pthread_mutex_lock(&m_pending_mutex); m_pending_mixing.append(*queue); m_added_queue = true; @@ -191,12 +191,12 @@ void Mixer::request_setting_sync() } } -BufferQueue::BufferQueue(ClientConnection& client) +ClientAudioStream::ClientAudioStream(ClientConnection& client) : m_client(client) { } -void BufferQueue::enqueue(NonnullRefPtr&& buffer) +void ClientAudioStream::enqueue(NonnullRefPtr&& buffer) { m_remaining_samples += buffer->sample_count(); m_queue.enqueue(move(buffer)); diff --git a/Userland/Services/AudioServer/Mixer.h b/Userland/Services/AudioServer/Mixer.h index 1b4c09a516..cf47523382 100644 --- a/Userland/Services/AudioServer/Mixer.h +++ b/Userland/Services/AudioServer/Mixer.h @@ -30,10 +30,10 @@ constexpr double SAMPLE_HEADROOM = 0.7; class ClientConnection; -class BufferQueue : public RefCounted { +class ClientAudioStream : public RefCounted { public: - explicit BufferQueue(ClientConnection&); - ~BufferQueue() { } + explicit ClientAudioStream(ClientConnection&); + ~ClientAudioStream() { } bool is_full() const { return m_queue.size() >= 3; } void enqueue(NonnullRefPtr&&); @@ -109,7 +109,7 @@ public: Mixer(NonnullRefPtr config); virtual ~Mixer() override; - NonnullRefPtr create_queue(ClientConnection&); + NonnullRefPtr create_queue(ClientConnection&); // To the outside world, we pretend that the target volume is already reached, even though it may be still fading. double main_volume() const { return m_main_volume.target(); } @@ -124,7 +124,7 @@ public: private: void request_setting_sync(); - Vector> m_pending_mixing; + Vector> m_pending_mixing; Atomic m_added_queue { false }; pthread_mutex_t m_pending_mutex; pthread_cond_t m_pending_cond; -- cgit v1.2.3