How artistro08/sony-control works
Sony Control is a Windows 11 tray application for discovering and managing supported Sony headphones through a WinUI flyout. Its main workflow tracks Windows Bluetooth devices, identifies headsets, connects according to saved preferences, and exposes battery, noise-control, equalizer, and other device controls. Presentation view models mediate between the tray UI and headset management; native code bridges to transport and Sony protocol handling. The README documents broader model support; source excerpts show key ownership boundaries but not every UI or protocol call, so uncertain wiring is omitted.
Main entry points: HeadsetManager.cs Headset manager · HeadsetController.cpp Headset controller · App.xaml.cs App startup and composition · FlyoutViewModel.cs Flyout view model
Components 24
Tray application
- App startup and composition
src/SonyControl.App/App.xaml.cs - Tray and flyout UI
src/SonyControl.App/TrayIcon.cs - Settings UI
src/SonyControl.App/Views/Settings - Windows notifications
src/SonyControl.App/AppNotificationService.cs
Presentation
- Flyout view model
src/SonyControl.Presentation/ViewModels/FlyoutViewModel.cs - Headset view model
src/SonyControl.Presentation/ViewModels/HeadsetViewModel.cs - Settings view model
src/SonyControl.Presentation/ViewModels/SettingsViewModel.cs - Headset manager
src/SonyControl.Presentation/Devices/HeadsetManager.cs - Bluetooth device watcher
src/SonyControl.Presentation/Devices/BluetoothDeviceWatcher.cs - Managed headset
src/SonyControl.Presentation/Devices/ManagedHeadset.cs - App settings
src/SonyControl.Presentation/Settings/AppSettings.cs - Low battery monitor
src/SonyControl.Presentation/Notifications/LowBatteryMonitor.cs - WinRT headset adapter
src/SonyControl.Presentation/Headsets/WinRtHeadset.cs
Headset control
- Native headset client
native/SonyControl.Core/HeadsetClient.cpp - Bluetooth audio control
native/SonyControl.Core/BluetoothAudio.cpp
Sony protocol
- Headset controller
native/SonyProtocol/src/HeadsetController.cpp - Protocol session
native/SonyProtocol/src/SonyProtocolSession.cpp - Frame codec
native/SonyProtocol/src/FrameCodec.cpp - Protocol generations
native/SonyProtocol/src/ProtocolV1.cpp - Device profiles
native/SonyProtocol/src/DeviceProfileRegistry.cpp - Device event dispatcher
native/SonyProtocol/src/DeviceEventDispatcher.cpp
Bluetooth transport
- Windows RFCOMM transport
native/SonyTransport/src/WindowsRfcommTransport.cpp
Other components
- Windows user
- Sony Bluetooth headset
Connections 28
- Windows user → Tray and flyout UI: uses
- App startup and composition → Headset manager: creates
- App startup and composition → Flyout view model: creates
- App startup and composition → Settings view model: creates
- App startup and composition → Windows notifications: registers
- Tray and flyout UI → Flyout view model: presents
- Settings UI → Settings view model: edits settings
- Flyout view model → Headset manager: observes devices
- Flyout view model → Headset view model: creates
- Headset manager → Bluetooth device watcher: starts watching
- Bluetooth device watcher → Headset manager: reports devices
- Headset manager → Managed headset: tracks
- Headset manager → App settings: reads preferences
- Headset manager → WinRT headset adapter: connects headset
- Headset view model → WinRT headset adapter: controls headset
- Headset view model → Low battery monitor: monitors level
- Low battery monitor → Windows notifications: shows alert
- Settings view model → App settings: updates preferences
- WinRT headset adapter → Native headset client: calls native API
- Native headset client → Headset controller: runs commands
- Native headset client → Bluetooth audio control: controls audio link
- Headset controller → Protocol session: opens session
- Headset controller → Protocol generations: dispatches commands
- Headset controller → Device profiles: selects profile
- Headset controller → Device event dispatcher: publishes state
- Protocol session → Frame codec: encodes frames
- Protocol session → Windows RFCOMM transport: transfers bytes
- Windows RFCOMM transport → Sony Bluetooth headset: Bluetooth link