-
Notifications
You must be signed in to change notification settings - Fork 0
Data Types and Navigation
Relevant source files
The following files were used as context for generating this wiki page:
This page documents the foundational data structures and navigation components used in the Aurora player frontend. These definitions provide the bridge between the Rust backend's protocol types and the Slint UI's visual representation.
The Types.slint file defines the core struct and enum types used throughout the UI to represent playback state, song metadata, and playlist information.
Aurora distinguishes between a generic Song (used in lists and search results) and a CurrentSong (used for the active playback state).
-
CurrentSong: Tracks the real-time state of the playing track, including animagetype for album art andintvalues for duration and position tracking app/ui/Types.slint:1-9. -
Song: A metadata-heavy structure for library display. It includes UI-specific flags likeselectedfor multi-selection logic andlikedfor heart-icon toggles app/ui/Types.slint:16-25.
Playlists are handled via two structures to optimize memory and data transfer:
-
PlaylistMinimal: Used for the "All Playlists" view. It contains a list ofalbum-arts(up to 4) to generate a grid-style cover preview app/ui/Types.slint:27-32. -
Playlist: Used when a specific playlist is opened, containing the full array ofSongobjects app/ui/Types.slint:34-38.
The Theme global singleton serves as the central source of truth for all colors in the application. It is populated by the Rust backend via the interface.rs bridge when a theme update is received from the daemon app/ui/Types.slint:40-51.
The following diagram illustrates how entities defined in Types.slint map to the logical concepts used across the system.
Entity Mapping: Natural Language to Code Space
graph TD
subgraph "Natural Language Space"
A["Active Track"]
B["Library Entry"]
C["Collection Preview"]
D["Visual Palette"]
end
subgraph "Code Entity Space (Types.slint)"
A --> CS["struct CurrentSong"]
B --> S["struct Song"]
C --> PM["struct PlaylistMinimal"]
D --> T["global Theme"]
end
CS --- CS_Prop["title, artists, album_art, position"]
S --- S_Prop["id, selected, liked, duration"]
PM --- PM_Prop["title, length, album-arts"]
T --- T_Prop["bgd0..bgd4, acct, txt1, txt2"]
Sources: app/ui/Types.slint:1-51
Navigation in Aurora is controlled by the Tabs enum and the TabSelectorView component. The system uses a state-driven approach where changing the active-view property triggers visibility changes in the MainView.
The Tabs enum defines the primary navigation targets within the application app/ui/Types.slint:11-14.
| Variant | Target View |
|---|---|
Search |
Global search interface and results. |
Library |
Playlists, Liked songs, and Local library browsing. |
The TabSelectorView is a horizontal navigation bar containing TabButton instances. It manages the active-view property through two-way binding (<=>) app/ui/TabSelectorView.slint:34-35.
-
TabButton: A sub-component that handles hover/active visual states using theThemesingleton. It uses aTouchAreato detect clicks and update theactivestate app/ui/TabSelectorView.slint:2-32. -
Refresh Logic: When the "Library" tab is clicked, it triggers the
refresh-library()callback app/ui/TabSelectorView.slint:56-59. This callback is typically linked to the Rust backend to fetch the latest playlist and song data from the daemon.
The diagram below shows how a user interaction in TabSelectorView.slint propagates through the system.
Data Flow: Navigation Interaction
graph LR
subgraph "TabSelectorView.slint"
TA["TouchArea (Library)"] --> BC["button-clicked()"]
BC --> RL["callback refresh-library()"]
TA --> AV["active-view = Tabs.Library"]
end
subgraph "Interface Bridge"
RL --> RS["Rust: interface.rs"]
RS --> DQ["Request::GetPlaylists"]
end
subgraph "UI Update"
AV --> MV["MainView Visibility Logic"]
end
Sources: app/ui/TabSelectorView.slint:23-30, app/ui/TabSelectorView.slint:52-59, app/ui/Types.slint:11-14
The Theme singleton uses a naming convention for its properties to represent depth and hierarchy:
-
bgd0throughbgd4: Background shades, wherebgd0is the darkest (typically the main window background) andbgd4is the lightest (used for highlights or elevated surfaces) app/ui/Types.slint:41-45. -
acct: The accent color used for active tabs, sliders, and primary icons app/ui/Types.slint:48. -
txt1andtxt2: Primary and secondary text colors app/ui/Types.slint:46-47.
The TabButton implements smooth transitions for background and text colors using Slint's animate keyword, ensuring a fluid user experience when switching between views app/ui/TabSelectorView.slint:10-16. It also specifies the "JetBrainsMono NFP" font family to support the Nerd Font icons used in the labels (e.g., \u{f002} for the search magnifying glass) app/ui/TabSelectorView.slint:18,47,53.
Sources: app/ui/Types.slint:40-51, app/ui/TabSelectorView.slint:7-21
Overview
aurora-daemon
- Background Service
- Startup & State Init
- Request Handlers & Dispatch
- Playback Engine & Audio
- Library Indexing & Watching
- Playlists, Liked & History
- Background Threads
aurora-protocol
aurora-player
Reference