mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
more appmode logic
This commit is contained in:
parent
3b5c23f68c
commit
39dc6b803e
8 changed files with 138 additions and 104 deletions
|
|
@ -363,6 +363,38 @@ has_player!(|self: Track|self.player);
|
|||
|
||||
impl Track {
|
||||
pub const MIN_WIDTH: usize = 9;
|
||||
/// Create a new track containing a sequencer.
|
||||
pub fn new_sequencer () -> Self {
|
||||
let mut track = Self::default();
|
||||
track.devices.push(Device::Sequencer(MidiPlayer::default()));
|
||||
track
|
||||
}
|
||||
/// Create a new track containing a sequencer and sampler.
|
||||
pub fn new_groovebox (
|
||||
jack: &Jack,
|
||||
midi_from: &[PortConnect],
|
||||
audio_from: &[&[PortConnect];2],
|
||||
audio_to: &[&[PortConnect];2],
|
||||
) -> Usually<Self> {
|
||||
let mut track = Self::new_sequencer();
|
||||
track.devices.push(Device::Sampler(
|
||||
Sampler::new(jack, &"sampler", midi_from, audio_from, audio_to)?
|
||||
));
|
||||
Ok(track)
|
||||
}
|
||||
/// Create a new track containing a sampler.
|
||||
pub fn new_sampler (
|
||||
jack: &Jack,
|
||||
midi_from: &[PortConnect],
|
||||
audio_from: &[&[PortConnect];2],
|
||||
audio_to: &[&[PortConnect];2],
|
||||
) -> Usually<Self> {
|
||||
let mut track = Self::default();
|
||||
track.devices.push(Device::Sampler(
|
||||
Sampler::new(jack, &"sampler", midi_from, audio_from, audio_to)?
|
||||
));
|
||||
Ok(track)
|
||||
}
|
||||
pub fn width_inc (&mut self) {
|
||||
self.width += 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue