mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
make TimeUnit a trait
This commit is contained in:
parent
a31d6389be
commit
4df15d6bac
7 changed files with 238 additions and 220 deletions
|
|
@ -24,7 +24,7 @@ impl TransportToolbar<Tui> {
|
|||
Ok(Some(true))
|
||||
}
|
||||
fn handle_bpm (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
let bpm = self.clock.timebase().bpm().get();
|
||||
let bpm = self.clock.timebase().bpm.get();
|
||||
match from.event() {
|
||||
key!(KeyCode::Char(',')) => { self.clock.timebase().bpm.set(bpm - 1.0); },
|
||||
key!(KeyCode::Char('.')) => { self.clock.timebase().bpm.set(bpm + 1.0); },
|
||||
|
|
@ -35,7 +35,7 @@ impl TransportToolbar<Tui> {
|
|||
Ok(Some(true))
|
||||
}
|
||||
fn handle_quant (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
let quant = self.clock.quant().get() as usize;
|
||||
let quant = self.clock.quant.get() as usize;
|
||||
match from.event() {
|
||||
key!(KeyCode::Char(',')) => { self.clock.quant.set(prev_note_length(quant) as f64); },
|
||||
key!(KeyCode::Char('.')) => { self.clock.quant.set(next_note_length(quant) as f64); },
|
||||
|
|
@ -44,7 +44,7 @@ impl TransportToolbar<Tui> {
|
|||
return Ok(Some(true))
|
||||
}
|
||||
fn handle_sync (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
let sync = self.clock.sync().get() as usize;
|
||||
let sync = self.clock.sync.get() as usize;
|
||||
match from.event() {
|
||||
key!(KeyCode::Char(',')) => { self.clock.quant.set(prev_note_length(sync) as f64); },
|
||||
key!(KeyCode::Char('.')) => { self.clock.quant.set(next_note_length(sync) as f64); },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue