aboutsummaryrefslogtreecommitdiffstats
path: root/src/audio.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio.rs')
-rw-r--r--src/audio.rs4
1 files changed, 4 insertions, 0 deletions
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 @@
1use crate::notification;
1use std::path::PathBuf; 2use std::path::PathBuf;
2use std::sync::atomic::{AtomicBool, Ordering}; 3use std::sync::atomic::{AtomicBool, Ordering};
3use std::sync::mpsc::{self, Receiver, Sender}; 4use std::sync::mpsc::{self, Receiver, Sender};
@@ -331,6 +332,7 @@ fn audio_thread(
331 Ok(stream) => { 332 Ok(stream) => {
332 if let Err(e) = stream.play() { 333 if let Err(e) = stream.play() {
333 eprintln!("Failed to start stream: {}", e); 334 eprintln!("Failed to start stream: {}", e);
335 notification::notify_error("Failed to start audio stream");
334 is_playing.store(false, Ordering::SeqCst); 336 is_playing.store(false, Ordering::SeqCst);
335 } else { 337 } else {
336 current_stream = Some(stream); 338 current_stream = Some(stream);
@@ -338,12 +340,14 @@ fn audio_thread(
338 } 340 }
339 Err(e) => { 341 Err(e) => {
340 eprintln!("Failed to create stream: {}", e); 342 eprintln!("Failed to create stream: {}", e);
343 notification::notify_error("Failed to create audio stream");
341 is_playing.store(false, Ordering::SeqCst); 344 is_playing.store(false, Ordering::SeqCst);
342 } 345 }
343 } 346 }
344 } 347 }
345 Err(e) => { 348 Err(e) => {
346 eprintln!("Failed to open audio: {}", e); 349 eprintln!("Failed to open audio: {}", e);
350 notification::notify_error("Failed to open audio file");
347 is_playing.store(false, Ordering::SeqCst); 351 is_playing.store(false, Ordering::SeqCst);
348 } 352 }
349 } 353 }