diff options
| author | Clayton Craft <clayton@craftyguy.net> | 2024-12-25 18:04:40 -0800 |
|---|---|---|
| committer | cooljqln <cooljqln@noreply.codeberg.org> | 2024-12-29 22:50:11 +0000 |
| commit | 6e087b2dc42787679bcb9d828d057b64fac77e33 (patch) | |
| tree | bd0ed225a7e2d2ee7950222b3841c2460b868ffb /src/tangara/audio/audio_fsm.cpp | |
| parent | d5946a91d076d12b6376fb46ccbcc23ea82980f5 (diff) | |
| download | tangara-fw-6e087b2dc42787679bcb9d828d057b64fac77e33.tar.gz | |
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).
Diffstat (limited to 'src/tangara/audio/audio_fsm.cpp')
| -rw-r--r-- | src/tangara/audio/audio_fsm.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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<states::Standby>(); } } } |
