aboutsummaryrefslogtreecommitdiffstats
path: root/src/daemon.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon.rs')
-rw-r--r--src/daemon.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/daemon.rs b/src/daemon.rs
index acc7729..2b38025 100644
--- a/src/daemon.rs
+++ b/src/daemon.rs
@@ -271,18 +271,22 @@ fn process_command(
271 } 271 }
272 "pause" => { 272 "pause" => {
273 audio.pause(); 273 audio.pause();
274 notification::notify_change("Paused");
274 "Paused\n".to_string() 275 "Paused\n".to_string()
275 } 276 }
276 "resume" => { 277 "resume" => {
277 audio.resume(); 278 audio.resume();
279 notification::notify_change("Resumed");
278 "Resumed\n".to_string() 280 "Resumed\n".to_string()
279 } 281 }
280 "toggle" => { 282 "toggle" => {
281 if audio.is_playing() { 283 if audio.is_playing() {
282 audio.pause(); 284 audio.pause();
285 notification::notify_change("Paused");
283 "Paused\n".to_string() 286 "Paused\n".to_string()
284 } else { 287 } else {
285 audio.resume(); 288 audio.resume();
289 notification::notify_change("Resumed");
286 "Resumed\n".to_string() 290 "Resumed\n".to_string()
287 } 291 }
288 } 292 }
@@ -291,6 +295,7 @@ fn process_command(
291 if let Ok(mut q) = queue.lock() { 295 if let Ok(mut q) = queue.lock() {
292 q.clear(); 296 q.clear();
293 } 297 }
298 notification::notify_change("Stopped");
294 "Stopped\n".to_string() 299 "Stopped\n".to_string()
295 } 300 }
296 "stop_daemon" => { 301 "stop_daemon" => {
@@ -551,6 +556,8 @@ fn process_command(
551 }; 556 };
552 if track_idx == playing_track_idx && is_playing { 557 if track_idx == playing_track_idx && is_playing {
553 output.push_str(&format!("> {} (playing)\n", track_str)); 558 output.push_str(&format!("> {} (playing)\n", track_str));
559 } else if track_idx == playing_track_idx && !is_playing {
560 output.push_str(&format!("> {} (paused)\n", track_str));
554 } else { 561 } else {
555 output.push_str(&format!(" {}\n", track_str)); 562 output.push_str(&format!(" {}\n", track_str));
556 } 563 }