mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
display/play/stop transport
This commit is contained in:
parent
265dc13248
commit
1f928fba9d
8 changed files with 251 additions and 177 deletions
|
|
@ -214,8 +214,9 @@ pub fn main_loop <T: Exitable> (
|
|||
) -> Result<(), Box<dyn Error>> {
|
||||
let mut stdout = stdout();
|
||||
let sleep = std::time::Duration::from_millis(16);
|
||||
let poll = std::time::Duration::from_millis(100);
|
||||
crossterm::terminal::enable_raw_mode()?;
|
||||
let (tx, input) = channel::<crossterm::event::Event>();
|
||||
let (tx, input) = std::sync::mpsc::channel::<crossterm::event::Event>();
|
||||
let exited = Arc::new(AtomicBool::new(false));
|
||||
let exit_input_thread = exited.clone();
|
||||
spawn(move || {
|
||||
|
|
@ -225,7 +226,7 @@ pub fn main_loop <T: Exitable> (
|
|||
break
|
||||
}
|
||||
// Listen for events and send them to the main thread
|
||||
if crossterm::event::poll(Duration::from_millis(100)).is_ok() {
|
||||
if crossterm::event::poll(poll).is_ok() {
|
||||
if tx.send(crossterm::event::read().unwrap()).is_err() {
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue