if !self.paused {
device.resume();
}
+ let mut no_display = false;
'main: loop {
let cur_time = decoder.samplepos.saturating_sub(u64::from(device.size() / 2 / u32::from(dst_info.channels)));
let full_ms = cur_time * 1000 / u64::from(arate);
let timestr = format_time(full_ms);
let disp_vol = if self.mute { 0 } else { self.volume };
- if !self.debug {
- print!("> {} / {} {}% \r", timestr, duration_str, disp_vol);
- } else {
- print!("> {} / {} |{}| {}% \r", timestr, duration_str, device.size(), disp_vol);
+ if !no_display {
+ if !self.debug {
+ print!("> {} / {} {}% \r", timestr, duration_str, disp_vol);
+ } else {
+ print!("> {} / {} |{}| {}% \r", timestr, duration_str, device.size(), disp_vol);
+ }
}
std::io::stdout().flush().unwrap();
if device.size() < underfill_limit && !self.paused && refill_limit < (1 << 20) {
device.resume();
}
},
+ Command::Seek(seek_time) => {
+ device.pause();
+ device.clear();
+ let _ret = decoder.seek(seek_time);
+ while !eof && device.size() < refill_limit {
+ eof = decoder.refill(&device);
+ }
+ if eof {
+ break 'main;
+ }
+ if !self.paused {
+ device.resume();
+ }
+ },
Command::Quit => {
device.pause();
self.ended = true;
Command::Debug => {
self.debug = !self.debug;
},
+ Command::PauseDisplay => { no_display = true; },
+ Command::ResumeDisplay => { no_display = false; },
};
- print!("\r{:60}\r", ' ');
+ if !no_display {
+ print!("\r{:60}\r", ' ');
+ }
}
thread::sleep(Duration::from_millis(200));
}