diff options
| author | jacqueline <me@jacqueline.id.au> | 2024-04-15 14:53:41 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2024-04-15 14:53:41 +1000 |
| commit | 874218e3ff0ffd244936b3d56f1645efc3f9519f (patch) | |
| tree | be6f9cc544d3c6f91725471306e39ae66820a41d /src/audio | |
| parent | 1baaa6dadcea5b8a85f1629e31119f4edba91b75 (diff) | |
| download | tangara-fw-874218e3ff0ffd244936b3d56f1645efc3f9519f.tar.gz | |
Fix some bt device issues
- Don't allow adjusting volume if there's no device
- Cap bt nvs values correctly
- Persist bt volumes correctly even when the encoded for has a null
byte (facepalm 4 me)
Diffstat (limited to 'src/audio')
| -rw-r--r-- | src/audio/bt_audio_output.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/audio/bt_audio_output.cpp b/src/audio/bt_audio_output.cpp index 8f2b8cf3..229a38bb 100644 --- a/src/audio/bt_audio_output.cpp +++ b/src/audio/bt_audio_output.cpp @@ -90,7 +90,7 @@ auto BluetoothAudioOutput::SetVolumeDb(int_fast16_t val) -> bool { } auto BluetoothAudioOutput::AdjustVolumeUp() -> bool { - if (volume_ == 100) { + if (volume_ == 100 || !bluetooth_.IsConnected()) { return false; } volume_++; @@ -99,7 +99,7 @@ auto BluetoothAudioOutput::AdjustVolumeUp() -> bool { } auto BluetoothAudioOutput::AdjustVolumeDown() -> bool { - if (volume_ == 0) { + if (volume_ == 0 || !bluetooth_.IsConnected()) { return false; } volume_--; |
