diff options
Diffstat (limited to 'Applications/SoundPlayer')
-rw-r--r-- | Applications/SoundPlayer/PlaybackManager.cpp | 4 | ||||
-rw-r--r-- | Applications/SoundPlayer/PlaybackManager.h | 18 | ||||
-rw-r--r-- | Applications/SoundPlayer/SampleWidget.cpp | 2 | ||||
-rw-r--r-- | Applications/SoundPlayer/SampleWidget.h | 8 | ||||
-rw-r--r-- | Applications/SoundPlayer/SoundPlayerWidget.cpp | 4 | ||||
-rw-r--r-- | Applications/SoundPlayer/SoundPlayerWidget.h | 4 | ||||
-rw-r--r-- | Applications/SoundPlayer/main.cpp | 2 |
7 files changed, 22 insertions, 20 deletions
diff --git a/Applications/SoundPlayer/PlaybackManager.cpp b/Applications/SoundPlayer/PlaybackManager.cpp index ab153ecc30..2ba2c91380 100644 --- a/Applications/SoundPlayer/PlaybackManager.cpp +++ b/Applications/SoundPlayer/PlaybackManager.cpp @@ -26,7 +26,7 @@ #include "PlaybackManager.h" -PlaybackManager::PlaybackManager(NonnullRefPtr<AClientConnection> connection) +PlaybackManager::PlaybackManager(NonnullRefPtr<Audio::ClientConnection> connection) : m_connection(connection) { m_timer = Core::Timer::construct(100, [&]() { @@ -41,7 +41,7 @@ PlaybackManager::~PlaybackManager() { } -void PlaybackManager::set_loader(OwnPtr<AWavLoader>&& loader) +void PlaybackManager::set_loader(OwnPtr<Audio::WavLoader>&& loader) { stop(); m_loader = move(loader); diff --git a/Applications/SoundPlayer/PlaybackManager.h b/Applications/SoundPlayer/PlaybackManager.h index d58deea1bf..2a57171da4 100644 --- a/Applications/SoundPlayer/PlaybackManager.h +++ b/Applications/SoundPlayer/PlaybackManager.h @@ -36,7 +36,7 @@ class PlaybackManager final { public: - PlaybackManager(NonnullRefPtr<AClientConnection>); + PlaybackManager(NonnullRefPtr<Audio::ClientConnection>); ~PlaybackManager(); void play(); @@ -44,14 +44,14 @@ public: void pause(); void seek(const int position); bool toggle_pause(); - void set_loader(OwnPtr<AWavLoader>&&); + void set_loader(OwnPtr<Audio::WavLoader>&&); int last_seek() const { return m_last_seek; } bool is_paused() const { return m_paused; } float total_length() const { return m_total_length; } - RefPtr<ABuffer> current_buffer() const { return m_current_buffer; } + RefPtr<Audio::Buffer> current_buffer() const { return m_current_buffer; } - NonnullRefPtr<AClientConnection> connection() const { return m_connection; } + NonnullRefPtr<Audio::ClientConnection> connection() const { return m_connection; } Function<void()> on_update; @@ -65,10 +65,10 @@ private: int m_next_ptr { 0 }; int m_last_seek { 0 }; float m_total_length { 0 }; - OwnPtr<AWavLoader> m_loader { nullptr }; - NonnullRefPtr<AClientConnection> m_connection; - RefPtr<ABuffer> m_next_buffer; - RefPtr<ABuffer> m_current_buffer; - Vector<RefPtr<ABuffer>> m_buffers; + OwnPtr<Audio::WavLoader> m_loader { nullptr }; + NonnullRefPtr<Audio::ClientConnection> m_connection; + RefPtr<Audio::Buffer> m_next_buffer; + RefPtr<Audio::Buffer> m_current_buffer; + Vector<RefPtr<Audio::Buffer>> m_buffers; RefPtr<Core::Timer> m_timer; }; diff --git a/Applications/SoundPlayer/SampleWidget.cpp b/Applications/SoundPlayer/SampleWidget.cpp index 846c841cfe..0e9c9d3fa0 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 385021c855..8070409ec7 100644 --- a/Applications/SoundPlayer/SampleWidget.h +++ b/Applications/SoundPlayer/SampleWidget.h @@ -28,17 +28,19 @@ #include <LibGUI/GFrame.h> -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<ABuffer> m_buffer; + RefPtr<Audio::Buffer> m_buffer; }; diff --git a/Applications/SoundPlayer/SoundPlayerWidget.cpp b/Applications/SoundPlayer/SoundPlayerWidget.cpp index 3f5a53b1be..db017494fd 100644 --- a/Applications/SoundPlayer/SoundPlayerWidget.cpp +++ b/Applications/SoundPlayer/SoundPlayerWidget.cpp @@ -32,7 +32,7 @@ #include <LibGUI/GMessageBox.h> #include <LibM/math.h> -SoundPlayerWidget::SoundPlayerWidget(GUI::Window& window, NonnullRefPtr<AClientConnection> connection) +SoundPlayerWidget::SoundPlayerWidget(GUI::Window& window, NonnullRefPtr<Audio::ClientConnection> connection) : m_window(window) , m_connection(connection) , m_manager(connection) @@ -124,7 +124,7 @@ void SoundPlayerWidget::open_file(String path) return; } - OwnPtr<AWavLoader> loader = make<AWavLoader>(path); + OwnPtr<Audio::WavLoader> loader = make<Audio::WavLoader>(path); if (loader->has_error()) { GUI::MessageBox::show( String::format( diff --git a/Applications/SoundPlayer/SoundPlayerWidget.h b/Applications/SoundPlayer/SoundPlayerWidget.h index b9fd871b72..5d7daa9739 100644 --- a/Applications/SoundPlayer/SoundPlayerWidget.h +++ b/Applications/SoundPlayer/SoundPlayerWidget.h @@ -43,7 +43,7 @@ public: PlaybackManager& manager() { return m_manager; } private: - explicit SoundPlayerWidget(GUI::Window&, NonnullRefPtr<AClientConnection>); + explicit SoundPlayerWidget(GUI::Window&, NonnullRefPtr<Audio::ClientConnection>); void update_position(const int position); void update_ui(); @@ -77,7 +77,7 @@ private: }; GUI::Window& m_window; - NonnullRefPtr<AClientConnection> m_connection; + NonnullRefPtr<Audio::ClientConnection> m_connection; PlaybackManager m_manager; float m_sample_ratio; RefPtr<GUI::Label> m_status; diff --git a/Applications/SoundPlayer/main.cpp b/Applications/SoundPlayer/main.cpp index 1107bd2971..e308c7a0c7 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) { |