wip: refactor pt.22: api traits in snd

This commit is contained in:
🪞👃🪞 2024-11-13 19:49:52 +01:00
parent 029614631e
commit e7e57cea1e
8 changed files with 100 additions and 67 deletions

View file

@ -1,8 +1,16 @@
use crate::*;
impl<T: ArrangerModelApi + Send + Sync> Audio for T {
impl Audio for ArrangerModel {
fn process (&mut self, client: &Client, scope: &ProcessScope) -> Control {
ArrangerRefAudio(self).process(client, scope)
}
}
pub struct ArrangerRefAudio<'a, T: ArrangerModelApi + Send + Sync>(&'a mut T);
impl<'a, T: ArrangerModelApi + Send + Sync> Audio for ArrangerRefAudio<'a, T> {
#[inline] fn process (&mut self, client: &Client, scope: &ProcessScope) -> Control {
for track in self.tracks_mut().iter_mut() {
for track in self.0.tracks_mut().iter_mut() {
if MIDIPlayerAudio::from(&mut track.player).process(client, scope) == Control::Quit {
return Control::Quit
}