# plutoberth/sonyheadphonesclient architecture

> Architecture diagram of the GitHub repository plutoberth/sonyheadphonesclient, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/plutoberth/sonyheadphonesclient
- Repository: https://github.com/plutoberth/sonyheadphonesclient

## Overview

Sony Headphones Client is a desktop alternative to Sony’s mobile app. The user opens the platform client, discovers and connects to a headset, then changes ambient/noise-cancelling or virtual-sound settings; commands are serialized and sent over Bluetooth. The sampled source establishes the Linux and Windows entry paths and shared client layers. macOS support and the listed features are documented, but its implementation was not sampled, so those relationships are shown only where supported or left unverified.

Main entry points: [`Client/CrossPlatformGUI.cpp`](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/CrossPlatformGUI.cpp) (Shared GUI), [`Client/BluetoothWrapper.cpp`](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/BluetoothWrapper.cpp) (Bluetooth wrapper), [`Client/linux/main.cpp`](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/linux/main.cpp) (Linux entry), [`Client/windows/main.cpp`](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/windows/main.cpp) (Windows entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_shared_gui["Shared GUI"]
  node_linux_gui["Linux GUI loop<br/>[LinuxGUI.cpp]"]
  node_windows_gui["Windows GUI loop<br/>[WindowsGUI.cpp]"]
  node_discovery["Device discovery"]
  node_timed_messages["Timed UI messages"]
  node_async_work["Async task coordination"]
end

subgraph group_domain["Headphone settings"]
  node_ambient["Ambient and NC controls"]
  node_virtual_sound["Virtual sound controls"]
  node_headphone_settings["Headphone settings<br/>[Headphones.cpp]"]
end

subgraph group_protocol["Bluetooth protocol"]
  node_bluetooth_wrapper["Bluetooth wrapper"]
  node_serializer["Command serializer"]
  node_connector_api["Bluetooth connector API"]
end

subgraph group_platform["Platform adapters"]
  node_linux_entry["Linux entry<br/>[main.cpp]"]
  node_windows_entry["Windows entry<br/>[main.cpp]"]
  node_macos_client["macOS client"]
  node_linux_bt["Linux Bluetooth"]
  node_windows_bt["Windows Bluetooth"]
  node_macos_bt["macOS Bluetooth"]
end

node_user(("Desktop user"))
node_headset(("Sony headset"))

node_user -->|"starts"| node_linux_entry
node_user -->|"starts"| node_windows_entry
node_linux_entry -->|"constructs"| node_linux_bt
node_linux_entry -->|"wraps connector"| node_bluetooth_wrapper
node_linux_entry -->|"starts loop"| node_linux_gui
node_windows_entry -->|"constructs"| node_windows_bt
node_windows_entry -->|"wraps connector"| node_bluetooth_wrapper
node_windows_entry -->|"starts loop"| node_windows_gui
node_linux_gui -->|"runs passes"| node_shared_gui
node_windows_gui -->|"runs passes"| node_shared_gui
node_shared_gui -->|"renders"| node_discovery
node_shared_gui -->|"renders"| node_ambient
node_shared_gui -->|"renders"| node_virtual_sound
node_shared_gui -->|"uses"| node_headphone_settings
node_shared_gui -->|"uses"| node_bluetooth_wrapper
node_shared_gui -->|"uses"| node_timed_messages
node_shared_gui -->|"uses"| node_async_work
node_headphone_settings -->|"sends settings"| node_bluetooth_wrapper
node_headphone_settings -->|"serializes commands"| node_serializer
node_bluetooth_wrapper -->|"packages commands"| node_serializer
node_bluetooth_wrapper -->|"dispatches I/O"| node_connector_api
node_linux_bt -->|"implements"| node_connector_api
node_windows_bt -->|"implements"| node_connector_api
node_bluetooth_wrapper -->|"transfers commands"| node_headset
node_user -.->|"uses"| node_macos_client
node_macos_client -.->|"uses"| node_macos_bt
node_macos_client -.->|"uses"| node_shared_gui
node_ambient -->|"changes settings"| node_headset
node_virtual_sound -->|"changes settings"| node_headset

click node_linux_entry "https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/linux/main.cpp"
click node_windows_entry "https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/windows/main.cpp"
click node_shared_gui "https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/CrossPlatformGUI.cpp"
click node_linux_gui "https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/linux/LinuxGUI.cpp"
click node_windows_gui "https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/windows/WindowsGUI.cpp"
click node_macos_client "https://github.com/plutoberth/sonyheadphonesclient/tree/master/Client/macos"
click node_discovery "https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/CrossPlatformGUI.cpp"
click node_ambient "https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/CrossPlatformGUI.cpp"
click node_virtual_sound "https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/CrossPlatformGUI.cpp"
click node_headphone_settings "https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/Headphones.cpp"
click node_bluetooth_wrapper "https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/BluetoothWrapper.cpp"
click node_serializer "https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/CommandSerializer.cpp"
click node_connector_api "https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/IBluetoothConnector.h"
click node_linux_bt "https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/linux/LinuxBluetoothConnector.cpp"
click node_windows_bt "https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/windows/WindowsBluetoothConnector.cpp"
click node_macos_bt "https://github.com/plutoberth/sonyheadphonesclient/tree/master/Client/macos"
click node_timed_messages "https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/TimedMessageQueue.cpp"
click node_async_work "https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/SingleInstanceFuture.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_shared_gui,node_linux_gui,node_windows_gui,node_discovery,node_timed_messages,node_async_work,node_user toneBlue
class node_ambient,node_virtual_sound,node_headphone_settings toneAmber
class node_bluetooth_wrapper,node_serializer,node_connector_api toneMint
class node_linux_entry,node_windows_entry,node_macos_client,node_linux_bt,node_windows_bt,node_macos_bt toneRose
class node_headset toneIndigo
```

## Components

### User interface

- [Shared GUI](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/CrossPlatformGUI.cpp): `Client/CrossPlatformGUI.cpp`
- [Linux GUI loop](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/linux/LinuxGUI.cpp): `Client/linux/LinuxGUI.cpp`
- [Windows GUI loop](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/windows/WindowsGUI.cpp): `Client/windows/WindowsGUI.cpp`
- [Device discovery](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/CrossPlatformGUI.cpp): `Client/CrossPlatformGUI.cpp`
- [Timed UI messages](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/TimedMessageQueue.cpp): `Client/TimedMessageQueue.cpp`
- [Async task coordination](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/SingleInstanceFuture.h): `Client/SingleInstanceFuture.h`

### Headphone settings

- [Ambient and NC controls](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/CrossPlatformGUI.cpp): `Client/CrossPlatformGUI.cpp`
- [Virtual sound controls](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/CrossPlatformGUI.cpp): `Client/CrossPlatformGUI.cpp`
- [Headphone settings](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/Headphones.cpp): `Client/Headphones.cpp`

### Bluetooth protocol

- [Bluetooth wrapper](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/BluetoothWrapper.cpp): `Client/BluetoothWrapper.cpp`
- [Command serializer](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/CommandSerializer.cpp): `Client/CommandSerializer.cpp`
- [Bluetooth connector API](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/IBluetoothConnector.h): `Client/IBluetoothConnector.h`

### Platform adapters

- [Linux entry](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/linux/main.cpp): `Client/linux/main.cpp`
- [Windows entry](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/windows/main.cpp): `Client/windows/main.cpp`
- [macOS client](https://github.com/plutoberth/sonyheadphonesclient/tree/master/Client/macos): `Client/macos`
- [Linux Bluetooth](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/linux/LinuxBluetoothConnector.cpp): `Client/linux/LinuxBluetoothConnector.cpp`
- [Windows Bluetooth](https://github.com/plutoberth/sonyheadphonesclient/blob/master/Client/windows/WindowsBluetoothConnector.cpp): `Client/windows/WindowsBluetoothConnector.cpp`
- [macOS Bluetooth](https://github.com/plutoberth/sonyheadphonesclient/tree/master/Client/macos): `Client/macos`

### Other components

- **Desktop user**
- **Sony headset**

## Connections

- Desktop user → Linux entry: starts (evidence: `README.md`)
- Desktop user → Windows entry: starts (evidence: `README.md`)
- Linux entry → Linux Bluetooth: constructs (evidence: `Client/linux/main.cpp`)
- Linux entry → Bluetooth wrapper: wraps connector (evidence: `Client/linux/main.cpp`)
- Linux entry → Linux GUI loop: starts loop (evidence: `Client/linux/main.cpp`)
- Windows entry → Windows Bluetooth: constructs (evidence: `Client/windows/main.cpp`)
- Windows entry → Bluetooth wrapper: wraps connector (evidence: `Client/windows/main.cpp`)
- Windows entry → Windows GUI loop: starts loop (evidence: `Client/windows/main.cpp`)
- Linux GUI loop → Shared GUI: runs passes (evidence: `Client/linux/LinuxGUI.cpp`)
- Windows GUI loop → Shared GUI: runs passes
- Shared GUI → Device discovery: renders (evidence: `Client/CrossPlatformGUI.cpp`)
- Shared GUI → Ambient and NC controls: renders (evidence: `Client/CrossPlatformGUI.cpp`)
- Shared GUI → Virtual sound controls: renders (evidence: `Client/CrossPlatformGUI.cpp`)
- Shared GUI → Headphone settings: uses
- Shared GUI → Bluetooth wrapper: uses
- Shared GUI → Timed UI messages: uses
- Shared GUI → Async task coordination: uses
- Headphone settings → Bluetooth wrapper: sends settings (evidence: `Client/Headphones.cpp`)
- Headphone settings → Command serializer: serializes commands (evidence: `Client/Headphones.cpp`)
- Bluetooth wrapper → Command serializer: packages commands
- Bluetooth wrapper → Bluetooth connector API: dispatches I/O
- Linux Bluetooth → Bluetooth connector API: implements
- Windows Bluetooth → Bluetooth connector API: implements
- Bluetooth wrapper → Sony headset: transfers commands
- Desktop user → macOS client: uses (evidence: `README.md`)
- macOS client → macOS Bluetooth: uses
- macOS client → Shared GUI: uses
- Ambient and NC controls → Sony headset: changes settings (evidence: `README.md`)
- Virtual sound controls → Sony headset: changes settings (evidence: `README.md`)
