remove old input macros

This commit is contained in:
🪞👃🪞 2025-01-14 20:17:17 +01:00
parent 6fd87ce4ed
commit ca1fb3c414
11 changed files with 218 additions and 247 deletions

View file

@ -1,6 +1,6 @@
use crate::*;
handle!(TuiIn: |self: SamplerTui, input|SamplerTuiCommand::execute_with_state(self, input.event()));
//handle!(TuiIn: |self: SamplerTui, input|SamplerTuiCommand::execute_with_state(self, input.event()));
#[derive(Clone, Debug)] pub enum SamplerTuiCommand {
Import(FileBrowserCommand),
@ -37,18 +37,18 @@ command!(|self:FileBrowserCommand,state:SamplerTui|match self {
_ => todo!()
});
input_to_command!(SamplerTuiCommand: |state: SamplerTui, input: Event|match state.mode{
Some(SamplerMode::Import(..)) => Self::Import(
FileBrowserCommand::input_to_command(state, input)?
),
_ => match input {
// load sample
kpat!(Shift-Char('L')) => Self::Import(FileBrowserCommand::Begin),
kpat!(KeyCode::Up) => Self::Select(state.note_point().overflowing_add(1).0.min(127)),
kpat!(KeyCode::Down) => Self::Select(state.note_point().overflowing_sub(1).0.min(127)),
_ => return None
}
});
//input_to_command!(SamplerTuiCommand: |state: SamplerTui, input: Event|match state.mode{
//Some(SamplerMode::Import(..)) => Self::Import(
//FileBrowserCommand::input_to_command(state, input)?
//),
//_ => match input {
//// load sample
//kpat!(Shift-Char('L')) => Self::Import(FileBrowserCommand::Begin),
//kpat!(KeyCode::Up) => Self::Select(state.note_point().overflowing_add(1).0.min(127)),
//kpat!(KeyCode::Down) => Self::Select(state.note_point().overflowing_sub(1).0.min(127)),
//_ => return None
//}
//});
command!(|self: SamplerTuiCommand, state: SamplerTui|match self {
Self::Import(FileBrowserCommand::Begin) => {