Skip to content

Add "hide when unavailable" setting to gate PR #61 behavior - #70

Merged
briankendall merged 2 commits into
briankendall:masterfrom
mcg1969:hide-when-unavailable-setting
May 21, 2026
Merged

briankendall merged 2 commits into
briankendall:masterfrom
mcg1969:hide-when-unavailable-setting

Conversation

@mcg1969

@mcg1969 mcg1969 commented May 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR builds on #61 by @seungwoochoe to address the feedback from @briankendall: the auto-hide behavior is useful but needs to be opt-in so it does not change behavior for existing users who rely on the proxy device as a stable, always-visible target.

Two commits, to keep the two authors' work cleanly separated:

  1. @seungwoochoe's PR Hide proxy device when target output device is unavailable #61, cherry-picked as-is — preserves original authorship.
  2. New preference outputDeviceHideWhenUnavailable — defaults to false, so behavior matches the current release for anyone who upgrades without opening Settings.

Settings app mockup

The new checkbox appears at the bottom of the existing Settings window, unchecked by default:

Settings app mockup showing new "Hide proxy device when target device is unavailable" checkbox at the bottom, unchecked

Note: this is a programmatic mockup rendered from the xib's frame coordinates; native macOS rendering will look tighter (system fonts, bezel gradients, vibrancy). Positions and labels are faithful to what the actual xib produces.

Changes

  • New persisted driver preference outputDeviceHideWhenUnavailable, stored via gPlugIn_Host->WriteToStorage as a CFBoolean, following the same pattern as outputDeviceActiveCondition.
  • kAudioDevicePropertyIsHidden getter now returns 1 only when the pref is on AND the target device is not ready — default (off) preserves the prior always-visible behavior.
  • Refactored PR Hide proxy device when target output device is unavailable #61's three duplicated PropertiesChanged(kAudioDevicePropertyIsHidden) notification blocks into a single notifyHiddenPropertyChanged() helper.
  • New checkbox in the Settings app ("Hide proxy device when target device is unavailable"), wired through the same configurator round-trip used by the existing active-condition radio buttons.
  • Window height in MainMenu.xib extended to accommodate the new control.

Rationale for the default

From @briankendall's review on #61:

One of the major use cases for the proxy device is having a device that doesn't disappear but can still be used to consistently play to the right device, for apps that don't properly handle changes to available audio devices.

Defaulting the new pref to false preserves that behavior for existing installations; users who want the new auto-hide behavior can opt in via the Settings app.

Test plan

  • Build ProxyAudioDevice target: succeeds
  • Build Proxy Audio Device Settings target: succeeds
  • Install driver, open Settings app — new checkbox appears, defaults to off
  • With checkbox off: disconnect/reconnect target device → proxy device stays visible (existing behavior)
  • With checkbox on: disconnect target device → proxy device hides; reconnect → proxy device reappears (PR Hide proxy device when target output device is unavailable #61 behavior)
  • Toggling the checkbox while the target is disconnected takes effect immediately (does not require a device-availability event)
  • Preference persists across reboots / coreaudiod restarts

Disclosure

This change was developed with assistance from Claude (Anthropic's AI coding assistant). The Co-Authored-By: Claude Opus 4.7 trailer on commit 2 reflects this.

seungwoochoe and others added 2 commits May 6, 2026 08:52
Addresses reviewer feedback on PR briankendall#61: the auto-hide behavior is useful
but should not change the default for existing users who rely on the
proxy device as a stable, always-visible target for apps that do not
react well to devices appearing and disappearing.

* Adds a new persisted preference outputDeviceHideWhenUnavailable,
  defaulting to false (preserves prior behavior).
* Driver only reports kAudioDevicePropertyIsHidden = 1 when the setting
  is on AND the target device is not ready.
* Extracts the repeated PropertiesChanged(kAudioDevicePropertyIsHidden)
  notification blocks from PR briankendall#61 into a single helper.
* Adds a matching checkbox to the Settings app, wired through the same
  configurator round-trip used by the existing active-condition radios.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
mcg1969 added a commit to mcg1969/proxy-audio-device that referenced this pull request May 6, 2026
@mcg1969

mcg1969 commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

Manual verification on macOS 26.2 / Xcode 26.4

Completed end-to-end testing with the driver built from this branch and installed at /Library/Audio/Plug-Ins/HAL/.

Settings app running on macOS with the new checkbox enabled

Verified:

  • Both targets (ProxyAudioDevice and Proxy Audio Device Settings) build cleanly in Release configuration
  • Fresh install into /Library/Audio/Plug-Ins/HAL/ after sudo killall coreaudiod loads the new driver
  • New checkbox defaults to off — existing installs see no behavior change
  • Toggling the checkbox persists across app quit + relaunch
  • With checkbox on: disconnecting the proxied target device hides the proxy device from the system audio list; macOS correctly falls back to another output
  • With checkbox on: reconnecting the target device restores the proxy device automatically, and audio resumes routing through it
  • Normal volume/routing behavior works identically to the production release

Not explicitly tested (taking on faith given code symmetry with the checked-on path):

  • Default-off behavior during a disconnect (the kAudioDevicePropertyIsHidden getter gates on both the pref AND !outputDeviceReady, so with the pref off it always returns 0)

Happy to run additional scenarios if you'd like, @briankendall.

@mcg1969
mcg1969 marked this pull request as ready for review May 6, 2026 20:41
@briankendall
briankendall merged commit be390f7 into briankendall:master May 21, 2026
@briankendall

Copy link
Copy Markdown
Owner

This seems to work great! Thanks for the PR!

@bin101

bin101 commented Jul 10, 2026

Copy link
Copy Markdown

@briankendall Would be nice to release a new version for those who are not able to build the current changes on their own.

@briankendall

Copy link
Copy Markdown
Owner

@mcg1969 If you wouldn't mind could you give this beta release a try and see if everything is still working?

@mcg1969

mcg1969 commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the note! I will do that. My custom version has been working really well for me.

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.

4 participants