chore: remove dead code

This commit is contained in:
🪞👃🪞 2024-07-12 15:44:19 +03:00
parent 145827913a
commit 0cc8d88e5f
7 changed files with 20 additions and 61 deletions

View file

@ -64,8 +64,6 @@ pub const KEYMAP_FOCUS: &'static [KeyBinding<App>] = keymap!(App {
});
pub const KEYMAP: &'static [KeyBinding<App>] = keymap!(App {
//[F(1), NONE, "help_toggle", "toggle help", |_: &mut App| {Ok(true)}],
[Up, NONE, "focus_prev", "focus previous area", |app: &mut App|match app.track_cursor {
0 => {app.section = AppSection::Arranger;Ok(true)},
_ => focus_prev(app)
@ -74,7 +72,6 @@ pub const KEYMAP: &'static [KeyBinding<App>] = keymap!(App {
0 => {app.section = AppSection::Chain;Ok(true)},
_ => focus_next(app)
}],
[Char(' '), NONE, "play_toggle", "play or pause", |app: &mut App| {
app.transport.toggle_play()?;
Ok(true)
@ -91,7 +88,6 @@ pub const KEYMAP: &'static [KeyBinding<App>] = keymap!(App {
app.track_mut().map(|t|t.1.toggle_monitor());
Ok(true)
}],
[Char('+'), NONE, "quant_inc", "quantize coarser", |app: &mut App| {
app.transport.quant = next_note_length(app.transport.quant);
Ok(true)
@ -100,7 +96,6 @@ pub const KEYMAP: &'static [KeyBinding<App>] = keymap!(App {
app.transport.quant = prev_note_length(app.transport.quant);
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);
Ok(true)
@ -109,7 +104,6 @@ pub const KEYMAP: &'static [KeyBinding<App>] = keymap!(App {
app.seq_buf.time_zoom = next_note_length(app.seq_buf.time_zoom);
Ok(true)
}],
[Char('x'), NONE, "extend", "double the current clip", |app: &mut App| {
if let Some(phrase) = app.phrase_mut() {
let mut notes = phrase.notes.clone();
@ -119,7 +113,6 @@ pub const KEYMAP: &'static [KeyBinding<App>] = keymap!(App {
}
Ok(true)
}],
[Char('l'), NONE, "loop_toggle", "toggle looping", |_app: &mut App| {
// TODO: This toggles the loop flag for the clip under the cursor.
Ok(true)
@ -133,15 +126,13 @@ pub const KEYMAP: &'static [KeyBinding<App>] = keymap!(App {
Ok(true)
}],
[Char('{'), NONE, "loop_end_dec", "move loop end back", |_app: &mut App| {
// TODOO: This moves the loop end to the previous quant.
// TODO: This moves the loop end to the previous quant.
Ok(true)
}],
[Char('}'), NONE, "loop_end_inc", "move loop end forward", |_app: &mut App| {
// TODO: This moves the loop end to the next quant.
Ok(true)
}],
[Char('a'), CONTROL, "scene_add", "add a new scene", |app: &mut App| {
app.add_scene(None)?;
Ok(true)
@ -150,14 +141,6 @@ pub const KEYMAP: &'static [KeyBinding<App>] = keymap!(App {
app.add_track(None)?;
Ok(true)
}],
[Char('.'), NONE, "cursor_inc", "increment value", increment],
[Char(','), NONE, "cursor_dec", "decrement value", decrement],
[Delete, CONTROL, "cursor_delete", "delete item at cursor", delete],
[Char('d'), CONTROL, "cursor_duplicate", "duplicate scene or track", duplicate],
//[Char('r'), CONTROL, "rename", "rename current element", rename],
// [Char('s'), NONE, "stop_and_rewind", "Stop and rewind", stop_and_rewind],
});
fn focus_next (app: &mut App) -> Usually<bool> {
@ -169,31 +152,3 @@ fn focus_prev (app: &mut App) -> Usually<bool> {
app.section.prev();
Ok(true)
}
fn increment (_: &mut App) -> Usually<bool> {
Ok(false)
}
fn decrement (_: &mut App) -> Usually<bool> {
Ok(false)
}
fn delete (app: &mut App) -> Usually<bool> {
match app.section {
AppSection::Arranger => delete_track(app),
_ => Ok(false)
}
}
fn delete_track (app: &mut App) -> Usually<bool> {
if app.tracks.len() > 0 {
let track = app.tracks.remove(app.track_cursor);
app.track_cursor = app.track_cursor.saturating_sub(1);
track.midi_out.map(|port|app.client().unregister_port(port)).transpose()?;
return Ok(true)
}
Ok(false)
}
fn duplicate (_: &mut App) -> Usually<bool> { Ok(true) }