summaryrefslogtreecommitdiff
path: root/src/audio/audio_fsm.cpp
diff options
context:
space:
mode:
authorailurux <ailurux@noreply.codeberg.org>2024-02-29 05:23:33 +0000
committerailurux <ailurux@noreply.codeberg.org>2024-02-29 05:23:33 +0000
commitaa87c13799f5d71773b7c73135006acb592182d0 (patch)
tree3c6ef26e5a00eecb0e4319377b4bccd71235e9ac /src/audio/audio_fsm.cpp
parent173b09b0151ae765b1a8e69dfb60d14d502801f6 (diff)
parente7e6c70fb31d33ae1e79f9841f5b6fe227f6ebf3 (diff)
downloadtangara-fw-aa87c13799f5d71773b7c73135006acb592182d0.tar.gz
Merge pull request 'Add seeking support for all codecs' (#50) from seek-support into main
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/50 Reviewed-by: ailurux <ailurux@noreply.codeberg.org>
Diffstat (limited to 'src/audio/audio_fsm.cpp')
-rw-r--r--src/audio/audio_fsm.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/audio/audio_fsm.cpp b/src/audio/audio_fsm.cpp
index 08a0941a..50f18452 100644
--- a/src/audio/audio_fsm.cpp
+++ b/src/audio/audio_fsm.cpp
@@ -280,6 +280,8 @@ void Uninitialised::react(const system_fsm::BootComplete& ev) {
}
void Standby::react(const PlayFile& ev) {
+ sCurrentTrack = 0;
+ sIsPlaybackAllowed = true;
sFileSource->SetPath(ev.filename);
}
@@ -287,6 +289,14 @@ void Playback::react(const PlayFile& ev) {
sFileSource->SetPath(ev.filename);
}
+void Standby::react(const SeekFile& ev) {
+ sFileSource->SetPath(ev.filename, ev.offset);
+}
+
+void Playback::react(const SeekFile& ev) {
+ sFileSource->SetPath(ev.filename, ev.offset);
+}
+
void Standby::react(const internal::InputFileOpened& ev) {
if (readyToPlay()) {
transit<Playback>();