How abraxas-724/volumecontrol works
VolumeControl is a macOS menu-bar audio-control app. Its main workflow discovers active audio applications, lets a user enable per-app gain/mute, validates a live Process Tap session, and restores saved settings when eligible applications return. A parallel branch controls system volume and output selection; an advanced, mutually exclusive BlackHole routing test is also documented. The graph includes the principal UI, coordination, audio-session, and routing layers. Some subsystem links rely on README descriptions because their implementation files were not excerpted.
Main entry points: VolumeControlModel.swift Control Model · ProcessTapVolumeController.swift Process Tap Controller · AudioDeviceRouter.swift BlackHole Router · HALAudioRoutingEngine.swift HAL Route Engine
Components 23
Menu Bar UI
- Menu Bar Panel
Sources/VolumeControl/Presentation/MenuBarPopoverController.swift - App Mixer
Sources/VolumeControl/Presentation/AppMixerSection.swift - Settings
Sources/VolumeControl/Presentation/SettingsView.swift
App Coordination
- Control Model
Sources/VolumeControl/VolumeControlModel.swift - App Discovery
Sources/VolumeControl/ApplicationDiscovery.swift - Headphone Policy
Sources/VolumeControl/Application/HeadphoneAutoSwitchPolicy.swift
Per-App Audio
- Process Tap Controller
Sources/VolumeControl/Application/ProcessTapVolumeController.swift - Core Audio Session
Sources/VolumeControl/Infrastructure/ProcessAudio/CoreAudioProcessSession.swift - Process Audio HAL
Sources/VolumeControl/Infrastructure/ProcessAudio/ProcessAudioHAL.swift - Process Family
Sources/VolumeControl/Domain/AudioProcessFamily.swift - Session Validation
Sources/VolumeControl/Infrastructure/ProcessAudio/ProcessAudioValidationRunner.swift - Realtime PCM DSP
Sources/VolumeControlDSP/VolumeControlDSP.c
System Audio & Routing
- System Audio Service
Sources/VolumeControl/AudioService.swift - Device Monitor
Sources/VolumeControl/AudioDeviceMonitor.swift - Device Metadata
Sources/VolumeControl/Infrastructure/OutputDeviceMetadata.swift - BlackHole Router
Sources/VolumeControl/Audio/V2/AudioDeviceRouter.swift - Routing Devices
Sources/VolumeControl/Audio/V2/CoreAudioRoutingDevices.swift - HAL Route Engine
Sources/VolumeControl/Audio/V2/HALAudioRoutingEngine.swift - Route Validation
Sources/VolumeControl/Infrastructure/ProcessAudio/AudioRoutingValidationRunner.swift
Preferences & DSP
- Saved App Audio
Sources/VolumeControl/Infrastructure/ProcessAudio/UserDefaultsAppAudioPreferences.swift - Interface Preferences
Sources/VolumeControl/Application/InterfacePreferences.swift - Interface Store
Sources/VolumeControl/Infrastructure/Preferences/UserDefaultsInterfacePreferences.swift
Other components
- User
Connections 24
- User → Menu Bar Panel: opens panel
README.md - Menu Bar Panel → App Mixer: shows controls
- App Mixer → Control Model: changes app audio
- Settings → Control Model: configures behavior
Sources/VolumeControl/Presentation/SettingsView.swift - Control Model → App Discovery: refreshes apps
Sources/VolumeControl/VolumeControlModel.swift - Control Model → Process Tap Controller: enables and restores
Sources/VolumeControl/VolumeControlModel.swift - Control Model → System Audio Service: controls system audio
Sources/VolumeControl/VolumeControlModel.swift - Control Model → Device Monitor: monitors devices
Sources/VolumeControl/VolumeControlModel.swift - Control Model → Headphone Policy: evaluates switching
Sources/VolumeControl/VolumeControlModel.swift - Control Model → BlackHole Router: starts test routing
Sources/VolumeControl/VolumeControlModel.swift - Process Tap Controller → Core Audio Session: creates session
- Process Tap Controller → Saved App Audio: persists settings
Sources/VolumeControl/Application/ProcessTapVolumeController.swift - Core Audio Session → Process Audio HAL: uses HAL
Sources/VolumeControl/Infrastructure/ProcessAudio/CoreAudioProcessSession.swift - Core Audio Session → Process Family: uses process grouping
Sources/VolumeControl/Infrastructure/ProcessAudio/CoreAudioProcessSession.swift - Process Tap Controller → Session Validation: validates session
- BlackHole Router → Routing Devices: queries and switches
Sources/VolumeControl/Audio/V2/AudioDeviceRouter.swift - BlackHole Router → HAL Route Engine: starts engine
Sources/VolumeControl/Audio/V2/AudioDeviceRouter.swift - HAL Route Engine → Process Audio HAL: uses HAL helpers
Sources/VolumeControl/Audio/V2/HALAudioRoutingEngine.swift - HAL Route Engine → Realtime PCM DSP: renders PCM
Sources/VolumeControl/Audio/V2/HALAudioRoutingEngine.swift - Route Validation → BlackHole Router: validates routing
Sources/VolumeControl/Infrastructure/ProcessAudio/AudioRoutingValidationRunner.swift - Route Validation → HAL Route Engine: uses engine
Sources/VolumeControl/Infrastructure/ProcessAudio/AudioRoutingValidationRunner.swift - Device Metadata → Process Audio HAL: reads device details
Sources/VolumeControl/Infrastructure/OutputDeviceMetadata.swift - Interface Preferences → Interface Store: loads and saves
- Menu Bar Panel → Interface Preferences: reads appearance
Sources/VolumeControl/Presentation/MenuBarPopoverController.swift