src/
├── main.rs # Entry point, CLI, terminal setup
├── config.rs # Config parsing, remote fetch, station merge
├── player.rs # MPV IPC via Unix socket
└── tui/
├── app.rs # Application state, key handling
├── event.rs # Async event loop
└── ui.rs # Ratatui rendering
Config File → load_config() → App
↓
fetch_remote_stations() → merge_stations()
↓
App.stations
↓
User Input → handle_key() → MpvPlayer
↓
MPV (via socket)
- Uses Unix socket IPC (
--input-ipc-server) - JSON commands sent over socket
- Background task reads events for track metadata
- Tokio runtime
- Event channel for keyboard/tick/resize
- Player state behind
Arc<Mutex<_>> - UI never blocks on I/O