add PgUp/PgDown in sequencer

This commit is contained in:
🪞👃🪞 2024-10-18 22:42:30 +03:00
parent 359afb2e8c
commit eccb355815
3 changed files with 17 additions and 10 deletions

View file

@ -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();