From 6e087b2dc42787679bcb9d828d057b64fac77e33 Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Wed, 25 Dec 2024 18:04:40 -0800 Subject: suspend playback when headphones disconnected I think this is what most folks would expect to happen if BT is disconnected/disabled and the headphones are removed. Also, I think(?) this fixes one situation where the device doesn't idle/ sleep when folks would expect it to (not connected to headphones or bt). --- src/tangara/audio/audio_fsm.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/tangara') diff --git a/src/tangara/audio/audio_fsm.cpp b/src/tangara/audio/audio_fsm.cpp index 63b960e4..603584b7 100644 --- a/src/tangara/audio/audio_fsm.cpp +++ b/src/tangara/audio/audio_fsm.cpp @@ -270,6 +270,9 @@ void AudioState::react(const system_fsm::HasPhonesChanged& ev) { if (sServices->bluetooth().enabled()) { events::Audio().Dispatch(audio::OutputModeChanged{ .set_to = drivers::NvsStorage::Output::kBluetooth}); + } else { + // Nothing connected + transit(); } } } -- cgit v1.2.3