mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-02-22 00:39:03 +01:00
use iterator in sampler
This commit is contained in:
parent
81717f17b8
commit
c5369328f4
9 changed files with 175 additions and 120 deletions
|
|
@ -1,5 +1,8 @@
|
|||
use super::*;
|
||||
|
||||
pub type DynamicNotifications =
|
||||
Notifications<Box<dyn Fn(AppEvent) + Send + Sync>>;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum JackEvent {
|
||||
ThreadInit,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue