mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 04:36:45 +01:00
wip: refactor pt.12, separate tek_snd
This commit is contained in:
parent
47c9cd2fe8
commit
2be7aee002
28 changed files with 955 additions and 766 deletions
22
crates/tek_snd/src/snd_arrange.rs
Normal file
22
crates/tek_snd/src/snd_arrange.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
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 track.player.process(client, scope) == Control::Quit {
|
||||
return Control::Quit
|
||||
}
|
||||
}
|
||||
Control::Continue
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue