big flat; add midi/audio port handling

This commit is contained in:
facile pop culture reference 2026-07-26 21:49:32 +03:00
parent 66ac2bcbb6
commit c0d6d0174e
16 changed files with 1086 additions and 315 deletions

View file

@ -1,5 +1,5 @@
use crate::*;
use std::sync::{Arc, atomic::AtomicBool};
use crate::Usually;
#[derive(Clone)] pub struct Exit(Arc<AtomicBool>);
@ -7,6 +7,14 @@ impl Exit {
pub fn run <T> (run: impl FnOnce(Self)->Usually<T>) -> Usually<T> {
run(Self(Arc::new(AtomicBool::new(false))))
}
pub fn is (event: &Event) -> bool {
matches!(event, Event::Key(KeyEvent {
modifiers: KeyModifiers::CONTROL,
code: KeyCode::Char('c'),
kind: KeyEventKind::Press,
state: KeyEventState::NONE
}))
}
}
impl AsRef<Arc<AtomicBool>> for Exit {