mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
store updated phrase length; enter/exit phrase editor
This commit is contained in:
parent
ff342963a1
commit
d29dd56198
3 changed files with 42 additions and 34 deletions
|
|
@ -44,12 +44,14 @@ impl Handle<Tui> for PhrasePool<Tui> {
|
|||
}
|
||||
},
|
||||
Some(PhrasePoolMode::Length(phrase, ref mut length, ref mut focus)) => {
|
||||
let mut phrase = self.phrases[phrase].write().unwrap();
|
||||
match from.event() {
|
||||
key!(KeyCode::Left) => { focus.prev() },
|
||||
key!(KeyCode::Right) => { focus.next() },
|
||||
key!(KeyCode::Esc) => { self.mode = None; },
|
||||
key!(KeyCode::Enter) => { self.mode = None; },
|
||||
key!(KeyCode::Enter) => {
|
||||
self.phrases[phrase].write().unwrap().length = *length;
|
||||
self.mode = None;
|
||||
},
|
||||
key!(KeyCode::Up) => match focus {
|
||||
PhraseLengthFocus::Bar => {
|
||||
*length += 4 * PPQ
|
||||
|
|
@ -99,6 +101,8 @@ 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::Up) => match self.entered {
|
||||
true => { self.note_axis.point_dec(); },
|
||||
false => { self.note_axis.start_dec(); },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue