summaryrefslogtreecommitdiff
path: root/src/audio/fatfs_audio_input.cpp
diff options
context:
space:
mode:
authorailurux <ailuruxx@gmail.com>2024-02-15 16:12:07 +1100
committerailurux <ailuruxx@gmail.com>2024-02-15 16:12:07 +1100
commit62f6179abe24339c2e5b7350528afbcad4c52067 (patch)
treed14f0b35ef601d0877ced507c5560236da666218 /src/audio/fatfs_audio_input.cpp
parente466522c25758670da335195d60a5d599ed56177 (diff)
downloadtangara-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.cpp8
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;
}