summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2020-10-17 10:08:26 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2020-10-17 10:08:26 +0200
commit98431ed56fad70a277a396aea69a67919b52a3ab (patch)
tree972de6bf5cd05f0cc003865b155e542d8cf080a7
parent0a727e0528c2b26c5cefb9bbf13f6b356e6fb3db (diff)
downloadnihav-player-98431ed56fad70a277a396aea69a67919b52a3ab.tar.gz
pause playback when prompt is active
-rw-r--r--sndplay/src/main.rs14
1 files 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", ' ');