extract Sequencer model

This commit is contained in:
🪞👃🪞 2024-07-13 17:11:28 +03:00
parent f347ca838b
commit aa478099d9
14 changed files with 211 additions and 348 deletions

View file

@ -78,15 +78,15 @@ pub const KEYMAP_GLOBAL: &'static [KeyBinding<App>] = keymap!(App {
Ok(true)
}],
[Char('='), NONE, "zoom_in", "show fewer ticks per block", |app: &mut App| {
app.seq_buf.time_zoom = prev_note_length(app.seq_buf.time_zoom);
app.sequencer.time_zoom = prev_note_length(app.sequencer.time_zoom);
Ok(true)
}],
[Char('-'), NONE, "zoom_out", "show more ticks per block", |app: &mut App| {
app.seq_buf.time_zoom = next_note_length(app.seq_buf.time_zoom);
app.sequencer.time_zoom = next_note_length(app.sequencer.time_zoom);
Ok(true)
}],
[Char('x'), NONE, "extend", "double the current clip", |app: &mut App| {
app.arranger.phrase_mut().map(|phrase|{
app.arranger.phrase().map(|x|x.write().unwrap()).map(|mut phrase|{
let mut notes = phrase.notes.clone();
notes.extend_from_slice(&mut phrase.notes);
phrase.notes = notes;