duplicate loop

This commit is contained in:
🪞👃🪞 2024-07-05 11:07:50 +03:00
parent 768c2337e7
commit 2e26fc2eaa
5 changed files with 141 additions and 29 deletions

View file

@ -19,7 +19,14 @@ handle!(App |self, e| {
const KEYMAP: &'static [KeyBinding<App>] = keymap!(App {
[Char('x'), NONE, "extend", "double the current clip", |app: &mut App| {
// TODO: This duplicates the current clip's contents and doubles the length.
if let Some(phrase) = app.phrase_mut() {
let mut notes = BTreeMap::new();
for (time, events) in phrase.notes.iter() {
notes.insert(time + phrase.length, events.clone());
}
phrase.notes.append(&mut notes);
phrase.length = phrase.length * 2;
}
Ok(true)
}],
[Char('l'), NONE, "toggle_loop", "toggle looping", |app: &mut App| {