# ganeshedula/realme_air_7_controller_for_mac architecture

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

- Interactive diagram: https://gitdiagram.com/ganeshedula/realme_air_7_controller_for_mac
- Repository: https://github.com/ganeshedula/realme_air_7_controller_for_mac

## Overview

Air 7 Menu is a native macOS menu-bar companion for realme Buds Air 7. Its main workflow is to observe earbud connections and audio output, establish the earbuds’ Bluetooth control channel, parse device replies into connection and battery/control state, then present status and controls in the menu bar or a connection pop-up. The app also supports low-battery notifications and launch-at-login preferences; a separate monitor can relaunch the app on a fresh connection. Some protocol and hardware behavior is firmware-dependent; unsampled model code limits the detail of its internal links.

Main entry points: [`Sources/Air7Menu/EarbudModel.swift`](https://github.com/ganeshedula/realme_air_7_controller_for_mac/blob/main/Sources/Air7Menu/EarbudModel.swift) (Earbud model), [`Sources/Air7Monitor/main.swift`](https://github.com/ganeshedula/realme_air_7_controller_for_mac/blob/main/Sources/Air7Monitor/main.swift) (Air7Monitor), [`Sources/Air7Menu/Air7MenuApp.swift`](https://github.com/ganeshedula/realme_air_7_controller_for_mac/blob/main/Sources/Air7Menu/Air7MenuApp.swift) (Menu bar app), [`Sources/Air7Menu/PopoverView.swift`](https://github.com/ganeshedula/realme_air_7_controller_for_mac/blob/main/Sources/Air7Menu/PopoverView.swift) (Menu controls and battery views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_monitoring["Connection monitoring"]
  node_monitor["Air7Monitor<br/>[main.swift]"]
end

subgraph group_device["Device communication"]
  node_protocol["RFCOMM framing and decoding"]
end

subgraph group_app["App state and lifecycle"]
  node_model["Earbud model<br/>[EarbudModel.swift]"]
  node_appentry["Menu bar app<br/>[Air7MenuApp.swift]"]
  node_preferences["Login and connection preferences<br/>[EarbudModel.swift]"]
end

subgraph group_presentation["User interface"]
  node_controls["Menu controls and battery views<br/>[PopoverView.swift]"]
end

node_user(("User"))
node_bluetooth["macOS Bluetooth"]
node_audio["Default audio output"]
node_notifications["macOS notifications"]

node_bluetooth -->|"reports connection events"| node_monitor
node_monitor -->|"launches on connection"| node_appentry
node_monitor -->|"posts connection event"| node_model
node_bluetooth -->|"provides device access"| node_model
node_audio -->|"provides output state"| node_model
node_model -->|"uses frame parser"| node_protocol
node_appentry -->|"creates and configures"| node_model
node_appentry -->|"presents controls"| node_controls
node_controls -->|"reads state and sends actions"| node_model
node_model -->|"posts battery alerts"| node_notifications
node_user -->|"views and adjusts"| node_controls
node_user -->|"sets preferences"| node_preferences
node_preferences -->|"shares connection preference"| node_monitor

click node_monitor "https://github.com/ganeshedula/realme_air_7_controller_for_mac/blob/main/Sources/Air7Monitor/main.swift"
click node_model "https://github.com/ganeshedula/realme_air_7_controller_for_mac/blob/main/Sources/Air7Menu/EarbudModel.swift"
click node_protocol "https://github.com/ganeshedula/realme_air_7_controller_for_mac/blob/main/Sources/Air7Menu/Air7FrameParser.swift"
click node_appentry "https://github.com/ganeshedula/realme_air_7_controller_for_mac/blob/main/Sources/Air7Menu/Air7MenuApp.swift"
click node_controls "https://github.com/ganeshedula/realme_air_7_controller_for_mac/blob/main/Sources/Air7Menu/PopoverView.swift"
click node_preferences "https://github.com/ganeshedula/realme_air_7_controller_for_mac/blob/main/Sources/Air7Menu/EarbudModel.swift"

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_monitor,node_user toneBlue
class node_protocol toneAmber
class node_model,node_appentry,node_preferences toneMint
class node_controls toneRose
class node_bluetooth,node_audio,node_notifications toneIndigo
```

## Components

### Connection monitoring

- [Air7Monitor](https://github.com/ganeshedula/realme_air_7_controller_for_mac/blob/main/Sources/Air7Monitor/main.swift): `Sources/Air7Monitor/main.swift`

### Device communication

- [RFCOMM framing and decoding](https://github.com/ganeshedula/realme_air_7_controller_for_mac/blob/main/Sources/Air7Menu/Air7FrameParser.swift): `Sources/Air7Menu/Air7FrameParser.swift`

### App state and lifecycle

- [Earbud model](https://github.com/ganeshedula/realme_air_7_controller_for_mac/blob/main/Sources/Air7Menu/EarbudModel.swift): `Sources/Air7Menu/EarbudModel.swift`
- [Menu bar app](https://github.com/ganeshedula/realme_air_7_controller_for_mac/blob/main/Sources/Air7Menu/Air7MenuApp.swift): `Sources/Air7Menu/Air7MenuApp.swift`
- [Login and connection preferences](https://github.com/ganeshedula/realme_air_7_controller_for_mac/blob/main/Sources/Air7Menu/EarbudModel.swift): `Sources/Air7Menu/EarbudModel.swift`

### User interface

- [Menu controls and battery views](https://github.com/ganeshedula/realme_air_7_controller_for_mac/blob/main/Sources/Air7Menu/PopoverView.swift): `Sources/Air7Menu/PopoverView.swift`

### Other components

- **User**
- **macOS Bluetooth**
- **Default audio output**
- **macOS notifications**

## Connections

- macOS Bluetooth → Air7Monitor: reports connection events (evidence: `Sources/Air7Monitor/main.swift`)
- Air7Monitor → Menu bar app: launches on connection (evidence: `Sources/Air7Monitor/main.swift`)
- Air7Monitor → Earbud model: posts connection event (evidence: `Sources/Air7Monitor/main.swift`)
- macOS Bluetooth → Earbud model: provides device access (evidence: `Sources/Air7Menu/EarbudModel.swift`)
- Default audio output → Earbud model: provides output state (evidence: `Sources/Air7Menu/EarbudModel.swift`)
- Earbud model → RFCOMM framing and decoding: uses frame parser (evidence: `Sources/Air7Menu/EarbudModel.swift`)
- Menu bar app → Earbud model: creates and configures (evidence: `Sources/Air7Menu/Air7MenuApp.swift`)
- Menu bar app → Menu controls and battery views: presents controls (evidence: `Sources/Air7Menu/Air7MenuApp.swift`)
- Menu controls and battery views → Earbud model: reads state and sends actions (evidence: `Sources/Air7Menu/PopoverView.swift`)
- Earbud model → macOS notifications: posts battery alerts (evidence: `Sources/Air7Menu/EarbudModel.swift`)
- User → Menu controls and battery views: views and adjusts (evidence: `Sources/Air7Menu/PopoverView.swift`)
- User → Login and connection preferences: sets preferences
- Login and connection preferences → Air7Monitor: shares connection preference (evidence: `Sources/Air7Monitor/main.swift`)
