Fix config loading, modularize crates, and add valid config template

This commit is contained in:
2026-07-21 21:09:04 +02:00
parent 66844ea01e
commit 4b731d406a
22 changed files with 6084 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
[package]
name = "riptune-types"
version.workspace = true
edition.workspace = true
license.workspace = true
description = "Shared command/event types crossing thread and crate boundaries (audio, MPRIS, niri, TUI)"
[dependencies]
+39
View File
@@ -0,0 +1,39 @@
//! Types shared across thread and crate boundaries.
//!
//! `AudioCommand`/`AudioEvent` cross the audio-thread channel; `AppEvent`
//! crosses between the TUI, MPRIS, and niri IPC layers. They live here —
//! deliberately dependency-free — so `riptune-mpris`, `riptune-niri`, and the
//! `riptune` binary all share one definition instead of each inventing their
//! own (which is exactly the bug that broke the build previously: two
//! different `AudioCommand` types that looked identical but weren't).
use std::time::Duration;
#[derive(Debug, Clone)]
pub enum AudioCommand {
Play { stream_url: String },
Pause,
Resume,
Stop,
Seek(Duration),
SetVolume(f32),
}
#[derive(Debug, Clone)]
pub enum AudioEvent {
PositionChanged(Duration),
TrackFinished,
Buffering,
Error(String),
}
#[derive(Debug, Clone)]
pub enum AppEvent {
/// User favorited/unfavorited a track (mirrors Subsonic star/unstar + can be
/// triggered from a niri keybind, MPRIS client, or the TUI itself).
ToggleFavorite { track_id: String },
/// Fired by the niri IPC listener when the focused workspace changes.
WorkspaceChanged { name: Option<String> },
NextTrack,
PreviousTrack,
}