enable adding midi ins and outs

This commit is contained in:
🪞👃🪞 2025-01-25 00:53:39 +01:00
parent 76cefdca61
commit 5d6592bbdf
12 changed files with 171 additions and 165 deletions

View file

@ -16,3 +16,13 @@ pub trait Command<S>: Send + Sync + Sized {
Ok(self.execute(state)?.map(wrap))
}
}
impl<S, T: Command<S>> Command<S> for Option<T> {
fn execute (self, _: &mut S) -> Perhaps<Self> {
Ok(None)
}
fn delegate <U> (self, _: &mut S, _: impl Fn(Self)->U) -> Perhaps<U>
where Self: Sized
{
Ok(None)
}
}

View file

@ -100,7 +100,7 @@ impl<'a, C, T: TryFromAtom<'a, C> + Command<C>> AtomCommand<'a, C> for T {}
$(let $arg: Option<$type> = Context::<$type>::get($state, &$arg.value);)?
)*
$(let $rest = iter.clone();)?
return Some($command)
return $command
},)*
_ => None
}
@ -142,7 +142,7 @@ impl<'a, C, T: TryFromAtom<'a, C> + Command<C>> AtomCommand<'a, C> for T {}
$(let $arg: Option<$type> = Context::<$type>::get($state, &$arg.value);)?
)*
$(let $rest = iter.clone();)?
return Some($command)
return $command
}),*
_ => None
}