# alpha-9669/youtube-player-music architecture

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

- Interactive diagram: https://gitdiagram.com/alpha-9669/youtube-player-music
- Repository: https://github.com/alpha-9669/youtube-player-music

## Overview

A3YT is an Arma 3 addon for playing YouTube audio in-game, with playlist and local-volume controls. The user-facing flow runs through the addon’s UI and functions, an extension command/playback layer, and a managed resolver that obtains playable audio; native audio output then plays it. The tree and excerpts support the extension’s audio and helper dependencies and the resolver’s cache dependencies. Addon-to-extension wiring is not shown in the supplied evidence, so that connection is marked unverified; the README is empty.

Main entry points: [`src/extension/a3yt_player.cpp`](https://github.com/alpha-9669/youtube-player-music/blob/main/src/extension/a3yt_player.cpp) (Playback commands), [`src/native/A3YT.Native/Exports.cs`](https://github.com/alpha-9669/youtube-player-music/blob/main/src/native/A3YT.Native/Exports.cs) (Resolver exports), [`src/addon/a3yt_player/functions`](https://github.com/alpha-9669/youtube-player-music/tree/main/src/addon/a3yt_player/functions) (Player functions), [`src/addon/a3yt_player/functions/fn_uiModuleYoutube.sqf`](https://github.com/alpha-9669/youtube-player-music/blob/main/src/addon/a3yt_player/functions/fn_uiModuleYoutube.sqf) (Playback UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_arma["Arma addon"]
  node_player["Player controls<br/>[config.cpp]"]
  node_player_functions["Player functions"]
  node_player_ui["Playback UI"]
  node_volume_ui["Local volume UI"]
  node_radio["Radio controls"]
end

subgraph group_playback["Playback extension"]
  node_extension["Playback commands<br/>[a3yt_player.cpp]"]
  node_audio_output["Audio routing<br/>[audio_output.hpp]"]
  node_protocol_helpers["Protocol helpers"]
end

subgraph group_resolver["Resolution and cache"]
  node_native_exports["Resolver exports<br/>[Exports.cs]"]
  node_hls_cache[("HLS audio cache<br/>[HlsAudioCache.cs]")]
  node_expiring_cache[("Metadata cache<br/>[ExpiringCache.cs]")]
end

subgraph group_platform["External services"]
  node_youtube["YouTube"]
  node_windows_audio["Windows audio"]
end

node_user(("Arma player"))

node_user -.->|"uses"| node_player_ui
node_player_ui -.->|"dispatches"| node_player_functions
node_player -->|"configures"| node_player_functions
node_player_functions -.->|"commands"| node_extension
node_volume_ui -.->|"controls volume"| node_player_functions
node_radio -.->|"sends commands"| node_extension
node_extension -->|"configures output"| node_audio_output
node_extension -->|"uses helpers"| node_protocol_helpers
node_extension -.->|"resolves media"| node_native_exports
node_native_exports -->|"uses cache"| node_hls_cache
node_native_exports -->|"uses cache"| node_expiring_cache
node_native_exports -->|"requests metadata"| node_youtube
node_hls_cache -->|"downloads audio"| node_youtube
node_audio_output -.->|"selects renderer"| node_windows_audio

click node_player "https://github.com/alpha-9669/youtube-player-music/blob/main/src/addon/a3yt_player/config.cpp"
click node_player_functions "https://github.com/alpha-9669/youtube-player-music/tree/main/src/addon/a3yt_player/functions"
click node_player_ui "https://github.com/alpha-9669/youtube-player-music/blob/main/src/addon/a3yt_player/functions/fn_uiModuleYoutube.sqf"
click node_volume_ui "https://github.com/alpha-9669/youtube-player-music/blob/main/src/addon/a3yt_player/functions/fn_uiLocalVolumeSettings.sqf"
click node_radio "https://github.com/alpha-9669/youtube-player-music/tree/main/src/addon/a3yt_radio/functions"
click node_extension "https://github.com/alpha-9669/youtube-player-music/blob/main/src/extension/a3yt_player.cpp"
click node_audio_output "https://github.com/alpha-9669/youtube-player-music/blob/main/src/extension/audio_output.hpp"
click node_protocol_helpers "https://github.com/alpha-9669/youtube-player-music/blob/main/src/extension/extension_common.hpp"
click node_native_exports "https://github.com/alpha-9669/youtube-player-music/blob/main/src/native/A3YT.Native/Exports.cs"
click node_hls_cache "https://github.com/alpha-9669/youtube-player-music/blob/main/src/native/A3YT.Native/HlsAudioCache.cs"
click node_expiring_cache "https://github.com/alpha-9669/youtube-player-music/blob/main/src/native/A3YT.Native/ExpiringCache.cs"

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_player,node_player_functions,node_player_ui,node_volume_ui,node_radio toneBlue
class node_extension,node_audio_output,node_protocol_helpers toneAmber
class node_native_exports,node_hls_cache,node_expiring_cache toneMint
class node_youtube,node_windows_audio toneRose
class node_user toneIndigo
```

## Components

### Arma addon

- [Player controls](https://github.com/alpha-9669/youtube-player-music/blob/main/src/addon/a3yt_player/config.cpp): `src/addon/a3yt_player/config.cpp`
- [Player functions](https://github.com/alpha-9669/youtube-player-music/tree/main/src/addon/a3yt_player/functions): `src/addon/a3yt_player/functions`
- [Playback UI](https://github.com/alpha-9669/youtube-player-music/blob/main/src/addon/a3yt_player/functions/fn_uiModuleYoutube.sqf): `src/addon/a3yt_player/functions/fn_uiModuleYoutube.sqf`
- [Local volume UI](https://github.com/alpha-9669/youtube-player-music/blob/main/src/addon/a3yt_player/functions/fn_uiLocalVolumeSettings.sqf): `src/addon/a3yt_player/functions/fn_uiLocalVolumeSettings.sqf`
- [Radio controls](https://github.com/alpha-9669/youtube-player-music/tree/main/src/addon/a3yt_radio/functions): `src/addon/a3yt_radio/functions`

### Playback extension

- [Playback commands](https://github.com/alpha-9669/youtube-player-music/blob/main/src/extension/a3yt_player.cpp): `src/extension/a3yt_player.cpp`
- [Audio routing](https://github.com/alpha-9669/youtube-player-music/blob/main/src/extension/audio_output.hpp): `src/extension/audio_output.hpp`
- [Protocol helpers](https://github.com/alpha-9669/youtube-player-music/blob/main/src/extension/extension_common.hpp): `src/extension/extension_common.hpp`

### Resolution and cache

- [Resolver exports](https://github.com/alpha-9669/youtube-player-music/blob/main/src/native/A3YT.Native/Exports.cs): `src/native/A3YT.Native/Exports.cs`
- [HLS audio cache](https://github.com/alpha-9669/youtube-player-music/blob/main/src/native/A3YT.Native/HlsAudioCache.cs): `src/native/A3YT.Native/HlsAudioCache.cs`
- [Metadata cache](https://github.com/alpha-9669/youtube-player-music/blob/main/src/native/A3YT.Native/ExpiringCache.cs): `src/native/A3YT.Native/ExpiringCache.cs`

### External services

- **YouTube**
- **Windows audio**

### Other components

- **Arma player**

## Connections

- Arma player → Playback UI: uses
- Playback UI → Player functions: dispatches
- Player controls → Player functions: configures (evidence: `src/addon/a3yt_player/config.cpp`)
- Player functions → Playback commands: commands
- Local volume UI → Player functions: controls volume
- Radio controls → Playback commands: sends commands
- Playback commands → Audio routing: configures output (evidence: `src/extension/a3yt_player.cpp`)
- Playback commands → Protocol helpers: uses helpers (evidence: `src/extension/a3yt_player.cpp`)
- Playback commands → Resolver exports: resolves media
- Resolver exports → HLS audio cache: uses cache (evidence: `src/native/A3YT.Native/Exports.cs`)
- Resolver exports → Metadata cache: uses cache (evidence: `src/native/A3YT.Native/Exports.cs`)
- Resolver exports → YouTube: requests metadata (evidence: `src/native/A3YT.Native/Exports.cs`)
- HLS audio cache → YouTube: downloads audio (evidence: `src/native/A3YT.Native/HlsAudioCache.cs`)
- Audio routing → Windows audio: selects renderer
