struct Track; load Sampler in Launcher

This commit is contained in:
🪞👃🪞 2024-06-28 00:09:53 +03:00
parent 1038e24ceb
commit 685c49cfd9
6 changed files with 150 additions and 122 deletions

27
src/device/track.rs Normal file
View file

@ -0,0 +1,27 @@
use crate::prelude::*;
pub struct Track {
pub name: String,
pub sequencer: DynamicDevice<Sequencer>,
pub chain: DynamicDevice<Chain>,
}
impl Track {
pub fn new (
name: &str,
tempo: &Arc<Timebase>,
devices: Vec<Box<dyn Device>>
) -> Usually<Self> {
Ok(Self {
name: name.to_string(),
sequencer: Sequencer::new(&name, tempo, None)?,
chain: Chain::new(&name, devices)?,
})
}
}
impl PortList for Track {
fn midi_ins (&self) -> Usually<Vec<String>> {
self.sequencer.midi_ins()
}
fn audio_outs (&self) -> Usually<Vec<String>> {
self.chain.audio_outs()
}
}