mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:37:35 +00:00
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.
This commit is contained in:
parent
ab4a2b8b41
commit
5300c9e6b4
4 changed files with 12 additions and 12 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue