diff options
| author | ailurux <ailuruxx@gmail.com> | 2024-02-15 16:12:07 +1100 |
|---|---|---|
| committer | ailurux <ailuruxx@gmail.com> | 2024-02-15 16:12:07 +1100 |
| commit | 62f6179abe24339c2e5b7350528afbcad4c52067 (patch) | |
| tree | d14f0b35ef601d0877ced507c5560236da666218 /src/audio/fatfs_audio_input.cpp | |
| parent | e466522c25758670da335195d60a5d599ed56177 (diff) | |
| download | tangara-fw-62f6179abe24339c2e5b7350528afbcad4c52067.tar.gz | |
Added offset for track seeking, wav impl. only rn
Diffstat (limited to 'src/audio/fatfs_audio_input.cpp')
| -rw-r--r-- | src/audio/fatfs_audio_input.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/audio/fatfs_audio_input.cpp b/src/audio/fatfs_audio_input.cpp index 7726a94a..665e8c1d 100644 --- a/src/audio/fatfs_audio_input.cpp +++ b/src/audio/fatfs_audio_input.cpp @@ -62,9 +62,9 @@ auto FatfsAudioInput::SetPath(std::optional<std::string> path) -> void { } } -auto FatfsAudioInput::SetPath(const std::string& path) -> void { +auto FatfsAudioInput::SetPath(const std::string& path,uint32_t offset) -> void { std::lock_guard<std::mutex> guard{new_stream_mutex_}; - if (OpenFile(path)) { + if (OpenFile(path, offset)) { has_new_stream_ = true; has_new_stream_.notify_one(); } @@ -103,7 +103,7 @@ auto FatfsAudioInput::NextStream() -> std::shared_ptr<TaggedStream> { } } -auto FatfsAudioInput::OpenFile(const std::string& path) -> bool { +auto FatfsAudioInput::OpenFile(const std::string& path,uint32_t offset) -> bool { ESP_LOGI(kTag, "opening file %s", path.c_str()); auto tags = tag_parser_.ReadAndParseTags(path); @@ -136,7 +136,7 @@ auto FatfsAudioInput::OpenFile(const std::string& path) -> bool { auto source = std::make_unique<FatfsSource>(stream_type.value(), std::move(file)); - new_stream_.reset(new TaggedStream(tags, std::move(source))); + new_stream_.reset(new TaggedStream(tags, std::move(source), offset)); return true; } |
