# space928/qplayer architecture

> Architecture diagram of the GitHub repository space928/qplayer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/space928/qplayer
- Repository: https://github.com/space928/qplayer

## Overview

##### Project type and purpose
- QPlayer is a Windows-only, .NET 7 WPF desktop application that implements the Model-View-ViewModel (MVVM) pattern to present and control theatrical audio cue lists.
- It uses the NAudio library for core media playback and provides concurrent cue playback, fades, pre-delays, OSC control, theming, and caching.

##### File structure
- Top level: QPlayer.sln and two roots:
- QPlayer/ – the WPF application
· App.xaml, App.xaml.cs – application bootstrap
· Views/ – XAML windows and controls (UI layer)
· ViewModels/ – presentation logic layer
· Models/ – domain models (OSCDriver, ShowFile, PeakFile)
· Audio/ – audio-engine services (AudioPlaybackManager, SampleProviders, MediaCacheManager)
· ThemesV2/ – theming resources and controllers
· Properties/PublishProfiles – deployment settings
· QPlayer.csproj, FodyWeavers.xml – build and weaving config
- docs/ – separate Astro-based documentation site
- No server-side or remote backend. External dependencies: NAudio and optionally OSC network.

##### README
- Confirms WPF/.NET 7, MVVM, use of NAudio, theatre cue-list features.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        UI["UI Layer\n(WPF Views)"]:::presentation
        AppBootstrap["App.xaml & App.xaml.cs"]:::presentation
        VM["ViewModels"]:::presentation
    end

    %% Domain & Services Layer
    subgraph "Domain & Services"
        direction TB
        subgraph "Domain Models"
            ShowFile["ShowFile"]:::domain
            PeakFile["PeakFile"]:::domain
            OSCDriver["OSCDriver"]:::domain
        end
        AudioPlaybackManager["AudioPlaybackManager"]:::domain
        subgraph "SampleProviders Chain"
            EQSampleProvider["EQSampleProvider"]:::domain
            FadingSampleProvider["FadingSampleProvider"]:::domain
            LoopingSampleProvider["LoopingSampleProvider"]:::domain
            VectorExtensions["VectorExtensions"]:::domain
        end
        MediaCacheManager["MediaCacheManager"]:::domain
        ThemesController["ThemesController"]:::domain
    end

    %% External Dependencies
    subgraph "External Dependencies"
        direction TB
        NAudio["NAudio Library"]:::external
        FileSystem["File System"]:::external
        OSCNet["OSC Network Interface"]:::external
        Docs["Documentation Site"]:::external
    end

    %% Connections
    UI -->|"Bind / Commands"| VM
    AppBootstrap --> UI
    AppBootstrap --> VM
    VM -->|"PlayCue(), PauseCue(), PreloadCue()"| AudioPlaybackManager
    VM -->|"Cache lookup / persistence"| MediaCacheManager
    VM -->|"Load/Save CueLists"| FileSystem
    VM -->|"Interacts"| ShowFile
    VM -->|"Interacts"| PeakFile
    VM -->|"Interacts"| OSCDriver
    AudioPlaybackManager -->|"Orchestrates"| EQSampleProvider
    EQSampleProvider -->|"Decorator →"| FadingSampleProvider
    FadingSampleProvider -->|"Decorator →"| LoopingSampleProvider
    LoopingSampleProvider -->|"Uses Helpers"| VectorExtensions
    LoopingSampleProvider --> NAudio
    MediaCacheManager -->|"Reads/Writes"| FileSystem
    OSCNet <-->|"OSC message"| OSCDriver
    ThemesController -->|"Applies Resources"| UI

    %% Click Events
    click UI "https://github.com/space928/qplayer/tree/main/QPlayer/Views/"
    click AppBootstrap "https://github.com/space928/qplayer/blob/main/QPlayer/App.xaml"
    click AppBootstrap "https://github.com/space928/qplayer/blob/main/QPlayer/App.xaml.cs"
    click VM "https://github.com/space928/qplayer/tree/main/QPlayer/ViewModels/"
    click ShowFile "https://github.com/space928/qplayer/blob/main/QPlayer/Models/ShowFile.cs"
    click PeakFile "https://github.com/space928/qplayer/blob/main/QPlayer/Models/PeakFile.cs"
    click OSCDriver "https://github.com/space928/qplayer/blob/main/QPlayer/Models/OSCDriver.cs"
    click AudioPlaybackManager "https://github.com/space928/qplayer/blob/main/QPlayer/Audio/AudioPlaybackManager.cs"
    click MediaCacheManager "https://github.com/space928/qplayer/blob/main/QPlayer/Audio/MediaCacheManager.cs"
    click EQSampleProvider "https://github.com/space928/qplayer/blob/main/QPlayer/Audio/EQSampleProvider.cs"
    click FadingSampleProvider "https://github.com/space928/qplayer/blob/main/QPlayer/Audio/FadingSampleProvider.cs"
    click LoopingSampleProvider "https://github.com/space928/qplayer/blob/main/QPlayer/Audio/LoopingSampleProvider.cs"
    click VectorExtensions "https://github.com/space928/qplayer/blob/main/QPlayer/Audio/VectorExtensions.cs"
    click ThemesController "https://github.com/space928/qplayer/blob/main/QPlayer/ThemesV2/ThemesController.cs"
    click FodyWeavers "https://github.com/space928/qplayer/blob/main/QPlayer/FodyWeavers.xml"
    click Project "https://github.com/space928/qplayer/blob/main/QPlayer/QPlayer.csproj"
    click Docs "https://github.com/space928/qplayer/tree/main/docs/"

    %% Styles
    classDef presentation fill:#D0E8FF,stroke:#005BAB,color:#000;
    classDef domain fill:#DFFFE0,stroke:#2E8B57,color:#000;
    classDef external fill:#FFEFD5,stroke:#D2691E,color:#000;
```
