From 5c04e2ad8d14616ce3ca09b658d25bab3d8d2460 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Wed, 4 Oct 2023 10:18:31 +1100 Subject: Neaten up the various kinds of inputs, and move volumes to The New Way --- src/audio/audio_fsm.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/audio/audio_fsm.cpp') diff --git a/src/audio/audio_fsm.cpp b/src/audio/audio_fsm.cpp index 6ea4f60d..e470300f 100644 --- a/src/audio/audio_fsm.cpp +++ b/src/audio/audio_fsm.cpp @@ -50,16 +50,14 @@ std::shared_ptr AudioState::sOutput; std::optional AudioState::sCurrentTrack; -void AudioState::react(const system_fsm::KeyUpChanged& ev) { - if (ev.falling && sOutput->AdjustVolumeUp()) { - ESP_LOGI(kTag, "volume up!"); +void AudioState::react(const StepUpVolume& ev) { + if (sOutput->AdjustVolumeUp()) { events::Ui().Dispatch(VolumeChanged{}); } } -void AudioState::react(const system_fsm::KeyDownChanged& ev) { - if (ev.falling && sOutput->AdjustVolumeDown()) { - ESP_LOGI(kTag, "volume down!"); +void AudioState::react(const StepDownVolume& ev) { + if (sOutput->AdjustVolumeDown()) { events::Ui().Dispatch(VolumeChanged{}); } } -- cgit v1.2.3