mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
22 lines
633 B
Rust
22 lines
633 B
Rust
use crate::*;
|
|
|
|
pub struct ArrangementAudio {
|
|
model: Arc<RwLock<Arrangement>>
|
|
}
|
|
|
|
impl From<&Arc<RwLock<Arrangement>>> for ArrangementAudio {
|
|
fn from (model: &Arc<RwLock<Arrangement>>) -> Self {
|
|
Self { model: model.clone() }
|
|
}
|
|
}
|
|
|
|
impl Audio for ArrangementAudio {
|
|
#[inline] fn process (&mut self, client: &Client, scope: &ProcessScope) -> Control {
|
|
for track in self.model.write().unwrap().tracks.iter_mut() {
|
|
if MIDIPlayerAudio::from(&mut track.player).process(client, scope) == Control::Quit {
|
|
return Control::Quit
|
|
}
|
|
}
|
|
Control::Continue
|
|
}
|
|
}
|