1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:47:34 +00:00

AudioPlayer: Further decouple the player from the GUI

This commit is contained in:
Cesar Torres 2021-03-24 00:12:50 +01:00 committed by Andreas Kling
parent f9e4bff487
commit e4d6a56a28
6 changed files with 136 additions and 76 deletions

View file

@ -40,16 +40,15 @@ class SoundPlayerWidget final : public GUI::Widget
, public Player {
C_OBJECT(SoundPlayerWidget)
public:
virtual ~SoundPlayerWidget() override;
~SoundPlayerWidget() override;
void open_file(StringView path) override;
void play() override;
void hide_scope(bool);
Audio::ClientConnection& client_connection() override { return m_connection; }
PlaybackManager& playback_manager() override { return m_manager; }
private:
explicit SoundPlayerWidget(GUI::Window& window, Audio::ClientConnection& connection, PlaybackManager& manager);
explicit SoundPlayerWidget(GUI::Window& window, PlayerState& state);
virtual void drop_event(GUI::DropEvent&) override;
void drop_event(GUI::DropEvent&) override;
void update_position(const int position);
void update_ui();
@ -57,8 +56,6 @@ private:
int denormalize_rate(int) const;
GUI::Window& m_window;
Audio::ClientConnection& m_connection;
PlaybackManager& m_manager;
float m_sample_ratio { 1.0 };
RefPtr<GUI::Label> m_status;