summaryrefslogtreecommitdiff
path: root/src/audio/include/audio_element.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2022-12-02 17:25:53 +1100
committerjacqueline <me@jacqueline.id.au>2022-12-02 17:25:53 +1100
commitc36208016eefcdfdeff045f675f74fdb69dddb52 (patch)
tree817bd458ca14a6dd0d200390a0b11cb2120aa33f /src/audio/include/audio_element.hpp
parent222c810b07ffc635fc7908d121e97e4d65ccc5c8 (diff)
downloadtangara-fw-c36208016eefcdfdeff045f675f74fdb69dddb52.tar.gz
better cbor handling
Diffstat (limited to 'src/audio/include/audio_element.hpp')
-rw-r--r--src/audio/include/audio_element.hpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/audio/include/audio_element.hpp b/src/audio/include/audio_element.hpp
index 13a48590..5b697784 100644
--- a/src/audio/include/audio_element.hpp
+++ b/src/audio/include/audio_element.hpp
@@ -15,8 +15,11 @@
namespace audio {
-/* Errors that may be returned by any of the Process* methods. */
-enum StreamError {
+/*
+ * Errors that may be returned by any of the Process* methods of an audio
+ * element.
+ */
+enum AudioProcessingError {
// Indicates that this element is unable to handle the upcoming chunks.
UNSUPPORTED_STREAM,
// Indicates an error with reading or writing stream data.
@@ -65,8 +68,8 @@ class IAudioElement {
* Called when a StreamInfo message is received. Used to configure this
* element in preperation for incoming chunks.
*/
- virtual auto ProcessStreamInfo(StreamInfo&& info)
- -> cpp::result<void, StreamError> = 0;
+ virtual auto ProcessStreamInfo(StreamInfo& info)
+ -> cpp::result<void, AudioProcessingError> = 0;
/*
* Called when a ChunkHeader message is received. Includes the data associated
@@ -75,14 +78,14 @@ class IAudioElement {
* prepended to the next call.
*/
virtual auto ProcessChunk(uint8_t* data, std::size_t length)
- -> cpp::result<size_t, StreamError> = 0;
+ -> cpp::result<size_t, AudioProcessingError> = 0;
/*
* Called when there has been no data received over the input buffer for some
* time. This could be used to synthesize output, or to save memory by
* releasing unused resources.
*/
- virtual auto ProcessIdle() -> cpp::result<void, StreamError> = 0;
+ virtual auto ProcessIdle() -> cpp::result<void, AudioProcessingError> = 0;
protected:
MessageBufferHandle_t* input_buffer_;