Fork of Tangara with customizations
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tangara-fw/src/drivers/include/audio_output.hpp

30 lines
697 B

#pragma once
2 years ago
#include <cstdint>
#include <memory>
#include "audio_common.h"
#include "audio_element.h"
namespace drivers {
class IAudioOutput {
2 years ago
public:
IAudioOutput(audio_element_handle_t element) : element_(element) {}
virtual ~IAudioOutput() { audio_element_deinit(element_); }
2 years ago
auto GetAudioElement() -> audio_element_handle_t { return element_; }
2 years ago
virtual auto SetVolume(uint8_t volume) -> void = 0;
virtual auto GetVolume() const -> uint8_t { return volume_; }
2 years ago
virtual auto Configure(audio_element_info_t& info) -> void = 0;
virtual auto SetSoftMute(bool enabled) -> void = 0;
2 years ago
protected:
audio_element_handle_t element_;
uint8_t volume_;
};
2 years ago
} // namespace drivers