summaryrefslogtreecommitdiff
path: root/src/ui/include
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-10-18 14:35:28 +1100
committerjacqueline <me@jacqueline.id.au>2023-10-18 14:35:28 +1100
commit782e8dc8c25402171fc4724075b998eae4fa2c76 (patch)
treef710f8fe8e84f5a201410520f3f88364a19f76d8 /src/ui/include
parent2eb7eaa2a6a5d9ccfe7a0535858778dfb85997cb (diff)
downloadtangara-fw-782e8dc8c25402171fc4724075b998eae4fa2c76.tar.gz
Add better controls for queue manipulation
Diffstat (limited to 'src/ui/include')
-rw-r--r--src/ui/include/modal_add_to_queue.hpp5
-rw-r--r--src/ui/include/screen_track_browser.hpp11
-rw-r--r--src/ui/include/ui_events.hpp2
3 files changed, 14 insertions, 4 deletions
diff --git a/src/ui/include/modal_add_to_queue.hpp b/src/ui/include/modal_add_to_queue.hpp
index 79f804a4..e6417cd4 100644
--- a/src/ui/include/modal_add_to_queue.hpp
+++ b/src/ui/include/modal_add_to_queue.hpp
@@ -24,11 +24,12 @@ class AddToQueue : public Modal {
public:
AddToQueue(Screen*,
audio::TrackQueue&,
- std::shared_ptr<playlist::IndexRecordSource>);
+ std::shared_ptr<playlist::IResetableSource>,
+ bool all_tracks_only = false);
private:
audio::TrackQueue& queue_;
- std::shared_ptr<playlist::IndexRecordSource> item_;
+ std::shared_ptr<playlist::IResetableSource> item_;
lv_obj_t* container_;
lv_obj_t* selected_track_btn_;
diff --git a/src/ui/include/screen_track_browser.hpp b/src/ui/include/screen_track_browser.hpp
index 719306f0..0b2d6fc3 100644
--- a/src/ui/include/screen_track_browser.hpp
+++ b/src/ui/include/screen_track_browser.hpp
@@ -16,6 +16,7 @@
#include "database.hpp"
#include "model_top_bar.hpp"
#include "screen.hpp"
+#include "track_queue.hpp"
namespace ui {
namespace screens {
@@ -23,9 +24,10 @@ namespace screens {
class TrackBrowser : public Screen {
public:
TrackBrowser(
- models::TopBar&,
+ models::TopBar& top_bar,
+ audio::TrackQueue& queue,
std::weak_ptr<database::Database> db,
- const std::pmr::string& title,
+ const std::pmr::vector<std::pmr::string>& breadcrumbs,
std::future<database::Result<database::IndexRecord>*>&& initial_page);
~TrackBrowser() {}
@@ -49,11 +51,16 @@ class TrackBrowser : public Screen {
auto GetNumRecords() -> std::size_t;
auto GetItemIndex(lv_obj_t* obj) -> std::optional<std::size_t>;
+ audio::TrackQueue& queue_;
std::weak_ptr<database::Database> db_;
lv_obj_t* back_button_;
+ lv_obj_t* play_button_;
+ lv_obj_t* enqueue_button_;
lv_obj_t* list_;
lv_obj_t* loading_indicator_;
+ std::pmr::vector<std::pmr::string> breadcrumbs_;
+
std::optional<Position> loading_pos_;
std::optional<std::future<database::Result<database::IndexRecord>*>>
loading_page_;
diff --git a/src/ui/include/ui_events.hpp b/src/ui/include/ui_events.hpp
index 4549a51d..2bee6222 100644
--- a/src/ui/include/ui_events.hpp
+++ b/src/ui/include/ui_events.hpp
@@ -27,6 +27,8 @@ struct OnSystemError : tinyfsm::Event {};
namespace internal {
struct RecordSelected : tinyfsm::Event {
+ bool show_menu;
+ std::pmr::vector<std::pmr::string> new_crumbs;
std::shared_ptr<database::Result<database::IndexRecord>> initial_page;
std::shared_ptr<database::Result<database::IndexRecord>> page;
std::size_t record;