diff options
author | kleines Filmröllchen <malu.bertsch@gmail.com> | 2021-08-27 23:52:43 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-09-12 23:38:57 +0200 |
commit | 5300c9e6b4203b45ef86af89a917689740336e42 (patch) | |
tree | 6c21ba20ebb432083451854ad8104ee5f6e17b15 /Userland/Services/AudioServer | |
parent | ab4a2b8b4121fbe640bd13a6468618f463544ec2 (diff) | |
download | serenity-5300c9e6b4203b45ef86af89a917689740336e42.zip |
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.
Diffstat (limited to 'Userland/Services/AudioServer')
-rw-r--r-- | Userland/Services/AudioServer/ClientConnection.cpp | 2 | ||||
-rw-r--r-- | Userland/Services/AudioServer/ClientConnection.h | 4 | ||||
-rw-r--r-- | Userland/Services/AudioServer/Mixer.cpp | 8 | ||||
-rw-r--r-- | Userland/Services/AudioServer/Mixer.h | 10 |
4 files changed, 12 insertions, 12 deletions
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<BufferQueue>, int buffer_id) +void ClientConnection::did_finish_playing_buffer(Badge<ClientAudioStream>, 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<AudioClientEndpoint, AudioServerEndpoint> { @@ -49,7 +49,7 @@ private: virtual Messages::AudioServer::GetSampleRateResponse get_sample_rate() override; Mixer& m_mixer; - RefPtr<BufferQueue> m_queue; + RefPtr<ClientAudioStream> 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<BufferQueue> Mixer::create_queue(ClientConnection& client) +NonnullRefPtr<ClientAudioStream> 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<Audio::Buffer>&& buffer) +void ClientAudioStream::enqueue(NonnullRefPtr<Audio::Buffer>&& 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<BufferQueue> { +class ClientAudioStream : public RefCounted<ClientAudioStream> { public: - explicit BufferQueue(ClientConnection&); - ~BufferQueue() { } + explicit ClientAudioStream(ClientConnection&); + ~ClientAudioStream() { } bool is_full() const { return m_queue.size() >= 3; } void enqueue(NonnullRefPtr<Audio::Buffer>&&); @@ -109,7 +109,7 @@ public: Mixer(NonnullRefPtr<Core::ConfigFile> config); virtual ~Mixer() override; - NonnullRefPtr<BufferQueue> create_queue(ClientConnection&); + NonnullRefPtr<ClientAudioStream> 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<NonnullRefPtr<BufferQueue>> m_pending_mixing; + Vector<NonnullRefPtr<ClientAudioStream>> m_pending_mixing; Atomic<bool> m_added_queue { false }; pthread_mutex_t m_pending_mutex; pthread_cond_t m_pending_cond; |