summaryrefslogtreecommitdiff
path: root/src/drivers/include/fatfs_audio_input.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2022-11-17 13:30:16 +1100
committerjacqueline <me@jacqueline.id.au>2022-11-17 13:30:16 +1100
commit60169cdd91c46fb9c5cd22c2864e47b8e2dc413e (patch)
treefd8d11915c9bcbc9b89cad27921de5f7fada0d78 /src/drivers/include/fatfs_audio_input.hpp
parent1d340db87193ca589c3bd5df241ae0ed51a3100d (diff)
downloadtangara-fw-60169cdd91c46fb9c5cd22c2864e47b8e2dc413e.tar.gz
WIP on our own pipeline
Diffstat (limited to 'src/drivers/include/fatfs_audio_input.hpp')
-rw-r--r--src/drivers/include/fatfs_audio_input.hpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/drivers/include/fatfs_audio_input.hpp b/src/drivers/include/fatfs_audio_input.hpp
new file mode 100644
index 00000000..3753c136
--- /dev/null
+++ b/src/drivers/include/fatfs_audio_input.hpp
@@ -0,0 +1,40 @@
+#pragma once
+
+namespace drivers {
+
+ class FatfsAudioInput {
+ public:
+ FatfsAudioInput(std::shared_ptr<SdStorage> storage);
+ ~FatfsAudioInput();
+
+ enum Status {
+ /*
+ * Successfully read data into the output buffer, and there is still
+ * data remaining in the file.
+ */
+ OKAY,
+
+ /*
+ * The ringbuffer was full. No data was read.
+ */
+ RINGBUF_FULL,
+
+ /*
+ * Some data may have been read into the output buffer, but the file is
+ * now empty.
+ */
+ FILE_EMPTY,
+ };
+ auto Process() -> Status;
+
+ auto GetOutputBuffer() -> RingbufHandle_t;
+
+ private:
+ std::shared_ptr<SdStorage> storage_;
+ RingbufHandle_t output_;
+
+ std::string path_;
+
+ };
+
+} // namespace drivers