Skip to content

Add double-press mute button for HCR audio#71

Merged
thePunderWoman merged 1 commit intomainfrom
feat/mute-button
Apr 29, 2026
Merged

Add double-press mute button for HCR audio#71
thePunderWoman merged 1 commit intomainfrom
feat/mute-button

Conversation

@thePunderWoman
Copy link
Copy Markdown
Owner

Summary

  • Adds mutebutton=N config option (1–9, same button numbering as altbtn) that toggles HCR mute on double-press
  • Mute sets all three HCR channels to 0 while remembering the live per-channel volumes (reflecting any wheel adjustments since boot)
  • Unmute (second double-press) restores those saved volumes
  • Moving the volume wheel while muted automatically unmutes — restores saved volumes, then applies the wheel value to the configured channel(s)
  • May be set to the same button as altbtn — a quick double-tap fires mute while holding acts as the alt modifier
  • Double-press window is 400ms (AmidalaController::DOUBLE_PRESS_MS)
  • No-op when mutebutton=0 (default, disabled)

Changed files

  • include/params.hmutebutton field + default
  • src/config.cpp — parse mutebutton=
  • include/audio.h / src/audio.cppfSavedVolV/A/B tracks live channel volumes; restoreVolumes() helper; toggleMute(); setVolumeNoResponse / setAltVolumeNoResponse unmute on wheel input
  • include/controller.hnoteMuteBtnUp() double-press timer logic; resetMutePressTimer(); toggleMute() forwarder; DOUBLE_PRESS_MS constant; fLastMuteBtnUpTime state
  • src/drive_controllers.cpp — double-press detection wired into both DriveController (buttons 1–5) and DomeController (buttons 6–9); timer reset on disconnect
  • example_config.txt — documents mutebutton= near altbtn=

Test plan

  • pio test -e native — all 448 tests pass (new tests in test_audio and test_processconfig)
  • pio run — firmware builds clean
  • On hardware: confirm double-tapping the configured button mutes all audio
  • On hardware: confirm second double-tap restores volumes correctly
  • On hardware: confirm wheel movement while muted unmutes and adjusts volume
  • On hardware: confirm mutebutton == altbtn — hold fires alt modifier, quick double-tap fires mute

🤖 Generated with Claude Code

Introduces mutebutton= config option (1–9, same numbering as altbtn).
Double-pressing the configured button sets all HCR channels to 0; a
second double-press restores the previous per-channel volumes. Moving
the volume wheel while muted automatically unmutes. May share the same
button as altbtn — a quick double-tap fires mute while holding acts as
the alt modifier. Double-press window is 400ms.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@thePunderWoman thePunderWoman merged commit 1d661ee into main Apr 29, 2026
1 check passed
@thePunderWoman thePunderWoman deleted the feat/mute-button branch April 29, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant