mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-02-21 16:29:04 +01:00
51 lines
1.5 KiB
Rust
51 lines
1.5 KiB
Rust
use crate::*;
|
|
|
|
/// Running JACK [AsyncClient] with maximum type erasure.
|
|
///
|
|
/// One [Box] contains function that handles [JackEvent]s.
|
|
///
|
|
/// Another [Box] containing a function that handles realtime IO.
|
|
///
|
|
/// That's all it knows about them.
|
|
pub type DynamicAsyncClient<'j>
|
|
= AsyncClient<DynamicNotifications<'j>, DynamicAudioHandler<'j>>;
|
|
|
|
/// Notification handler wrapper for [BoxedAudioHandler].
|
|
pub type DynamicAudioHandler<'j> =
|
|
ClosureProcessHandler<(), BoxedAudioHandler<'j>>;
|
|
|
|
/// Boxed realtime callback.
|
|
pub type BoxedAudioHandler<'j> =
|
|
Box<dyn FnMut(&Client, &ProcessScope) -> Control + Send + Sync + 'j>;
|
|
|
|
/// Notification handler wrapper for [BoxedJackEventHandler].
|
|
pub type DynamicNotifications<'j> =
|
|
JackNotify<BoxedJackEventHandler<'j>>;
|
|
|
|
/// Boxed [JackEvent] callback.
|
|
pub type BoxedJackEventHandler<'j> =
|
|
Box<dyn Fn(JackEvent) + Send + Sync + 'j>;
|
|
|
|
pub type MidiData =
|
|
Vec<Vec<MidiMessage>>;
|
|
|
|
pub type ClipPool =
|
|
Vec<Arc<RwLock<MidiClip>>>;
|
|
|
|
pub type CollectedMidiInput<'a> =
|
|
Vec<Vec<(u32, Result<LiveEvent<'a>, MidiError>)>>;
|
|
|
|
pub type SceneWith<'a, T> =
|
|
(usize, &'a Scene, usize, usize, T);
|
|
|
|
pub type MidiSample =
|
|
(Option<u7>, Arc<RwLock<crate::Sample>>);
|
|
|
|
/// Collection of interaction modes.
|
|
pub type Modes = Arc<RwLock<BTreeMap<Arc<str>, Arc<Mode<Arc<str>>>>>>;
|
|
|
|
/// Collection of input bindings.
|
|
pub type Binds = Arc<RwLock<BTreeMap<Arc<str>, Bind<TuiEvent, Arc<str>>>>>;
|
|
|
|
/// Collection of view definitions.
|
|
pub type Views = Arc<RwLock<BTreeMap<Arc<str>, Arc<str>>>>;
|