diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-07-05 20:09:03 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-07-05 20:09:03 +1000 |
| commit | 2f16d230025c3173cfbecc58b38d6a52b6b0f5f2 (patch) | |
| tree | 28cd9943eacc34c7b6701f0509a4eea471bada2d /src/ui/include | |
| parent | 7eec2cc5b6e8fb1b3a11c09a2e324f83a8192860 (diff) | |
| download | tangara-fw-2f16d230025c3173cfbecc58b38d6a52b6b0f5f2.tar.gz | |
Start on wiring up playback screen to real data
Diffstat (limited to 'src/ui/include')
| -rw-r--r-- | src/ui/include/screen_playing.hpp | 7 | ||||
| -rw-r--r-- | src/ui/include/ui_fsm.hpp | 13 |
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 |
