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_decoder.cpp | 2 +- src/audio/audio_fsm.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/audio') diff --git a/src/audio/audio_decoder.cpp b/src/audio/audio_decoder.cpp index 02cf27e3..eaa9ff9c 100644 --- a/src/audio/audio_decoder.cpp +++ b/src/audio/audio_decoder.cpp @@ -155,7 +155,7 @@ auto Decoder::BeginDecoding(std::shared_ptr stream) -> bool { .bitrate_kbps = open_res->sample_rate_hz, .encoding = stream->type(), }); - timer_.reset(new Timer(tags, open_res.value())); + timer_.reset(new Timer(tags, open_res.value(), stream->Offset())); // TODO: How does *this?* need to change? PlaybackUpdate ev{.seconds_elapsed = stream->Offset(), .track = tags}; 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