summaryrefslogtreecommitdiff
path: root/src/audio/include/fatfs_audio_input.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-07-26 17:11:23 +1000
committerjacqueline <me@jacqueline.id.au>2023-07-26 17:11:23 +1000
commit9b1b401dcb986a26d10bcc898be670653acc2d3f (patch)
tree697b14553dc75ddaab060406cd62ee4b08f05e9e /src/audio/include/fatfs_audio_input.hpp
parentf94be3db2f2bb6c1b359744cb915683095e4ee80 (diff)
downloadtangara-fw-9b1b401dcb986a26d10bcc898be670653acc2d3f.tar.gz
big cleanup of new encoder + stream buffer types
Diffstat (limited to 'src/audio/include/fatfs_audio_input.hpp')
-rw-r--r--src/audio/include/fatfs_audio_input.hpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/audio/include/fatfs_audio_input.hpp b/src/audio/include/fatfs_audio_input.hpp
index a1b9689b..e13e49e2 100644
--- a/src/audio/include/fatfs_audio_input.hpp
+++ b/src/audio/include/fatfs_audio_input.hpp
@@ -89,9 +89,8 @@ class FatfsAudioInput : public IAudioSource {
auto SetPath(const std::string&) -> void;
auto SetPath() -> void;
- auto Read(std::function<bool(StreamInfo::Format)>,
- std::function<size_t(cpp::span<const std::byte>)>,
- TickType_t) -> void override;
+ auto Read(std::function<void(Flags, InputStream&)>, TickType_t)
+ -> void override;
FatfsAudioInput(const FatfsAudioInput&) = delete;
FatfsAudioInput& operator=(const FatfsAudioInput&) = delete;
@@ -118,11 +117,7 @@ class FatfsAudioInput : public IAudioSource {
StreamBufferHandle_t streamer_buffer_;
std::unique_ptr<FileStreamer> streamer_;
- StreamInfo file_buffer_info_;
- std::size_t file_buffer_len_;
- std::byte* file_buffer_;
-
- RawStream file_buffer_stream_;
+ std::unique_ptr<RawStream> input_buffer_;
// Mutex guarding the current file/stream associated with this source. Must be
// held during readings, and before altering the current file.
@@ -130,7 +125,7 @@ class FatfsAudioInput : public IAudioSource {
std::unique_ptr<database::FutureFetcher<std::optional<std::string>>>
pending_path_;
- std::optional<StreamInfo::Format> current_format_;
+ bool is_first_read_;
};
} // namespace audio