From: Kostya Shishkov Date: Sat, 17 Oct 2020 08:08:26 +0000 (+0200) Subject: pause playback when prompt is active X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=98431ed56fad70a277a396aea69a67919b52a3ab;p=nihav-player.git pause playback when prompt is active --- 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", ' ');