wip: sample selector

This commit is contained in:
🪞👃🪞 2024-07-20 19:47:42 +03:00
parent 4603bbd0da
commit f303a8d552
13 changed files with 278 additions and 125 deletions

View file

@ -8,6 +8,9 @@ pub(crate) use std::time::Duration;
pub(crate) use std::collections::BTreeMap;
pub(crate) use std::sync::atomic::{Ordering, AtomicBool};
pub(crate) use std::sync::{Arc, Mutex, RwLock, LockResult, RwLockReadGuard, RwLockWriteGuard};
pub(crate) use std::path::PathBuf;
pub(crate) use std::fs::read_dir;
pub(crate) use std::ffi::OsString;
// Non-stdlib dependencies:
pub(crate) use microxdg::XdgApp;
@ -51,6 +54,19 @@ pub trait Exit: Component {
}
}
#[macro_export] macro_rules! exit {
($T:ty) => {
impl Exit for $T {
fn exited (&self) -> bool {
self.exited
}
fn exit (&mut self) {
self.exited = true
}
}
}
}
/// Anything that implements `Render` + `Handle` can be used as a UI component.
impl<T: Render + Handle + Sync> Component for T {}
@ -66,7 +82,9 @@ pub trait Device: Render + Handle + Process + Send + Sync {
impl<T: Render + Handle + Process + Send + Sync> Device for T {}
// Reexport macros:
pub use crate::{submod, pubmod, render, handle, process, phrase, keymap, ports};
pub use crate::{
submod, pubmod, render, handle, process, phrase, keymap, ports, exit
};
// Reexport JACK proto-lib:
pub use crate::jack::*;