auto create phrase

This commit is contained in:
🪞👃🪞 2024-10-21 02:34:49 +03:00
parent 059b4c0aa8
commit 7aad6d1678
2 changed files with 7 additions and 3 deletions

View file

@ -143,6 +143,10 @@ impl<E: Engine> Arranger<E> {
} }
/// Focus the editor with the current phrase /// Focus the editor with the current phrase
pub fn edit_phrase (&mut self) { pub fn edit_phrase (&mut self) {
if self.arrangement.phrase().is_none() {
self.phrases.write().unwrap().append_new(None, None);
self.arrangement.phrase_put();
}
self.show_phrase(); self.show_phrase();
self.focus(ArrangerFocus::PhraseEditor); self.focus(ArrangerFocus::PhraseEditor);
} }

View file

@ -138,10 +138,10 @@ impl Content for PhraseEditor<Tui> {
} }
if *focused { if *focused {
if *entered { if *entered {
lower_left = "[Esc] Exit edit mode [A]ppend [S]et".to_string(); //lower_left = "[Esc] Exit edit mode [A]ppend [S]et".to_string();
lower_right = format!("[,.] Note: {} {lower_right}", ppq_to_name(*note_len)); lower_right = format!("[,.] Note: {} [<>] {lower_right}", ppq_to_name(*note_len));
} else { } else {
lower_left = "[Enter] Edit notes".to_string(); //lower_left = "[Enter] Edit notes".to_string();
lower_right = format!("[,.] {lower_right}"); lower_right = format!("[,.] {lower_right}");
} }
} }