mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
wip: refactor pt.20: 44 errors
This commit is contained in:
parent
914c2d6c09
commit
2188bccd63
25 changed files with 664 additions and 486 deletions
|
|
@ -1,18 +1,18 @@
|
|||
use crate::*;
|
||||
|
||||
pub struct ArrangementAudio {
|
||||
model: Arc<RwLock<Arrangement>>
|
||||
}
|
||||
pub struct ArrangerAudio(pub Arc<RwLock<Arrangement>>);
|
||||
|
||||
impl From<&Arc<RwLock<Arrangement>>> for ArrangementAudio {
|
||||
fn from (model: &Arc<RwLock<Arrangement>>) -> Self {
|
||||
Self { model: model.clone() }
|
||||
impl Audio for ArrangerAudio {
|
||||
#[inline] fn process (&mut self, client: &Client, scope: &ProcessScope) -> Control {
|
||||
ArrangerRefAudio(&mut*self.0.write().unwrap()).process(client, scope)
|
||||
}
|
||||
}
|
||||
|
||||
impl Audio for ArrangementAudio {
|
||||
pub struct ArrangerRefAudio<'a>(pub &'a mut Arrangement);
|
||||
|
||||
impl<'a> Audio for ArrangerRefAudio<'a> {
|
||||
#[inline] fn process (&mut self, client: &Client, scope: &ProcessScope) -> Control {
|
||||
for track in self.model.write().unwrap().tracks.iter_mut() {
|
||||
for track in self.0.tracks.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