From c88f056289040533b692fdf0e7cd06d2988e5c92 Mon Sep 17 00:00:00 2001 From: salmonik Date: Fri, 8 May 2026 00:55:52 +0200 Subject: Add desktop notifications for track changes, queue end, and errors Uses notify-rust to send D-Bus desktop notifications from the daemon when tracks change, the queue empties, or audio errors occur. --- src/audio.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/audio.rs') diff --git a/src/audio.rs b/src/audio.rs index 58ad2bf..7218f84 100644 --- a/src/audio.rs +++ b/src/audio.rs @@ -1,3 +1,4 @@ +use crate::notification; use std::path::PathBuf; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::mpsc::{self, Receiver, Sender}; @@ -331,6 +332,7 @@ fn audio_thread( Ok(stream) => { if let Err(e) = stream.play() { eprintln!("Failed to start stream: {}", e); + notification::notify_error("Failed to start audio stream"); is_playing.store(false, Ordering::SeqCst); } else { current_stream = Some(stream); @@ -338,12 +340,14 @@ fn audio_thread( } Err(e) => { eprintln!("Failed to create stream: {}", e); + notification::notify_error("Failed to create audio stream"); is_playing.store(false, Ordering::SeqCst); } } } Err(e) => { eprintln!("Failed to open audio: {}", e); + notification::notify_error("Failed to open audio file"); is_playing.store(false, Ordering::SeqCst); } } -- cgit v1.2.3