mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-09-18 12:56:42 +02:00
rework command/namespace dispatch
This commit is contained in:
parent
def7a1b210
commit
406aabde6e
15 changed files with 586 additions and 374 deletions
|
|
@ -21,7 +21,7 @@ impl<T: AsRef<Sampler> + AsMut<Sampler>> HasSampler for T {}
|
|||
|
||||
#[tek_proc::commands(SamplerCommand = "sampler")]
|
||||
pub trait SamplerController: HasSampler
|
||||
+ for<'a> Namespace<'a, usize>
|
||||
+ Namespace<usize>
|
||||
{
|
||||
|
||||
#[command(RecordToggle = "rec-toggle")]
|
||||
|
|
@ -30,10 +30,10 @@ pub trait SamplerController: HasSampler
|
|||
{
|
||||
let sampler = self.sampler_mut();
|
||||
let recording = sampler.recording.as_ref().map(|x|x.0);
|
||||
let _ = SamplerCommand::RecordFinish.act(self)?;
|
||||
let _ = SamplerCommand::RecordFinish.dispatch(self)?;
|
||||
// autoslice: continue recording at next slot
|
||||
if recording != Some(slot) {
|
||||
SamplerCommand::RecordBegin { slot }.act(self)
|
||||
SamplerCommand::RecordBegin { slot }.dispatch(self)
|
||||
} else {
|
||||
Ok(None)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue