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.
45 lines
1.0 KiB
45 lines
1.0 KiB
/*
|
|
* Copyright 2023 jacqueline <me@jacqueline.id.au>
|
|
*
|
|
* SPDX-License-Identifier: GPL-3.0-only
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
#include "result.hpp"
|
|
|
|
#include "audio_sink.hpp"
|
|
#include "bluetooth.hpp"
|
|
#include "gpios.hpp"
|
|
#include "i2s_dac.hpp"
|
|
|
|
namespace audio {
|
|
|
|
class BluetoothAudioOutput : public IAudioOutput {
|
|
public:
|
|
BluetoothAudioOutput(drivers::Bluetooth* bt);
|
|
~BluetoothAudioOutput();
|
|
|
|
auto SetInUse(bool) -> void override;
|
|
|
|
auto SetVolumeImbalance(int_fast8_t balance) -> void override;
|
|
auto SetVolume(uint_fast8_t percent) -> void override;
|
|
auto GetVolume() -> uint_fast8_t override;
|
|
auto AdjustVolumeUp() -> bool override;
|
|
auto AdjustVolumeDown() -> bool override;
|
|
|
|
auto PrepareFormat(const Format&) -> Format override;
|
|
auto Configure(const Format& format) -> void override;
|
|
|
|
BluetoothAudioOutput(const BluetoothAudioOutput&) = delete;
|
|
BluetoothAudioOutput& operator=(const BluetoothAudioOutput&) = delete;
|
|
|
|
private:
|
|
drivers::Bluetooth* bluetooth_;
|
|
};
|
|
|
|
} // namespace audio
|
|
|