mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 13:16:44 +01:00
wip: p.53, e=118, fixed focus trait loop
This commit is contained in:
parent
9b996878c2
commit
76af9d9bac
15 changed files with 737 additions and 727 deletions
53
crates/tek_tui/src/tui_control.rs
Normal file
53
crates/tek_tui/src/tui_control.rs
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
use crate::*;
|
||||
|
||||
pub trait TransportControl {
|
||||
fn quant (&self) -> &Quantize;
|
||||
fn bpm (&self) -> &BeatsPerMinute;
|
||||
fn next_quant (&self) -> f64 {
|
||||
next_note_length(self.quant().get() as usize) as f64
|
||||
}
|
||||
fn prev_quant (&self) -> f64 {
|
||||
prev_note_length(self.quant().get() as usize) as f64
|
||||
}
|
||||
fn sync (&self) -> &LaunchSync;
|
||||
fn next_sync (&self) -> f64 {
|
||||
next_note_length(self.sync().get() as usize) as f64
|
||||
}
|
||||
fn prev_sync (&self) -> f64 {
|
||||
prev_note_length(self.sync().get() as usize) as f64
|
||||
}
|
||||
}
|
||||
|
||||
impl TransportControl for TransportTui {
|
||||
fn bpm (&self) -> &BeatsPerMinute {
|
||||
self.bpm()
|
||||
}
|
||||
fn quant (&self) -> &Quantize {
|
||||
self.quant()
|
||||
}
|
||||
fn sync (&self) -> &LaunchSync {
|
||||
self.sync()
|
||||
}
|
||||
}
|
||||
|
||||
impl TransportControl for SequencerTui {
|
||||
fn bpm (&self) -> &BeatsPerMinute {
|
||||
self.bpm()
|
||||
}
|
||||
fn quant (&self) -> &Quantize {
|
||||
self.quant()
|
||||
}
|
||||
fn sync (&self) -> &LaunchSync {
|
||||
self.sync()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait ArrangerControl {
|
||||
fn selected (&self) -> ArrangerSelection;
|
||||
}
|
||||
|
||||
impl ArrangerControl for ArrangerTui {
|
||||
fn selected (&self) -> ArrangerSelection {
|
||||
self.selected
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue