diff --git a/Applications/Piano/main.cpp b/Applications/Piano/main.cpp index b2880aef0e2fbe..b0d7d3f8f4bc90 100644 --- a/Applications/Piano/main.cpp +++ b/Applications/Piano/main.cpp @@ -41,7 +41,7 @@ int main(int argc, char** argv) { GUI::Application app(argc, argv); - auto audio_client = AClientConnection::construct(); + auto audio_client = Audio::ClientConnection::construct(); audio_client->handshake(); AudioEngine audio_engine; diff --git a/Applications/SoundPlayer/PlaybackManager.cpp b/Applications/SoundPlayer/PlaybackManager.cpp index ab153ecc304d39..2ba2c913807fd4 100644 --- a/Applications/SoundPlayer/PlaybackManager.cpp +++ b/Applications/SoundPlayer/PlaybackManager.cpp @@ -26,7 +26,7 @@ #include "PlaybackManager.h" -PlaybackManager::PlaybackManager(NonnullRefPtr connection) +PlaybackManager::PlaybackManager(NonnullRefPtr connection) : m_connection(connection) { m_timer = Core::Timer::construct(100, [&]() { @@ -41,7 +41,7 @@ PlaybackManager::~PlaybackManager() { } -void PlaybackManager::set_loader(OwnPtr&& loader) +void PlaybackManager::set_loader(OwnPtr&& loader) { stop(); m_loader = move(loader); diff --git a/Applications/SoundPlayer/PlaybackManager.h b/Applications/SoundPlayer/PlaybackManager.h index d58deea1bf5410..2a57171da4d0df 100644 --- a/Applications/SoundPlayer/PlaybackManager.h +++ b/Applications/SoundPlayer/PlaybackManager.h @@ -36,7 +36,7 @@ class PlaybackManager final { public: - PlaybackManager(NonnullRefPtr); + PlaybackManager(NonnullRefPtr); ~PlaybackManager(); void play(); @@ -44,14 +44,14 @@ class PlaybackManager final { void pause(); void seek(const int position); bool toggle_pause(); - void set_loader(OwnPtr&&); + void set_loader(OwnPtr&&); int last_seek() const { return m_last_seek; } bool is_paused() const { return m_paused; } float total_length() const { return m_total_length; } - RefPtr current_buffer() const { return m_current_buffer; } + RefPtr current_buffer() const { return m_current_buffer; } - NonnullRefPtr connection() const { return m_connection; } + NonnullRefPtr connection() const { return m_connection; } Function on_update; @@ -65,10 +65,10 @@ class PlaybackManager final { int m_next_ptr { 0 }; int m_last_seek { 0 }; float m_total_length { 0 }; - OwnPtr m_loader { nullptr }; - NonnullRefPtr m_connection; - RefPtr m_next_buffer; - RefPtr m_current_buffer; - Vector> m_buffers; + OwnPtr m_loader { nullptr }; + NonnullRefPtr m_connection; + RefPtr m_next_buffer; + RefPtr m_current_buffer; + Vector> m_buffers; RefPtr m_timer; }; diff --git a/Applications/SoundPlayer/SampleWidget.cpp b/Applications/SoundPlayer/SampleWidget.cpp index 846c841cfe30dd..0e9c9d3fa050cc 100644 --- a/Applications/SoundPlayer/SampleWidget.cpp +++ b/Applications/SoundPlayer/SampleWidget.cpp @@ -77,7 +77,7 @@ void SampleWidget::paint_event(GUI::PaintEvent& event) } } -void SampleWidget::set_buffer(ABuffer* buffer) +void SampleWidget::set_buffer(Audio::Buffer* buffer) { if (m_buffer == buffer) return; diff --git a/Applications/SoundPlayer/SampleWidget.h b/Applications/SoundPlayer/SampleWidget.h index 385021c855dc6e..8070409ec7762f 100644 --- a/Applications/SoundPlayer/SampleWidget.h +++ b/Applications/SoundPlayer/SampleWidget.h @@ -28,17 +28,19 @@ #include -class ABuffer; +namespace Audio { +class Buffer; +} class SampleWidget final : public GUI::Frame { C_OBJECT(SampleWidget) public: virtual ~SampleWidget() override; - void set_buffer(ABuffer*); + void set_buffer(Audio::Buffer*); private: explicit SampleWidget(GUI::Widget* parent); virtual void paint_event(GUI::PaintEvent&) override; - RefPtr m_buffer; + RefPtr m_buffer; }; diff --git a/Applications/SoundPlayer/SoundPlayerWidget.cpp b/Applications/SoundPlayer/SoundPlayerWidget.cpp index 3f5a53b1beadb0..db017494fd412d 100644 --- a/Applications/SoundPlayer/SoundPlayerWidget.cpp +++ b/Applications/SoundPlayer/SoundPlayerWidget.cpp @@ -32,7 +32,7 @@ #include #include -SoundPlayerWidget::SoundPlayerWidget(GUI::Window& window, NonnullRefPtr connection) +SoundPlayerWidget::SoundPlayerWidget(GUI::Window& window, NonnullRefPtr connection) : m_window(window) , m_connection(connection) , m_manager(connection) @@ -124,7 +124,7 @@ void SoundPlayerWidget::open_file(String path) return; } - OwnPtr loader = make(path); + OwnPtr loader = make(path); if (loader->has_error()) { GUI::MessageBox::show( String::format( diff --git a/Applications/SoundPlayer/SoundPlayerWidget.h b/Applications/SoundPlayer/SoundPlayerWidget.h index b9fd871b72f08e..5d7daa97398014 100644 --- a/Applications/SoundPlayer/SoundPlayerWidget.h +++ b/Applications/SoundPlayer/SoundPlayerWidget.h @@ -43,7 +43,7 @@ class SoundPlayerWidget final : public GUI::Widget { PlaybackManager& manager() { return m_manager; } private: - explicit SoundPlayerWidget(GUI::Window&, NonnullRefPtr); + explicit SoundPlayerWidget(GUI::Window&, NonnullRefPtr); void update_position(const int position); void update_ui(); @@ -77,7 +77,7 @@ class SoundPlayerWidget final : public GUI::Widget { }; GUI::Window& m_window; - NonnullRefPtr m_connection; + NonnullRefPtr m_connection; PlaybackManager m_manager; float m_sample_ratio; RefPtr m_status; diff --git a/Applications/SoundPlayer/main.cpp b/Applications/SoundPlayer/main.cpp index 1107bd2971d9d3..e308c7a0c76d4a 100644 --- a/Applications/SoundPlayer/main.cpp +++ b/Applications/SoundPlayer/main.cpp @@ -50,7 +50,7 @@ int main(int argc, char** argv) return 1; } - auto audio_client = AClientConnection::construct(); + auto audio_client = Audio::ClientConnection::construct(); audio_client->handshake(); if (pledge("stdio shared_buffer accept rpath", nullptr) < 0) { diff --git a/Libraries/LibAudio/ABuffer.h b/Libraries/LibAudio/ABuffer.h index 9633b7e369895f..af4e050ad59d77 100644 --- a/Libraries/LibAudio/ABuffer.h +++ b/Libraries/LibAudio/ABuffer.h @@ -31,24 +31,26 @@ #include #include +namespace Audio { + // A single sample in an audio buffer. // Values are floating point, and should range from -1.0 to +1.0 -struct ASample { - ASample() +struct Sample { + Sample() : left(0) , right(0) { } // For mono - ASample(float left) + Sample(float left) : left(left) , right(left) { } // For stereo - ASample(float left, float right) + Sample(float left, float right) : left(left) , right(right) { @@ -74,7 +76,7 @@ struct ASample { right *= pct; } - ASample& operator+=(const ASample& other) + Sample& operator+=(const Sample& other) { left += other.left; right += other.right; @@ -88,9 +90,9 @@ struct ASample { // Small helper to resample from one playback rate to another // This isn't really "smart", in that we just insert (or drop) samples. // Should do better... -class AResampleHelper { +class ResampleHelper { public: - AResampleHelper(float source, float target); + ResampleHelper(float source, float target); void process_sample(float sample_l, float sample_r); bool read_sample(float& next_l, float& next_r); @@ -103,34 +105,34 @@ class AResampleHelper { }; // A buffer of audio samples, normalized to 44100hz. -class ABuffer : public RefCounted { +class Buffer : public RefCounted { public: - static RefPtr from_pcm_data(ByteBuffer& data, AResampleHelper& resampler, int num_channels, int bits_per_sample); - static NonnullRefPtr create_with_samples(Vector&& samples) + static RefPtr from_pcm_data(ByteBuffer& data, ResampleHelper& resampler, int num_channels, int bits_per_sample); + static NonnullRefPtr create_with_samples(Vector&& samples) { - return adopt(*new ABuffer(move(samples))); + return adopt(*new Buffer(move(samples))); } - static NonnullRefPtr create_with_shared_buffer(NonnullRefPtr&& buffer, int sample_count) + static NonnullRefPtr create_with_shared_buffer(NonnullRefPtr&& buffer, int sample_count) { - return adopt(*new ABuffer(move(buffer), sample_count)); + return adopt(*new Buffer(move(buffer), sample_count)); } - const ASample* samples() const { return (const ASample*)data(); } + const Sample* samples() const { return (const Sample*)data(); } int sample_count() const { return m_sample_count; } const void* data() const { return m_buffer->data(); } - int size_in_bytes() const { return m_sample_count * (int)sizeof(ASample); } + int size_in_bytes() const { return m_sample_count * (int)sizeof(Sample); } int shared_buffer_id() const { return m_buffer->shared_buffer_id(); } SharedBuffer& shared_buffer() { return *m_buffer; } private: - explicit ABuffer(Vector&& samples) - : m_buffer(*SharedBuffer::create_with_size(samples.size() * sizeof(ASample))), + explicit Buffer(Vector&& samples) + : m_buffer(*SharedBuffer::create_with_size(samples.size() * sizeof(Sample))), m_sample_count(samples.size()) { - memcpy(m_buffer->data(), samples.data(), samples.size() * sizeof(ASample)); + memcpy(m_buffer->data(), samples.data(), samples.size() * sizeof(Sample)); } - explicit ABuffer(NonnullRefPtr&& buffer, int sample_count) + explicit Buffer(NonnullRefPtr&& buffer, int sample_count) : m_buffer(move(buffer)), m_sample_count(sample_count) { @@ -139,3 +141,5 @@ class ABuffer : public RefCounted { NonnullRefPtr m_buffer; const int m_sample_count; }; + +} diff --git a/Libraries/LibAudio/AClientConnection.cpp b/Libraries/LibAudio/AClientConnection.cpp index 0738a822b24ee4..b31565c57c530e 100644 --- a/Libraries/LibAudio/AClientConnection.cpp +++ b/Libraries/LibAudio/AClientConnection.cpp @@ -28,21 +28,23 @@ #include #include -AClientConnection::AClientConnection() +namespace Audio { + +ClientConnection::ClientConnection() : IPC::ServerConnection(*this, "/tmp/portal/audio") { } -void AClientConnection::handshake() +void ClientConnection::handshake() { auto response = send_sync(); set_my_client_id(response->client_id()); } -void AClientConnection::enqueue(const ABuffer& buffer) +void ClientConnection::enqueue(const Buffer& buffer) { for (;;) { - const_cast(buffer).shared_buffer().share_with(server_pid()); + const_cast(buffer).shared_buffer().share_with(server_pid()); auto response = send_sync(buffer.shared_buffer_id(), buffer.sample_count()); if (response->success()) break; @@ -50,66 +52,68 @@ void AClientConnection::enqueue(const ABuffer& buffer) } } -bool AClientConnection::try_enqueue(const ABuffer& buffer) +bool ClientConnection::try_enqueue(const Buffer& buffer) { - const_cast(buffer).shared_buffer().share_with(server_pid()); + const_cast(buffer).shared_buffer().share_with(server_pid()); auto response = send_sync(buffer.shared_buffer_id(), buffer.sample_count()); return response->success(); } -bool AClientConnection::get_muted() +bool ClientConnection::get_muted() { return send_sync()->muted(); } -void AClientConnection::set_muted(bool muted) +void ClientConnection::set_muted(bool muted) { send_sync(muted); } -int AClientConnection::get_main_mix_volume() +int ClientConnection::get_main_mix_volume() { return send_sync()->volume(); } -void AClientConnection::set_main_mix_volume(int volume) +void ClientConnection::set_main_mix_volume(int volume) { send_sync(volume); } -int AClientConnection::get_remaining_samples() +int ClientConnection::get_remaining_samples() { return send_sync()->remaining_samples(); } -int AClientConnection::get_played_samples() +int ClientConnection::get_played_samples() { return send_sync()->played_samples(); } -void AClientConnection::set_paused(bool paused) +void ClientConnection::set_paused(bool paused) { send_sync(paused); } -void AClientConnection::clear_buffer(bool paused) +void ClientConnection::clear_buffer(bool paused) { send_sync(paused); } -int AClientConnection::get_playing_buffer() +int ClientConnection::get_playing_buffer() { return send_sync()->buffer_id(); } -void AClientConnection::handle(const AudioClient::FinishedPlayingBuffer& message) +void ClientConnection::handle(const AudioClient::FinishedPlayingBuffer& message) { if (on_finish_playing_buffer) on_finish_playing_buffer(message.buffer_id()); } -void AClientConnection::handle(const AudioClient::MutedStateChanged& message) +void ClientConnection::handle(const AudioClient::MutedStateChanged& message) { if (on_muted_state_change) on_muted_state_change(message.muted()); } + +} diff --git a/Libraries/LibAudio/AClientConnection.h b/Libraries/LibAudio/AClientConnection.h index 147e431f1b15d2..a3feb6177409c5 100644 --- a/Libraries/LibAudio/AClientConnection.h +++ b/Libraries/LibAudio/AClientConnection.h @@ -30,17 +30,19 @@ #include #include -class ABuffer; +namespace Audio { -class AClientConnection : public IPC::ServerConnection +class Buffer; + +class ClientConnection : public IPC::ServerConnection , public AudioClientEndpoint { - C_OBJECT(AClientConnection) + C_OBJECT(ClientConnection) public: - AClientConnection(); + ClientConnection(); virtual void handshake() override; - void enqueue(const ABuffer&); - bool try_enqueue(const ABuffer&); + void enqueue(const Buffer&); + bool try_enqueue(const Buffer&); bool get_muted(); void set_muted(bool); @@ -62,3 +64,5 @@ class AClientConnection : public IPC::ServerConnection #include -AWavLoader::AWavLoader(const StringView& path) +namespace Audio { + +WavLoader::WavLoader(const StringView& path) : m_file(Core::File::construct(path)) { if (!m_file->open(Core::IODevice::ReadOnly)) { @@ -39,10 +41,10 @@ AWavLoader::AWavLoader(const StringView& path) } parse_header(); - m_resampler = make(m_sample_rate, 44100); + m_resampler = make(m_sample_rate, 44100); } -RefPtr AWavLoader::get_more_samples(size_t max_bytes_to_read_from_input) +RefPtr WavLoader::get_more_samples(size_t max_bytes_to_read_from_input) { #ifdef AWAVLOADER_DEBUG dbgprintf("Read WAV of format PCM with num_channels %u sample rate %u, bits per sample %u\n", m_num_channels, m_sample_rate, m_bits_per_sample); @@ -52,14 +54,14 @@ RefPtr AWavLoader::get_more_samples(size_t max_bytes_to_read_from_input if (raw_samples.is_empty()) return nullptr; - auto buffer = ABuffer::from_pcm_data(raw_samples, *m_resampler, m_num_channels, m_bits_per_sample); + auto buffer = Buffer::from_pcm_data(raw_samples, *m_resampler, m_num_channels, m_bits_per_sample); //Buffer contains normalized samples, but m_loaded_samples should containt the ammount of actually loaded samples m_loaded_samples += static_cast(max_bytes_to_read_from_input) / (m_num_channels * (m_bits_per_sample / 8)); m_loaded_samples = min(m_total_samples, m_loaded_samples); return buffer; } -void AWavLoader::seek(const int position) +void WavLoader::seek(const int position) { if (position < 0 || position > m_total_samples) return; @@ -68,12 +70,12 @@ void AWavLoader::seek(const int position) m_file->seek(position * m_num_channels * (m_bits_per_sample / 8)); } -void AWavLoader::reset() +void WavLoader::reset() { seek(0); } -bool AWavLoader::parse_header() +bool WavLoader::parse_header() { Core::IODeviceStreamReader stream(*m_file); @@ -179,19 +181,19 @@ bool AWavLoader::parse_header() return true; } -AResampleHelper::AResampleHelper(float source, float target) +ResampleHelper::ResampleHelper(float source, float target) : m_ratio(source / target) { } -void AResampleHelper::process_sample(float sample_l, float sample_r) +void ResampleHelper::process_sample(float sample_l, float sample_r) { m_last_sample_l = sample_l; m_last_sample_r = sample_r; m_current_ratio += 1; } -bool AResampleHelper::read_sample(float& next_l, float& next_r) +bool ResampleHelper::read_sample(float& next_l, float& next_r) { if (m_current_ratio > 0) { m_current_ratio -= m_ratio; @@ -204,7 +206,7 @@ bool AResampleHelper::read_sample(float& next_l, float& next_r) } template -static void read_samples_from_stream(BufferStream& stream, SampleReader read_sample, Vector& samples, AResampleHelper& resampler, int num_channels) +static void read_samples_from_stream(BufferStream& stream, SampleReader read_sample, Vector& samples, ResampleHelper& resampler, int num_channels) { float norm_l = 0; float norm_r = 0; @@ -213,7 +215,7 @@ static void read_samples_from_stream(BufferStream& stream, SampleReader read_sam case 1: for (;;) { while (resampler.read_sample(norm_l, norm_r)) { - samples.append(ASample(norm_l)); + samples.append(Sample(norm_l)); } norm_l = read_sample(stream); @@ -226,7 +228,7 @@ static void read_samples_from_stream(BufferStream& stream, SampleReader read_sam case 2: for (;;) { while (resampler.read_sample(norm_l, norm_r)) { - samples.append(ASample(norm_l, norm_r)); + samples.append(Sample(norm_l, norm_r)); } norm_l = read_sample(stream); norm_r = read_sample(stream); @@ -276,10 +278,10 @@ static float read_norm_sample_8(BufferStream& stream) // ### can't const this because BufferStream is non-const // perhaps we need a reading class separate from the writing one, that can be // entirely consted. -RefPtr ABuffer::from_pcm_data(ByteBuffer& data, AResampleHelper& resampler, int num_channels, int bits_per_sample) +RefPtr Buffer::from_pcm_data(ByteBuffer& data, ResampleHelper& resampler, int num_channels, int bits_per_sample) { BufferStream stream(data); - Vector fdata; + Vector fdata; fdata.ensure_capacity(data.size() / (bits_per_sample / 8)); #ifdef AWAVLOADER_DEBUG dbg() << "Reading " << bits_per_sample << " bits and " << num_channels << " channels, total bytes: " << data.size(); @@ -304,5 +306,7 @@ RefPtr ABuffer::from_pcm_data(ByteBuffer& data, AResampleHelper& resamp // don't belong. ASSERT(!stream.handle_read_failure()); - return ABuffer::create_with_samples(move(fdata)); + return Buffer::create_with_samples(move(fdata)); +} + } diff --git a/Libraries/LibAudio/AWavLoader.h b/Libraries/LibAudio/AWavLoader.h index 8b6b553879d441..7b3eb2f7fc39ef 100644 --- a/Libraries/LibAudio/AWavLoader.h +++ b/Libraries/LibAudio/AWavLoader.h @@ -26,27 +26,28 @@ #pragma once -#include #include +#include #include -#include #include - -class ABuffer; +#include namespace AK { class ByteBuffer; } -// Parses a WAV file and produces an ABuffer instance from it -class AWavLoader { +namespace Audio { +class Buffer; + +// Parses a WAV file and produces an Audio::Buffer. +class WavLoader { public: - explicit AWavLoader(const StringView& path); + explicit WavLoader(const StringView& path); bool has_error() const { return !m_error_string.is_null(); } const char* error_string() { return m_error_string.characters(); } - RefPtr get_more_samples(size_t max_bytes_to_read_from_input = 128 * KB); + RefPtr get_more_samples(size_t max_bytes_to_read_from_input = 128 * KB); void reset(); void seek(const int position); @@ -62,7 +63,7 @@ class AWavLoader { bool parse_header(); RefPtr m_file; String m_error_string; - OwnPtr m_resampler; + OwnPtr m_resampler; u32 m_sample_rate { 0 }; u16 m_num_channels { 0 }; @@ -71,3 +72,5 @@ class AWavLoader { int m_loaded_samples { 0 }; int m_total_samples { 0 }; }; + +} diff --git a/MenuApplets/Audio/main.cpp b/MenuApplets/Audio/main.cpp index 5b777b557f476c..aaa7e8bc902429 100644 --- a/MenuApplets/Audio/main.cpp +++ b/MenuApplets/Audio/main.cpp @@ -36,7 +36,7 @@ class AudioWidget final : public GUI::Widget { AudioWidget() : GUI::Widget(nullptr) { - m_audio_client = make(); + m_audio_client = make(); m_audio_client->on_muted_state_change = [this](bool muted) { if (m_audio_muted == muted) return; @@ -67,7 +67,7 @@ class AudioWidget final : public GUI::Widget { painter.blit({}, audio_bitmap, audio_bitmap.rect()); } - OwnPtr m_audio_client; + OwnPtr m_audio_client; RefPtr m_muted_bitmap; RefPtr m_unmuted_bitmap; bool m_audio_muted { false }; diff --git a/Servers/AudioServer/ASClientConnection.cpp b/Servers/AudioServer/ASClientConnection.cpp index a231e1b91ccd7d..2eedfc9a51509e 100644 --- a/Servers/AudioServer/ASClientConnection.cpp +++ b/Servers/AudioServer/ASClientConnection.cpp @@ -105,7 +105,7 @@ OwnPtr ASClientConnection::handle(const Audi if (m_queue->is_full()) return make(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(true); } diff --git a/Servers/AudioServer/ASClientConnection.h b/Servers/AudioServer/ASClientConnection.h index a55880eaed3440..608e360853eb55 100644 --- a/Servers/AudioServer/ASClientConnection.h +++ b/Servers/AudioServer/ASClientConnection.h @@ -29,7 +29,10 @@ #include #include -class ABuffer; +namespace Audio { +class Buffer; +} + class ASBufferQueue; class ASMixer; diff --git a/Servers/AudioServer/ASMixer.cpp b/Servers/AudioServer/ASMixer.cpp index 2b0fff83bb7a27..01730c902749a7 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&& buffer) +void ASBufferQueue::enqueue(NonnullRefPtr&& 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 5fd0ef0441d3e5..fdd599a246905d 100644 --- a/Servers/AudioServer/ASMixer.h +++ b/Servers/AudioServer/ASMixer.h @@ -45,9 +45,9 @@ class ASBufferQueue : public RefCounted { ~ASBufferQueue() {} bool is_full() const { return m_queue.size() >= 3; } - void enqueue(NonnullRefPtr&&); + void enqueue(NonnullRefPtr&&); - bool get_next_sample(ASample& sample) + bool get_next_sample(Audio::Sample& sample) { if (m_paused) return false; @@ -97,8 +97,8 @@ class ASBufferQueue : public RefCounted { } private: - RefPtr m_current; - Queue> m_queue; + RefPtr m_current; + Queue> m_queue; int m_position { 0 }; int m_remaining_samples { 0 }; int m_played_samples { 0 }; diff --git a/Userland/aplay.cpp b/Userland/aplay.cpp index eb1c1497b2b9c9..47b49eac682b7c 100644 --- a/Userland/aplay.cpp +++ b/Userland/aplay.cpp @@ -38,9 +38,9 @@ int main(int argc, char** argv) return 1; } - auto audio_client = AClientConnection::construct(); + auto audio_client = Audio::ClientConnection::construct(); audio_client->handshake(); - AWavLoader loader(argv[1]); + Audio::WavLoader loader(argv[1]); printf("\033[34;1m Playing\033[0m: %s\n", argv[1]); printf("\033[34;1m Format\033[0m: %u Hz, %u-bit, %s\n", diff --git a/Userland/avol.cpp b/Userland/avol.cpp index 65eb78bf599dba..8fa51c3587568b 100644 --- a/Userland/avol.cpp +++ b/Userland/avol.cpp @@ -31,7 +31,7 @@ int main(int argc, char** argv) { Core::EventLoop loop; - auto audio_client = AClientConnection::construct(); + auto audio_client = Audio::ClientConnection::construct(); audio_client->handshake(); if (argc > 1) {