mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
wip: refactor pt.21: api traits
This commit is contained in:
parent
b8708d6b2d
commit
029614631e
10 changed files with 626 additions and 490 deletions
|
|
@ -1,18 +1,8 @@
|
|||
use crate::*;
|
||||
|
||||
pub struct ArrangerAudio(pub Arc<RwLock<ArrangerModel>>);
|
||||
|
||||
impl Audio for ArrangerAudio {
|
||||
impl<T: ArrangerModelApi + Send + Sync> Audio for T {
|
||||
#[inline] fn process (&mut self, client: &Client, scope: &ProcessScope) -> Control {
|
||||
ArrangerRefAudio(&mut*self.0.write().unwrap()).process(client, scope)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct ArrangerRefAudio<'a>(pub &'a mut ArrangerModel);
|
||||
|
||||
impl<'a> Audio for ArrangerRefAudio<'a> {
|
||||
#[inline] fn process (&mut self, client: &Client, scope: &ProcessScope) -> Control {
|
||||
for track in self.0.tracks.iter_mut() {
|
||||
for track in self.tracks_mut().iter_mut() {
|
||||
if MIDIPlayerAudio::from(&mut track.player).process(client, scope) == Control::Quit {
|
||||
return Control::Quit
|
||||
}
|
||||
|
|
@ -20,3 +10,24 @@ impl<'a> Audio for ArrangerRefAudio<'a> {
|
|||
Control::Continue
|
||||
}
|
||||
}
|
||||
|
||||
//pub struct ArrangerAudio(pub Arc<RwLock<ArrangerModel>>);
|
||||
|
||||
//impl Audio for ArrangerAudio {
|
||||
//#[inline] fn process (&mut self, client: &Client, scope: &ProcessScope) -> Control {
|
||||
//ArrangerRefAudio(&mut*self.0.write().unwrap()).process(client, scope)
|
||||
//}
|
||||
//}
|
||||
|
||||
//pub struct ArrangerRefAudio<'a>(pub &'a mut ArrangerModel);
|
||||
|
||||
//impl<'a> Audio for ArrangerRefAudio<'a> {
|
||||
//#[inline] fn process (&mut self, client: &Client, scope: &ProcessScope) -> Control {
|
||||
//for track in self.0.tracks.iter_mut() {
|
||||
//if MIDIPlayerAudio::from(&mut track.player).process(client, scope) == Control::Quit {
|
||||
//return Control::Quit
|
||||
//}
|
||||
//}
|
||||
//Control::Continue
|
||||
//}
|
||||
//}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue