mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
add PgUp/PgDown in sequencer
This commit is contained in:
parent
359afb2e8c
commit
eccb355815
3 changed files with 17 additions and 10 deletions
|
|
@ -89,7 +89,12 @@ impl Handle<Tui> for PhraseEditor<Tui> {
|
|||
key!(KeyCode::Char('`')) => { self.mode = !self.mode; },
|
||||
key!(KeyCode::Enter) => { self.entered = true; },
|
||||
key!(KeyCode::Esc) => { self.entered = false; },
|
||||
|
||||
key!(KeyCode::PageUp) => {
|
||||
self.note_axis.start = self.note_axis.start.saturating_sub(3);
|
||||
}
|
||||
key!(KeyCode::PageDown) => {
|
||||
self.note_axis.start = self.note_axis.start + 3;
|
||||
}
|
||||
key!(KeyCode::Up) => match self.entered {
|
||||
true => { self.note_axis.point_dec(); },
|
||||
false => { self.note_axis.start_dec(); },
|
||||
|
|
@ -108,15 +113,17 @@ impl Handle<Tui> for PhraseEditor<Tui> {
|
|||
},
|
||||
key!(KeyCode::Char(',')) => match self.entered {
|
||||
true => { self.note_len = prev_note_length(self.note_len) },
|
||||
false => { self.time_axis.scale = prev_note_length(self.time_axis.scale) },
|
||||
false => { self.time_axis.scale = next_note_length(self.time_axis.scale) },
|
||||
},
|
||||
key!(KeyCode::Char('.')) => match self.entered {
|
||||
true => { self.note_len = next_note_length(self.note_len) },
|
||||
false => { self.time_axis.scale = next_note_length(self.time_axis.scale) },
|
||||
false => { self.time_axis.scale = prev_note_length(self.time_axis.scale) },
|
||||
},
|
||||
key!(KeyCode::Char('a')) => if self.entered {
|
||||
self.put();
|
||||
self.time_axis.point = self.time_axis.point.map(|time|time + self.note_len);
|
||||
self.time_axis.point = self.time_axis.point.map(|time|{
|
||||
time + self.note_len / self.time_axis.scale
|
||||
});
|
||||
},
|
||||
key!(KeyCode::Char('s')) => if self.entered {
|
||||
self.put();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue