mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
wip: refactor pt.22: api traits in snd
This commit is contained in:
parent
029614631e
commit
e7e57cea1e
8 changed files with 100 additions and 67 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue