From 62f6179abe24339c2e5b7350528afbcad4c52067 Mon Sep 17 00:00:00 2001 From: ailurux Date: Thu, 15 Feb 2024 16:12:07 +1100 Subject: Added offset for track seeking, wav impl. only rn --- src/audio/audio_fsm.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/audio/audio_fsm.cpp') diff --git a/src/audio/audio_fsm.cpp b/src/audio/audio_fsm.cpp index ba6e5ffe..c67cfc7a 100644 --- a/src/audio/audio_fsm.cpp +++ b/src/audio/audio_fsm.cpp @@ -244,11 +244,19 @@ void Uninitialised::react(const system_fsm::BootComplete& ev) { } void Standby::react(const PlayFile& ev) { - sFileSource->SetPath(ev.filename); + sFileSource->SetPath(ev.filename, 10); } void Playback::react(const PlayFile& ev) { - sFileSource->SetPath(ev.filename); + sFileSource->SetPath(ev.filename, 15); +} + +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) { -- cgit v1.2.3 From a49d754da6c293445be16ac643d10849c01ea96b Mon Sep 17 00:00:00 2001 From: ailurux Date: Fri, 16 Feb 2024 10:57:47 +1100 Subject: Seeking working with hardcoded event, wav only --- src/audio/audio_fsm.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/audio/audio_fsm.cpp') diff --git a/src/audio/audio_fsm.cpp b/src/audio/audio_fsm.cpp index c67cfc7a..75e3c24a 100644 --- a/src/audio/audio_fsm.cpp +++ b/src/audio/audio_fsm.cpp @@ -244,11 +244,13 @@ void Uninitialised::react(const system_fsm::BootComplete& ev) { } void Standby::react(const PlayFile& ev) { + sCurrentTrack = 0; + sIsPlaybackAllowed = true; sFileSource->SetPath(ev.filename, 10); } void Playback::react(const PlayFile& ev) { - sFileSource->SetPath(ev.filename, 15); + sFileSource->SetPath(ev.filename, 10); } void Standby::react(const SeekFile& ev) { -- cgit v1.2.3 From 665679b8854d34c13d8eb92167aa8a4691619d8b Mon Sep 17 00:00:00 2001 From: ailurux Date: Fri, 16 Feb 2024 12:55:11 +1100 Subject: WIP: seeking in lua example --- src/audio/audio_fsm.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/audio/audio_fsm.cpp') diff --git a/src/audio/audio_fsm.cpp b/src/audio/audio_fsm.cpp index 75e3c24a..0e213b6e 100644 --- a/src/audio/audio_fsm.cpp +++ b/src/audio/audio_fsm.cpp @@ -246,14 +246,16 @@ void Uninitialised::react(const system_fsm::BootComplete& ev) { void Standby::react(const PlayFile& ev) { sCurrentTrack = 0; sIsPlaybackAllowed = true; - sFileSource->SetPath(ev.filename, 10); + sFileSource->SetPath(ev.filename); } void Playback::react(const PlayFile& ev) { - sFileSource->SetPath(ev.filename, 10); + sFileSource->SetPath(ev.filename); } void Standby::react(const SeekFile& ev) { + sCurrentTrack = 0; + sIsPlaybackAllowed = true; sFileSource->SetPath(ev.filename, ev.offset); } -- cgit v1.2.3 From c60bb9ee42eea2c88ef90228274bd28350a87ae4 Mon Sep 17 00:00:00 2001 From: ailurux Date: Fri, 16 Feb 2024 16:19:12 +1100 Subject: Fix issue with seeking whilst paused --- src/audio/audio_fsm.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/audio/audio_fsm.cpp') diff --git a/src/audio/audio_fsm.cpp b/src/audio/audio_fsm.cpp index 0e213b6e..bb7d33dc 100644 --- a/src/audio/audio_fsm.cpp +++ b/src/audio/audio_fsm.cpp @@ -254,8 +254,6 @@ void Playback::react(const PlayFile& ev) { } void Standby::react(const SeekFile& ev) { - sCurrentTrack = 0; - sIsPlaybackAllowed = true; sFileSource->SetPath(ev.filename, ev.offset); } -- cgit v1.2.3