mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
wip: edn project format
This commit is contained in:
parent
14d9116c7c
commit
e2a842492e
12 changed files with 401 additions and 65 deletions
|
|
@ -34,13 +34,13 @@ handle!(App |self, e| {
|
|||
});
|
||||
|
||||
const KEYMAP_FOCUS: &'static [KeyBinding<App>] = keymap!(App {
|
||||
[Tab, NONE, "focus_next", "focus next area", focus_next],
|
||||
[Tab, SHIFT, "focus_prev", "focus previous area", focus_prev],
|
||||
[Esc, NONE, "focus_exit", "unfocus", |app: &mut App|{
|
||||
[Tab, NONE, "focus_next", "focus next area", focus_next],
|
||||
[Tab, SHIFT, "focus_prev", "focus previous area", focus_prev],
|
||||
[Esc, NONE, "focus_exit", "unfocus", |app: &mut App|{
|
||||
app.entered = false;
|
||||
Ok(true)
|
||||
}],
|
||||
[Enter, NONE, "focus_enter", "activate item at cursor", |app: &mut App|{
|
||||
[Enter, NONE, "focus_enter", "activate item at cursor", |app: &mut App|{
|
||||
app.entered = true;
|
||||
Ok(true)
|
||||
}],
|
||||
|
|
@ -50,8 +50,8 @@ 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", focus_prev],
|
||||
[Down, NONE, "focus_next", "focus next area", focus_next],
|
||||
[Up, NONE, "focus_prev", "focus previous area", focus_prev],
|
||||
[Down, NONE, "focus_next", "focus next area", focus_next],
|
||||
|
||||
[Char(' '), NONE, "play_toggle", "play or pause", |app: &mut App| {
|
||||
app.toggle_play()?;
|
||||
|
|
@ -175,13 +175,52 @@ const KEYMAP_GRID: &'static [KeyBinding<App>] = keymap!(App {
|
|||
true
|
||||
}
|
||||
)],
|
||||
[Char('.'), NONE, "grid_increment", "increment item at cursor", clip_next],
|
||||
[Char(','), NONE, "grid_decrement", "decrement item at cursor", clip_prev],
|
||||
[Char('.'), NONE, "grid_increment", "set next clip at cursor", |app: &mut App| {
|
||||
Ok(true)
|
||||
}],
|
||||
[Char(','), NONE, "grid_decrement", "set previous clip at cursor", |app: &mut App| {
|
||||
Ok(true)
|
||||
}],
|
||||
[Char('`'), NONE, "grid_mode_switch", "switch the display mode", |app: &mut App| {
|
||||
app.grid_mode = !app.seq_mode;
|
||||
Ok(true)
|
||||
}],
|
||||
});
|
||||
fn clip_next (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
//fn clip_next (state: &mut Launcher) -> Usually<bool> {
|
||||
//if state.cursor.0 >= 1 && state.cursor.1 >= 1 {
|
||||
//let scene_id = state.cursor.1 - 1;
|
||||
//let clip_id = state.cursor.0 - 1;
|
||||
//let scene = &mut state.scenes[scene_id];
|
||||
//scene.clips[clip_id] = match scene.clips[clip_id] {
|
||||
//None => Some(0),
|
||||
//Some(i) => if i >= state.tracks[clip_id].sequencer.phrases.len().saturating_sub(1) {
|
||||
//None
|
||||
//} else {
|
||||
//Some(i + 1)
|
||||
//}
|
||||
//};
|
||||
//}
|
||||
//Ok(true)
|
||||
//}
|
||||
|
||||
fn clip_prev (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
//fn clip_prev (state: &mut Launcher) -> Usually<bool> {
|
||||
//if state.cursor.0 >= 1 && state.cursor.1 >= 1 {
|
||||
//let scene_id = state.cursor.1 - 1;
|
||||
//let clip_id = state.cursor.0 - 1;
|
||||
//let scene = &mut state.scenes[scene_id];
|
||||
//scene.clips[clip_id] = match scene.clips[clip_id] {
|
||||
//None => Some(state.tracks[clip_id].sequencer.phrases.len().saturating_sub(1)),
|
||||
//Some(i) => if i == 0 {
|
||||
//None
|
||||
//} else {
|
||||
//Some(i - 1)
|
||||
//}
|
||||
//};
|
||||
//}
|
||||
//Ok(true)
|
||||
//}
|
||||
|
||||
const KEYMAP_SEQUENCER: &'static [KeyBinding<App>] = keymap!(App {
|
||||
[Up, NONE, "seq_cursor_up", "move cursor up", |app: &mut App| {
|
||||
|
|
@ -257,46 +296,11 @@ fn increment (app: &mut App) -> Usually<bool> {
|
|||
Ok(false)
|
||||
}
|
||||
|
||||
fn clip_next (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
//fn clip_next (state: &mut Launcher) -> Usually<bool> {
|
||||
//if state.cursor.0 >= 1 && state.cursor.1 >= 1 {
|
||||
//let scene_id = state.cursor.1 - 1;
|
||||
//let clip_id = state.cursor.0 - 1;
|
||||
//let scene = &mut state.scenes[scene_id];
|
||||
//scene.clips[clip_id] = match scene.clips[clip_id] {
|
||||
//None => Some(0),
|
||||
//Some(i) => if i >= state.tracks[clip_id].sequencer.phrases.len().saturating_sub(1) {
|
||||
//None
|
||||
//} else {
|
||||
//Some(i + 1)
|
||||
//}
|
||||
//};
|
||||
//}
|
||||
//Ok(true)
|
||||
//}
|
||||
|
||||
fn decrement (app: &mut App) -> Usually<bool> {
|
||||
Ok(false)
|
||||
}
|
||||
|
||||
fn clip_prev (_: &mut App) -> Usually<bool> { Ok(true) }
|
||||
//fn clip_prev (state: &mut Launcher) -> Usually<bool> {
|
||||
//if state.cursor.0 >= 1 && state.cursor.1 >= 1 {
|
||||
//let scene_id = state.cursor.1 - 1;
|
||||
//let clip_id = state.cursor.0 - 1;
|
||||
//let scene = &mut state.scenes[scene_id];
|
||||
//scene.clips[clip_id] = match scene.clips[clip_id] {
|
||||
//None => Some(state.tracks[clip_id].sequencer.phrases.len().saturating_sub(1)),
|
||||
//Some(i) => if i == 0 {
|
||||
//None
|
||||
//} else {
|
||||
//Some(i - 1)
|
||||
//}
|
||||
//};
|
||||
//}
|
||||
//Ok(true)
|
||||
//}
|
||||
|
||||
fn delete (app: &mut App) -> Usually<bool> {
|
||||
match app.section {
|
||||
AppSection::Grid => delete_track(app),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue