diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-09-22 15:48:41 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-09-22 21:19:19 +1000 |
| commit | b192975cb1eeb4e6b7c7bf53cdf42701c55f034a (patch) | |
| tree | 39755851543d596f2630704be9efb56be1f39bfc /src/audio/include | |
| parent | cbd99b2134c6c471708deb409a4b0fcc4c31516d (diff) | |
| download | tangara-fw-b192975cb1eeb4e6b7c7bf53cdf42701c55f034a.tar.gz | |
make bluetooth pairing ui functional
Diffstat (limited to 'src/audio/include')
| -rw-r--r-- | src/audio/include/audio_events.hpp | 2 | ||||
| -rw-r--r-- | src/audio/include/audio_fsm.hpp | 2 | ||||
| -rw-r--r-- | src/audio/include/bt_audio_output.hpp | 4 |
3 files changed, 6 insertions, 2 deletions
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<AudioState> { 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<AudioState> { static std::unique_ptr<Decoder> sDecoder; static std::shared_ptr<SampleConverter> sSampleConverter; static std::shared_ptr<I2SAudioOutput> sI2SOutput; + static std::shared_ptr<BluetoothAudioOutput> sBtOutput; static std::shared_ptr<IAudioOutput> sOutput; static std::optional<database::TrackId> 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 |
