mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
struct Track; load Sampler in Launcher
This commit is contained in:
parent
1038e24ceb
commit
685c49cfd9
6 changed files with 150 additions and 122 deletions
27
src/device/track.rs
Normal file
27
src/device/track.rs
Normal 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()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue