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/ui_fsm.hpp | |
| parent | 7eec2cc5b6e8fb1b3a11c09a2e324f83a8192860 (diff) | |
| download | tangara-fw-2f16d230025c3173cfbecc58b38d6a52b6b0f5f2.tar.gz | |
Start on wiring up playback screen to real data
Diffstat (limited to 'src/ui/include/ui_fsm.hpp')
| -rw-r--r-- | src/ui/include/ui_fsm.hpp | 13 |
1 files changed, 12 insertions, 1 deletions
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 |
