feat: Add subtle remote sounds #27

Open
namillis wants to merge 1 commit from feat/remote-sounds into main
Owner

Adds quiet audio feedback for the remote.

  • Arrows: a short, high, quiet tick. If you hold a direction, it ticks at most once every 60 ms.
  • OK: a rounder click, played on the first press only.
  • Back: a soft falling tone. It plays only when Back has something to close (the settings sheet, Bluetooth panel, app grid or reorder mode). On the bare home screen Back does nothing, so it stays silent there.

The sounds are synthesized in UiSoundSynth instead of shipped as audio files. At startup they are written to the cache and loaded into a SoundPool that plays on the sonification stream, so the TV's system volume controls them. One hook in dispatchKeyEvent covers every surface: shelf, grid, settings sheet, Bluetooth panel and the app menu.

A new Remote sounds on/off row sits at the top of Settings → Default home & backup. It is on by default and included in settings backups. Older backups that don't have the key leave the setting unchanged. While the launcher's sounds are on, it skips its own explicit platform CLICK calls so the two sounds don't play on top of each other.

Not a goal: sounds in the rename and setup dialogs, which run in their own windows, or touch-only taps.

Tested on the LiveWireTV_API34 emulator. dumpsys audio showed one SoundPool start per Right, Right, Left, Down, Up and OK press. After switching the setting off, four arrow presses produced no starts. testDebugUnitTest (including the new UiSoundSynthTest and the updated backup round-trip test), lintDebug and assembleDebug all pass.

Adds quiet audio feedback for the remote. - **Arrows:** a short, high, quiet tick. If you hold a direction, it ticks at most once every 60 ms. - **OK:** a rounder click, played on the first press only. - **Back:** a soft falling tone. It plays only when Back has something to close (the settings sheet, Bluetooth panel, app grid or reorder mode). On the bare home screen Back does nothing, so it stays silent there. The sounds are synthesized in `UiSoundSynth` instead of shipped as audio files. At startup they are written to the cache and loaded into a `SoundPool` that plays on the sonification stream, so the TV's system volume controls them. One hook in `dispatchKeyEvent` covers every surface: shelf, grid, settings sheet, Bluetooth panel and the app menu. A new **Remote sounds** on/off row sits at the top of Settings → Default home & backup. It is on by default and included in settings backups. Older backups that don't have the key leave the setting unchanged. While the launcher's sounds are on, it skips its own explicit platform `CLICK` calls so the two sounds don't play on top of each other. Not a goal: sounds in the rename and setup dialogs, which run in their own windows, or touch-only taps. **Tested** on the LiveWireTV_API34 emulator. `dumpsys audio` showed one SoundPool start per Right, Right, Left, Down, Up and OK press. After switching the setting off, four arrow presses produced no starts. `testDebugUnitTest` (including the new `UiSoundSynthTest` and the updated backup round-trip test), `lintDebug` and `assembleDebug` all pass.
Play a quiet tick when the selection moves, a click on OK and a soft falling tone on Back (only when something is open to close). Sounds are synthesized at startup and played through SoundPool on the system sonification stream. Held D-pad repeats are throttled to one tick per 60 ms. A Remote sounds on/off row under Default home & backup controls it (on by default), and it is included in settings backups. While on, the launcher skips its explicit platform click calls so the two don't stack.
This pull request has changes conflicting with the target branch.
  • glasslauncher/app/src/main/java/tv/glass/launcher/LauncherActivity.java
  • glasslauncher/app/src/main/java/tv/glass/launcher/LayoutOptions.java
  • glasslauncher/app/src/main/java/tv/glass/launcher/SettingsBackup.java
  • glasslauncher/app/src/main/res/values/strings.xml
  • glasslauncher/app/src/test/java/tv/glass/launcher/SettingsBackupTest.java
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/remote-sounds:feat/remote-sounds
git switch feat/remote-sounds

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff feat/remote-sounds
git switch feat/remote-sounds
git rebase main
git switch main
git merge --ff-only feat/remote-sounds
git switch feat/remote-sounds
git rebase main
git switch main
git merge --no-ff feat/remote-sounds
git switch main
git merge --squash feat/remote-sounds
git switch main
git merge --ff-only feat/remote-sounds
git switch main
git merge feat/remote-sounds
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
namillis/GlassLauncherTV!27
No description provided.