summaryrefslogtreecommitdiff
path: root/src/ui/include/screen_track_browser.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-11-24 15:13:10 +1100
committerjacqueline <me@jacqueline.id.au>2023-11-24 15:13:10 +1100
commit7c6eb2997cbba350e7384151e13659271508e08f (patch)
treeb6f95a4843521e69b24cbf4c126d84442d19fc23 /src/ui/include/screen_track_browser.hpp
parent230721cd6271f3239b42e1d2471f8db15bebd712 (diff)
downloadtangara-fw-7c6eb2997cbba350e7384151e13659271508e08f.tar.gz
Migrate 'now playing' screen to lua
Diffstat (limited to 'src/ui/include/screen_track_browser.hpp')
-rw-r--r--src/ui/include/screen_track_browser.hpp74
1 files changed, 0 insertions, 74 deletions
diff --git a/src/ui/include/screen_track_browser.hpp b/src/ui/include/screen_track_browser.hpp
deleted file mode 100644
index 0b2d6fc3..00000000
--- a/src/ui/include/screen_track_browser.hpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2023 jacqueline <me@jacqueline.id.au>
- *
- * SPDX-License-Identifier: GPL-3.0-only
- */
-
-#pragma once
-
-#include <deque>
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "lvgl.h"
-
-#include "database.hpp"
-#include "model_top_bar.hpp"
-#include "screen.hpp"
-#include "track_queue.hpp"
-
-namespace ui {
-namespace screens {
-
-class TrackBrowser : public Screen {
- public:
- TrackBrowser(
- models::TopBar& top_bar,
- audio::TrackQueue& queue,
- std::weak_ptr<database::Database> db,
- const std::pmr::vector<std::pmr::string>& breadcrumbs,
- std::future<database::Result<database::IndexRecord>*>&& initial_page);
- ~TrackBrowser() {}
-
- auto Tick() -> void override;
-
- auto OnItemSelected(lv_event_t* ev) -> void;
- auto OnItemClicked(lv_event_t* ev) -> void;
-
- private:
- enum Position {
- START = 0,
- END = 1,
- };
- auto AddLoadingIndictor(Position pos) -> void;
- auto AddResults(Position pos,
- std::shared_ptr<database::Result<database::IndexRecord>>)
- -> void;
- auto DropPage(Position pos) -> void;
- auto FetchNewPage(Position pos) -> void;
-
- 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_;
-
- std::shared_ptr<database::Result<database::IndexRecord>> initial_page_;
- std::deque<std::shared_ptr<database::Result<database::IndexRecord>>>
- current_pages_;
-};
-
-} // namespace screens
-} // namespace ui