mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
duplicate loop
This commit is contained in:
parent
768c2337e7
commit
2e26fc2eaa
5 changed files with 141 additions and 29 deletions
|
|
@ -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| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue