From 98431ed56fad70a277a396aea69a67919b52a3ab Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 17 Oct 2020 10:08:26 +0200 Subject: [PATCH] pause playback when prompt is active --- sndplay/src/main.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sndplay/src/main.rs b/sndplay/src/main.rs index 377c2d1..990507d 100644 --- a/sndplay/src/main.rs +++ b/sndplay/src/main.rs @@ -466,8 +466,18 @@ impl Player { Command::Debug => { self.debug = !self.debug; }, - Command::PauseDisplay => { no_display = true; }, - Command::ResumeDisplay => { no_display = false; }, + Command::PauseDisplay => { + no_display = true; + if !self.paused { + device.pause(); + } + }, + Command::ResumeDisplay => { + no_display = false; + if !self.paused { + device.resume(); + } + }, }; if !no_display { print!("\r{:60}\r", ' '); -- 2.39.5