mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
per-track reset
This commit is contained in:
parent
2989c79fd0
commit
63b5eb3740
4 changed files with 17 additions and 6 deletions
|
|
@ -22,6 +22,9 @@ pub struct Track {
|
|||
pub devices: Vec<JackDevice>,
|
||||
/// Device selector
|
||||
pub device: usize,
|
||||
/// Send all notes off
|
||||
/// FIXME: Some(nframes)?
|
||||
pub reset: bool
|
||||
}
|
||||
ports!(Track {
|
||||
audio: {
|
||||
|
|
@ -51,6 +54,7 @@ impl Track {
|
|||
phrases: phrases.unwrap_or_else(||Vec::with_capacity(16)),
|
||||
devices: devices.unwrap_or_else(||Vec::with_capacity(16)),
|
||||
device: 0,
|
||||
reset: true,
|
||||
})
|
||||
}
|
||||
pub fn device (&self) -> Option<RwLockReadGuard<Box<dyn Device>>> {
|
||||
|
|
@ -117,7 +121,7 @@ impl Track {
|
|||
playing: Option<TransportState>,
|
||||
started: Option<usize>,
|
||||
quant: usize,
|
||||
panic: bool,
|
||||
reset: bool,
|
||||
scope: &ProcessScope,
|
||||
(frame0, frames): (usize, usize),
|
||||
(usec0, usecs): (usize, usize),
|
||||
|
|
@ -131,7 +135,11 @@ impl Track {
|
|||
frame.clear();
|
||||
}
|
||||
// Emit "all notes off" at start of buffer if requested
|
||||
if panic {
|
||||
if self.reset {
|
||||
all_notes_off(&mut self.midi_out_buf);
|
||||
self.reset = false;
|
||||
}
|
||||
else if reset {
|
||||
all_notes_off(&mut self.midi_out_buf);
|
||||
}
|
||||
// Play from phrase into output buffer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue