From b0aa9ab391143a8139373e42ea95ccb6ed14ce60 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 12 Sep 2023 14:43:28 +1000 Subject: Fix ui nits for playback screen The top bar now updates properly when starting playback, and the upcoming list items no longer marquee. --- src/ui/ui_fsm.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/ui/ui_fsm.cpp') diff --git a/src/ui/ui_fsm.cpp b/src/ui/ui_fsm.cpp index eeaea500..104f4f1f 100644 --- a/src/ui/ui_fsm.cpp +++ b/src/ui/ui_fsm.cpp @@ -91,6 +91,14 @@ void UiState::react(const system_fsm::BatteryStateChanged&) { UpdateTopBar(); } +void UiState::react(const audio::PlaybackStarted&) { + UpdateTopBar(); +} + +void UiState::react(const audio::PlaybackFinished&) { + UpdateTopBar(); +} + void UiState::UpdateTopBar() { auto battery_state = sServices->battery().State(); bool has_queue = sServices->track_queue().GetCurrent().has_value(); @@ -260,18 +268,17 @@ void Playing::exit() { } void Playing::react(const audio::PlaybackStarted& ev) { - vTaskPrioritySet(NULL, 0); UpdateTopBar(); sPlayingScreen->OnTrackUpdate(); } -void Playing::react(const audio::PlaybackUpdate& ev) { - sPlayingScreen->OnPlaybackUpdate(ev.seconds_elapsed, ev.seconds_total); -} - void Playing::react(const audio::PlaybackFinished& ev) { UpdateTopBar(); - vTaskPrioritySet(NULL, 10); + sPlayingScreen->OnTrackUpdate(); +} + +void Playing::react(const audio::PlaybackUpdate& ev) { + sPlayingScreen->OnPlaybackUpdate(ev.seconds_elapsed, ev.seconds_total); } void Playing::react(const audio::QueueUpdate& ev) { -- cgit v1.2.3