This commit is contained in:
2026-01-23 01:18:40 +01:00
parent 1aad52eed1
commit 10e2812e4c
5 changed files with 157 additions and 91 deletions

View File

@@ -373,6 +373,14 @@ fn handle_modal_input(ctx: &mut InputContext, key: KeyEvent) -> InputResult {
}
}
}
Modal::Preview => match key.code {
KeyCode::Esc | KeyCode::Char('p') => ctx.dispatch(AppCommand::CloseModal),
KeyCode::Left => ctx.dispatch(AppCommand::PrevStep),
KeyCode::Right => ctx.dispatch(AppCommand::NextStep),
KeyCode::Up => ctx.dispatch(AppCommand::StepUp),
KeyCode::Down => ctx.dispatch(AppCommand::StepDown),
_ => {}
},
Modal::None => unreachable!(),
}
InputResult::Continue
@@ -465,6 +473,7 @@ fn handle_main_page(ctx: &mut InputContext, key: KeyEvent, ctrl: bool) -> InputR
KeyCode::Char(']') => ctx.dispatch(AppCommand::SpeedIncrease),
KeyCode::Char('L') => ctx.dispatch(AppCommand::OpenPatternModal(PatternField::Length)),
KeyCode::Char('S') => ctx.dispatch(AppCommand::OpenPatternModal(PatternField::Speed)),
KeyCode::Char('p') => ctx.dispatch(AppCommand::OpenModal(Modal::Preview)),
KeyCode::Delete | KeyCode::Backspace => {
let (bank, pattern) = (ctx.app.editor_ctx.bank, ctx.app.editor_ctx.pattern);
let step = ctx.app.editor_ctx.step;
@@ -646,7 +655,7 @@ fn handle_audio_page(ctx: &mut InputContext, key: KeyEvent) -> InputResult {
KeyCode::Char('t') => {
let _ = ctx
.audio_tx
.send(AudioCommand::Evaluate("sin 440 * 0.3".into()));
.send(AudioCommand::Evaluate("/sound/sine/dur/0.5/decay/0.2".into()));
}
KeyCode::Char(' ') => {
ctx.dispatch(AppCommand::TogglePlaying);