mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 13:16:44 +01:00
simplify time traits
This commit is contained in:
parent
ad2f75bee6
commit
66f9afe500
7 changed files with 151 additions and 165 deletions
|
|
@ -24,11 +24,12 @@ impl TransportToolbar<Tui> {
|
|||
Ok(Some(true))
|
||||
}
|
||||
fn handle_bpm (&mut self, from: &TuiInput) -> Perhaps<bool> {
|
||||
let bpm = self.clock.timebase.bpm();
|
||||
match from.event() {
|
||||
key!(KeyCode::Char(',')) => { self.clock.set_bpm(self.clock.bpm() - 1.0); },
|
||||
key!(KeyCode::Char('.')) => { self.clock.set_bpm(self.clock.bpm() + 1.0); },
|
||||
key!(KeyCode::Char('<')) => { self.clock.set_bpm(self.clock.bpm() - 0.001); },
|
||||
key!(KeyCode::Char('>')) => { self.clock.set_bpm(self.clock.bpm() + 0.001); },
|
||||
key!(KeyCode::Char(',')) => { self.clock.timebase.set_bpm(bpm - 1.0); },
|
||||
key!(KeyCode::Char('.')) => { self.clock.timebase.set_bpm(bpm + 1.0); },
|
||||
key!(KeyCode::Char('<')) => { self.clock.timebase.set_bpm(bpm - 0.001); },
|
||||
key!(KeyCode::Char('>')) => { self.clock.timebase.set_bpm(bpm + 0.001); },
|
||||
_ => return Ok(None)
|
||||
}
|
||||
Ok(Some(true))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue