2021-07-11 05:58:17 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, JJ Roberts-White <computerfido@gmail.com>
|
2022-02-10 22:28:48 +03:00
|
|
|
* Copyright (c) 2022, the SerenityOS developers.
|
2021-07-11 05:58:17 +03:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibGUI/Toolbar.h>
|
|
|
|
|
|
|
|
class AudioPlayerLoop;
|
|
|
|
class TrackManager;
|
|
|
|
|
|
|
|
class PlayerWidget final : public GUI::Toolbar {
|
|
|
|
C_OBJECT(PlayerWidget)
|
|
|
|
public:
|
2022-02-10 22:28:48 +03:00
|
|
|
virtual ~PlayerWidget() override = default;
|
2021-07-11 05:58:17 +03:00
|
|
|
|
2021-12-05 07:42:35 +03:00
|
|
|
void add_track();
|
|
|
|
void next_track();
|
2021-12-20 20:26:20 +03:00
|
|
|
void toggle_paused();
|
2021-12-05 07:42:35 +03:00
|
|
|
|
2021-07-11 05:58:17 +03:00
|
|
|
private:
|
|
|
|
explicit PlayerWidget(TrackManager&, AudioPlayerLoop&);
|
|
|
|
|
|
|
|
TrackManager& m_track_manager;
|
|
|
|
AudioPlayerLoop& m_audio_loop;
|
2022-12-04 21:02:33 +03:00
|
|
|
Vector<DeprecatedString> m_track_number_choices;
|
2021-07-11 05:58:17 +03:00
|
|
|
|
|
|
|
RefPtr<Gfx::Bitmap> m_play_icon;
|
|
|
|
RefPtr<Gfx::Bitmap> m_pause_icon;
|
|
|
|
RefPtr<Gfx::Bitmap> m_back_icon;
|
|
|
|
RefPtr<Gfx::Bitmap> m_next_icon;
|
2021-12-05 07:42:35 +03:00
|
|
|
RefPtr<Gfx::Bitmap> m_add_track_icon;
|
|
|
|
RefPtr<Gfx::Bitmap> m_next_track_icon;
|
2021-07-11 05:58:17 +03:00
|
|
|
|
2021-12-05 07:42:35 +03:00
|
|
|
RefPtr<GUI::ComboBox> m_track_dropdown;
|
2021-07-11 05:58:17 +03:00
|
|
|
RefPtr<GUI::Button> m_play_button;
|
|
|
|
RefPtr<GUI::Button> m_back_button;
|
|
|
|
RefPtr<GUI::Button> m_next_button;
|
2021-12-05 07:42:35 +03:00
|
|
|
RefPtr<GUI::Button> m_add_track_button;
|
|
|
|
RefPtr<GUI::Button> m_next_track_button;
|
2021-07-11 05:58:17 +03:00
|
|
|
};
|