wip: trait EdnCommand

This commit is contained in:
🪞👃🪞 2025-01-12 01:07:01 +01:00
parent 8850fbf2f8
commit aad7aa6c5e
7 changed files with 193 additions and 165 deletions

View file

@ -101,6 +101,30 @@ audio!(|self: App, client, scope|{
Control::Continue
});
/// Hosts the JACK callback for a collection of tracks
pub struct TracksAudio<'a>(
// Track collection
pub &'a mut [ArrangerTrack],
/// Note buffer
pub &'a mut Vec<u8>,
/// Note chunk buffer
pub &'a mut Vec<Vec<Vec<u8>>>,
);
impl Audio for TracksAudio<'_> {
#[inline] fn process (&mut self, client: &Client, scope: &ProcessScope) -> Control {
let model = &mut self.0;
let note_buffer = &mut self.1;
let output_buffer = &mut self.2;
for track in model.iter_mut() {
if PlayerAudio(track.player_mut(), note_buffer, output_buffer).process(client, scope) == Control::Quit {
return Control::Quit
}
}
Control::Continue
}
}
//audio!(|self: Sequencer, client, scope|{
//// Start profiling cycle
//let t0 = self.perf.get_t0();
@ -206,27 +230,3 @@ audio!(|self: App, client, scope|{
//self.perf.update(t0, scope);
//return Control::Continue
//});
/// Hosts the JACK callback for a collection of tracks
pub struct TracksAudio<'a>(
// Track collection
pub &'a mut [ArrangerTrack],
/// Note buffer
pub &'a mut Vec<u8>,
/// Note chunk buffer
pub &'a mut Vec<Vec<Vec<u8>>>,
);
impl Audio for TracksAudio<'_> {
#[inline] fn process (&mut self, client: &Client, scope: &ProcessScope) -> Control {
let model = &mut self.0;
let note_buffer = &mut self.1;
let output_buffer = &mut self.2;
for track in model.iter_mut() {
if PlayerAudio(track.player_mut(), note_buffer, output_buffer).process(client, scope) == Control::Quit {
return Control::Quit
}
}
Control::Continue
}
}