Skip to content

aurora player

Joseph Chacko edited this page Jul 22, 2026 · 2 revisions

aurora-player — GUI Frontend

Relevant source files

The following files were used as context for generating this wiki page:

The aurora-player crate is the graphical user interface for the Aurora Music Player ecosystem. Built using the Slint UI framework and powered by the Tokio async runtime, it serves as a thin client that communicates with the aurora-daemon via Unix domain sockets.

High-Level Architecture

The application follows a reactive architecture where the Rust backend manages asynchronous communication and state synchronization, while the Slint frontend handles rendering and user interaction.

Crate Structure

  • main.rs: Entry point that initializes the Slint window and spawns the interface logic app/src/main.rs:8-19.
  • interface.rs: The "bridge" layer handling IPC, event dispatching, and Slint callback implementations.
  • ui/: Contains .slint files defining the visual layout and component hierarchy.
  • assets/: Bundled resources including fonts and fallback images app/src/main.rs:6-6.

Runtime & Entry Point

The application uses #[tokio::main] to manage the asynchronous bridge app/src/main.rs:8-8. Upon startup, it instantiates the AuroraPlayer Slint component and passes a weak handle to the interface module to begin the daemon handshake app/src/main.rs:11-13.

Component Hierarchy

The UI is structured as a single-window application with AuroraPlayer.slint acting as the root container. It manages global state properties (like current song metadata, volume, and queue) and delegates specific views to child components.

UI Component Relationship

graph TD
    subgraph "aurora-player (Rust)"
        Main["main()"] --> Interface["interface.rs (Tokio Task)"]
        Interface -->|Updates Properties| SlintRoot["AuroraPlayer (Slint Instance)"]
        SlintRoot -->|Triggers Callbacks| Interface
    end

    subgraph "AuroraPlayer.slint (Root Layout)"
        SlintRoot --> QV["QueueView"]
        SlintRoot --> MV["MainView (Switchable)"]
        SlintRoot --> PV["PlayerView (Transport)"]
        SlintRoot --> NV["NowPlayingView"]
        
        MV --> LV["LibraryView"]
        MV --> SV["SearchView"]
        MV --> PLV["PlaylistView"]
    end

    subgraph "External"
        Interface <==>|Unix Socket| Daemon["aurora-daemon"]
    end
Loading

Sources: app/src/main.rs:8-19, app/ui/AuroraPlayer.slint:1-14


The UI–Daemon Bridge

The core logic resides in interface.rs. This module establishes a connection to the daemon's Unix socket and manages two primary data flows:

  1. Outgoing Requests: Translating Slint callbacks (e.g., play(), seek(), add_to_playlist()) into aurora-protocol Request enums.
  2. Incoming Responses: Listening for Status, Queue, or Theme updates from the daemon and updating the Slint UI properties in real-time.

For details on socket handling and callback registration, see UI–Daemon Bridge (interface.rs).

Sources: app/src/main.rs:13-16, app/ui/AuroraPlayer.slint:21-52


Slint UI Components

The frontend is composed of several modular views and a shared library of custom widgets:

For details on the component hierarchy and event delegation, see Slint UI Components.

Sources: app/ui/AuroraPlayer.slint:1-14, app/ui/AuroraPlayer.slint:112-153


Theming & Assets

Aurora features a dynamic theming system and bundled assets to ensure a consistent experience across different environments.

Theming System

Themes are defined in the daemon's config.toml and broadcast to the player via the IPC channel. The player receives these updates and applies them to the global Theme singleton in Slint, which controls colors for backgrounds, text, and accents across all components app/ui/AuroraPlayer.slint:11-11.

For details on theme hot-reloading and the color pipeline, see Theming System.

Assets & Fonts

The player embeds its own assets using include_bytes! to remain portable.

For details on asset embedding and the image pipeline, see Assets & Fonts.

Sources: app/ui/AuroraPlayer.slint:110-110, app/ui/AuroraPlayer.slint:56-56


Data Flow: Code Entity Mapping

The following diagram maps high-level user actions to the specific code entities in the player crate that handle them.

User Interaction Flow

sequenceDiagram
    participant User
    participant Slint as "AuroraPlayer.slint"
    participant Interface as "interface.rs"
    participant Proto as "aurora-protocol"
    participant Daemon as "aurora-daemon"

    User->>Slint: Clicks Play on SongCard
    Slint->>Interface: trigger enqueue(song_id)
    Note over Interface: slint_handle.on_enqueue(...)
    Interface->>Proto: Request::Enqueue(id)
    Proto->>Daemon: JSON over Unix Socket
    Daemon-->>Proto: Response::Status(State)
    Proto-->>Interface: parse_response()
    Interface->>Slint: set_current_playing_id(id)
    Slint-->>User: Update UI (Green Highlight)
Loading

Sources: app/ui/AuroraPlayer.slint:31-31, app/src/main.rs:13-13

Clone this wiki locally