mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
make transport focusable
This commit is contained in:
parent
a7a798b484
commit
449615eea8
14 changed files with 220 additions and 237 deletions
|
|
@ -20,17 +20,6 @@ impl App {
|
|||
Ok(&mut self.tracks[self.track_cursor - 1])
|
||||
}
|
||||
|
||||
fn add_track_with_cb (
|
||||
&mut self, name: Option<&str>, init: impl FnOnce(&Client, &mut Track)->Usually<()>,
|
||||
) -> Usually<&mut Track> {
|
||||
let name = name.ok_or_else(||self.new_track_name())?;
|
||||
let mut track = Track::new(&name, None, None)?;
|
||||
init(self.client(), &mut track)?;
|
||||
self.tracks.push(track);
|
||||
self.track_cursor = self.tracks.len();
|
||||
Ok(&mut self.tracks[self.track_cursor - 1])
|
||||
}
|
||||
|
||||
pub fn track (&self) -> Option<(usize, &Track)> {
|
||||
match self.track_cursor { 0 => None, _ => {
|
||||
let id = self.track_cursor as usize - 1;
|
||||
|
|
@ -61,6 +50,7 @@ pub struct Track {
|
|||
pub sequence: Option<usize>,
|
||||
/// Output from current sequence.
|
||||
pub midi_out: Option<Port<MidiOut>>,
|
||||
/// MIDI output buffer
|
||||
midi_out_buf: Vec<Vec<Vec<u8>>>,
|
||||
/// Device chain
|
||||
pub devices: Vec<JackDevice>,
|
||||
|
|
@ -74,6 +64,7 @@ pub struct Track {
|
|||
/// Highlight keys on piano roll.
|
||||
pub notes_out: [bool;128],
|
||||
}
|
||||
|
||||
impl Track {
|
||||
fn new (
|
||||
name: &str,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue