mirror of
https://github.com/archr-linux/Arch-R.git
synced 2026-07-12 18:19:42 -07:00
f152192961
A user reported (and it reproduces on hardware) that turning "ENABLE
NAVIGATION SOUNDS" on in Sound Settings does nothing until the device is
rebooted.
Root cause: Sound::init() loaded the WAV sample only when EnableSounds was
already true:
if (!Settings::getInstance()->getBool("EnableSounds"))
return;
mSampleData = Mix_LoadWAV(...);
So when the frontend starts with sounds disabled, every Sound keeps a null
sample; flipping the menu switch only writes the setting and never reloads
the samples, so play() bails on the null sample. Only the next boot re-runs
init() with the setting true and finally loads them.
Sound::play() already checks the live EnableSounds value, so the init-time
gate is redundant for correctness and harmful for runtime toggling. Drop it
(new patch, first under this package's patches/) so samples always load and
the toggle works immediately, both directions, no reboot. Memory cost is a
handful of small navigation WAVs.
Pending validation: takes effect after the ES package is rebuilt.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>