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).
custom
Clayton Craft 4 months ago committed by cooljqln
parent d5946a91d0
commit 6e087b2dc4
  1. 3
      src/tangara/audio/audio_fsm.cpp

@ -270,6 +270,9 @@ void AudioState::react(const system_fsm::HasPhonesChanged& ev) {
if (sServices->bluetooth().enabled()) { if (sServices->bluetooth().enabled()) {
events::Audio().Dispatch(audio::OutputModeChanged{ events::Audio().Dispatch(audio::OutputModeChanged{
.set_to = drivers::NvsStorage::Output::kBluetooth}); .set_to = drivers::NvsStorage::Output::kBluetooth});
} else {
// Nothing connected
transit<states::Standby>();
} }
} }
} }

Loading…
Cancel
Save