use iterator in sampler

This commit is contained in:
🪞👃🪞 2024-07-06 17:39:16 +03:00
parent 81717f17b8
commit c5369328f4
9 changed files with 175 additions and 120 deletions

View file

@ -1,5 +1,8 @@
use super::*;
pub type DynamicNotifications =
Notifications<Box<dyn Fn(AppEvent) + Send + Sync>>;
#[derive(Debug)]
pub enum JackEvent {
ThreadInit,

View file

@ -1,30 +0,0 @@
use super::*;
/// Trait for things that have a JACK process callback.
pub trait Process {
fn process (&mut self, _: &Client, _: &ProcessScope) -> Control {
Control::Continue
}
}
/// Define the JACK process callback associated with a struct.
#[macro_export] macro_rules! process {
($T:ty) => {
impl Process for $T {}
};
($T:ty |$self:ident, $c:ident, $s:ident|$block:tt) => {
impl Process for $T {
fn process (&mut $self, $c: &Client, $s: &ProcessScope) -> Control {
$block
}
}
};
($T:ty = $process:path) => {
impl Process for $T {
fn process (&mut self, c: &Client, s: &ProcessScope) -> Control {
$process(self, c, s)
}
}
}
}