fix: restore SDL volume to MAX after device switch

Remove dead 'currentVolume' variable that was never written to, causing
SwitchDevice to always restore volume to 0 after switching audio devices.

- Remove currentVolume from package state
- SwitchDevice now sets mix.MAX_VOLUME after reopening device
- GetVolume128 now queries SDL directly instead of reading stale variable
- Add unit tests for parseSinks, parseSinkLine, and ConvertVolume
- Add changelog.txt tracking all audio bug fixes
This commit is contained in:
NeilClack
2026-07-10 13:56:06 -05:00
parent fd10201f75
commit 2bcb36669f
4 changed files with 221 additions and 10 deletions
+4
View File
@@ -19,6 +19,10 @@ func TestConvertVolume(t *testing.T) {
{"50 percent", 50, 0.50},
{"90 percent", 90, 0.90},
{"100 percent", 100, 1.0},
{"1 percent", 1, 0.01},
{"99 percent", 99, 0.99},
{"negative 10", -10, -0.10},
{"over 100", 150, 1.50},
}
const epsilon = 1e-9