Skip to content

Add focused app volume hotkeys - #1801

Open
Alb11747 wants to merge 6 commits into
File-New-Project:devfrom
Alb11747:feature/focused-app-hotkeys
Open

Alb11747 wants to merge 6 commits into
File-New-Project:devfrom
Alb11747:feature/focused-app-hotkeys

Conversation

@Alb11747

@Alb11747 Alb11747 commented Mar 7, 2026

Copy link
Copy Markdown

Summary

Add configurable shortcuts to raise, lower, or toggle mute for the focused app, and expose them in EarTrumpet's shortcut settings. Share foreground-app resolution with the Actions add-on.

Focused-app resolution

  • Resolve regular Win32 and hosted ApplicationFrameWindow apps.
  • Inspect the full audio-session hierarchy using each stream's process ID and activity state. Target an active descendant app only when exactly one distinct descendant owns an active session, covering injected overlays.
  • Fall back to the actual foreground app when the target is missing or ambiguous.
  • Validate process ancestry with creation times so reused parent IDs cannot redirect controls to unrelated apps.

Volume behavior

  • Apply fixed steps of 2 percentage points in linear mode and 0.5 dB in logarithmic mode to individual streams across matching groups and devices. For example, volume-down changes 50% and 10% to 48% and 8%.
  • Mute every matching stream when any is unmuted; unmute only when all are muted.
  • Preserve clamping, non-finite recovery, and temporary entries used during device moves.
  • Keep logarithmic readback consistent with the scalar sent to Core Audio, so repeated shortcuts work before callbacks arrive.

Validation

  • 17 deterministic regression tests pass, covering nested groups, unequal volumes, mute states, boundaries, placeholders, ancestry, PID reuse, and immediate logarithmic readback. The runner is included in PR CI.
  • Release and VSDebug builds pass for x64, x86, and ARM64. Existing x86 interop warnings remain.
  • An isolated live Core Audio session passed repeated linear/logarithmic adjustments and mute/unmute through the production helper, view model, and audio session.
  • Debug builds remain blocked by pre-existing audio mocks missing volume-interface methods, reproduced at the original PR head.
  • Full shortcut registration, Actions targeting, multiple live audio devices, and ARM64 runtime execution remain unverified.

Scope

Toast notifications and configurable volume-step sizes remain on the separate local toast branch. This PR keeps fixed step sizes and adds no toast UI.

@CLAassistant

CLAassistant commented Mar 7, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Loukious

Copy link
Copy Markdown

You may want to add a mute/unmute foreground app while at it. I think that would be the most important feature for gamers.

@Alb11747
Alb11747 force-pushed the feature/focused-app-hotkeys branch from 59c89f4 to 6ab5176 Compare June 12, 2026 20:00
@Alb11747
Alb11747 force-pushed the feature/focused-app-hotkeys branch from de404a7 to d4139a8 Compare August 20, 2026 12:39
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.

3 participants