summaryrefslogtreecommitdiff
path: root/src/ui/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/include')
-rw-r--r--src/ui/include/screen_playing.hpp7
-rw-r--r--src/ui/include/ui_fsm.hpp13
2 files changed, 19 insertions, 1 deletions
diff --git a/src/ui/include/screen_playing.hpp b/src/ui/include/screen_playing.hpp
index 3eae32a7..5ccfe391 100644
--- a/src/ui/include/screen_playing.hpp
+++ b/src/ui/include/screen_playing.hpp
@@ -6,12 +6,15 @@
#pragma once
+#include <stdint.h>
#include <memory>
+#include <vector>
#include "lvgl.h"
#include "database.hpp"
#include "screen.hpp"
+#include "track.hpp"
namespace ui {
namespace screens {
@@ -23,6 +26,9 @@ class Playing : public Screen {
auto BindTrack(database::Track t) -> void;
+ auto UpdateTime(uint32_t) -> void;
+ auto UpdateNextUp(std::vector<database::Track> tracks) -> void;
+
private:
database::Track track_;
@@ -34,6 +40,7 @@ class Playing : public Screen {
lv_obj_t* play_pause_control_;
lv_obj_t* next_up_container_;
+ std::vector<database::Track> next_tracks_;
};
} // namespace screens
diff --git a/src/ui/include/ui_fsm.hpp b/src/ui/include/ui_fsm.hpp
index 32275fab..cd1ec492 100644
--- a/src/ui/include/ui_fsm.hpp
+++ b/src/ui/include/ui_fsm.hpp
@@ -9,7 +9,9 @@
#include <memory>
#include <stack>
+#include "audio_events.hpp"
#include "relative_wheel.hpp"
+#include "screen_playing.hpp"
#include "tinyfsm.hpp"
#include "display.hpp"
@@ -37,6 +39,8 @@ class UiState : public tinyfsm::Fsm<UiState> {
/* Fallback event handler. Does nothing. */
void react(const tinyfsm::Event& ev) {}
+ virtual void react(const audio::PlaybackUpdate){};
+
virtual void react(const system_fsm::KeyLockChanged&){};
virtual void react(const internal::RecordSelected&){};
@@ -57,6 +61,7 @@ class UiState : public tinyfsm::Fsm<UiState> {
static std::stack<std::shared_ptr<Screen>> sScreens;
static std::shared_ptr<Screen> sCurrentScreen;
+ static std::unique_ptr<screens::Playing> sPlayingScreen;
};
namespace states {
@@ -68,7 +73,7 @@ class Splash : public UiState {
using UiState::react;
};
-class Interactive : public UiState {
+class Browse : public UiState {
void entry() override;
void react(const internal::RecordSelected&) override;
@@ -78,6 +83,12 @@ class Interactive : public UiState {
void react(const system_fsm::StorageMounted&) override;
};
+class Playing : public UiState {
+ void entry() override;
+
+ void react(const audio::PlaybackUpdate) override;
+};
+
class FatalError : public UiState {};
} // namespace states