From b192975cb1eeb4e6b7c7bf53cdf42701c55f034a Mon Sep 17 00:00:00 2001 From: jacqueline Date: Fri, 22 Sep 2023 15:48:41 +1000 Subject: make bluetooth pairing ui functional --- src/audio/include/audio_events.hpp | 2 ++ src/audio/include/audio_fsm.hpp | 2 ++ src/audio/include/bt_audio_output.hpp | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/audio/include') diff --git a/src/audio/include/audio_events.hpp b/src/audio/include/audio_events.hpp index db6a3297..5af419ab 100644 --- a/src/audio/include/audio_events.hpp +++ b/src/audio/include/audio_events.hpp @@ -41,6 +41,8 @@ struct ChangeMaxVolume : tinyfsm::Event { struct TogglePlayPause : tinyfsm::Event {}; +struct OutputModeChanged : tinyfsm::Event {}; + namespace internal { struct InputFileOpened : tinyfsm::Event {}; diff --git a/src/audio/include/audio_fsm.hpp b/src/audio/include/audio_fsm.hpp index 46d3d338..1c0b8aaa 100644 --- a/src/audio/include/audio_fsm.hpp +++ b/src/audio/include/audio_fsm.hpp @@ -45,6 +45,7 @@ class AudioState : public tinyfsm::Fsm { void react(const system_fsm::KeyDownChanged&); void react(const system_fsm::HasPhonesChanged&); void react(const ChangeMaxVolume&); + void react(const OutputModeChanged&); virtual void react(const system_fsm::BootComplete&) {} @@ -65,6 +66,7 @@ class AudioState : public tinyfsm::Fsm { static std::unique_ptr sDecoder; static std::shared_ptr sSampleConverter; static std::shared_ptr sI2SOutput; + static std::shared_ptr sBtOutput; static std::shared_ptr sOutput; static std::optional sCurrentTrack; diff --git a/src/audio/include/bt_audio_output.hpp b/src/audio/include/bt_audio_output.hpp index a8e44f31..734a7ed1 100644 --- a/src/audio/include/bt_audio_output.hpp +++ b/src/audio/include/bt_audio_output.hpp @@ -21,7 +21,7 @@ namespace audio { class BluetoothAudioOutput : public IAudioOutput { public: - BluetoothAudioOutput(drivers::Bluetooth* bt); + BluetoothAudioOutput(drivers::Bluetooth& bt); ~BluetoothAudioOutput(); auto SetInUse(bool) -> void override; @@ -39,7 +39,7 @@ class BluetoothAudioOutput : public IAudioOutput { BluetoothAudioOutput& operator=(const BluetoothAudioOutput&) = delete; private: - drivers::Bluetooth* bluetooth_; + drivers::Bluetooth& bluetooth_; }; } // namespace audio -- cgit v1.2.3