diff options
| author | jacqueline <me@jacqueline.id.au> | 2022-11-17 13:30:16 +1100 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2022-11-17 13:30:16 +1100 |
| commit | 60169cdd91c46fb9c5cd22c2864e47b8e2dc413e (patch) | |
| tree | fd8d11915c9bcbc9b89cad27921de5f7fada0d78 /src/audio/include/audio_output.hpp | |
| parent | 1d340db87193ca589c3bd5df241ae0ed51a3100d (diff) | |
| download | tangara-fw-60169cdd91c46fb9c5cd22c2864e47b8e2dc413e.tar.gz | |
WIP on our own pipeline
Diffstat (limited to 'src/audio/include/audio_output.hpp')
| -rw-r--r-- | src/audio/include/audio_output.hpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/audio/include/audio_output.hpp b/src/audio/include/audio_output.hpp new file mode 100644 index 00000000..82dca82d --- /dev/null +++ b/src/audio/include/audio_output.hpp @@ -0,0 +1,29 @@ +#pragma once + +#include <cstdint> +#include <memory> + +#include "audio_common.h" +#include "audio_element.h" + +namespace drivers { + +class IAudioOutput { + public: + IAudioOutput(audio_element_handle_t element) : element_(element) {} + virtual ~IAudioOutput() { audio_element_deinit(element_); } + + auto GetAudioElement() -> audio_element_handle_t { return element_; } + + virtual auto SetVolume(uint8_t volume) -> void = 0; + virtual auto GetVolume() const -> uint8_t { return volume_; } + + virtual auto Configure(audio_element_info_t& info) -> void = 0; + virtual auto SetSoftMute(bool enabled) -> void = 0; + + protected: + audio_element_handle_t element_; + uint8_t volume_; +}; + +} // namespace drivers |
