pool: remove InputMap

This commit is contained in:
🪞👃🪞 2025-05-02 17:44:45 +03:00
parent 457e6bb7eb
commit 0533ea92ac
3 changed files with 36 additions and 24 deletions

View file

@ -195,21 +195,6 @@ fn delegate_to_pool (app: &mut Tek, cmd: PoolCommand) -> Perhaps<TekCommand> {
})
}
handle!(TuiIn: |self: MidiPool, input|{
//Ok(if let Some(command) = match self.mode() {
//Some(PoolMode::Rename(..)) => self.keys_rename,
//Some(PoolMode::Length(..)) => self.keys_length,
//Some(PoolMode::Import(..)) | Some(PoolMode::Export(..)) => self.keys_file,
//_ => self.keys
//}.command::<Self, PoolCommand, TuiIn>(self, input) {
Ok(if let Some(command) = self.keys.command(self, input) {
let _undo = command.execute(self)?;
Some(true)
} else {
None
})
});
provide!(bool: |self: MidiPool| {});
provide!(MidiClip: |self: MidiPool| {

View file

@ -799,8 +799,6 @@ pub struct MidiPool {
pub clip: AtomicUsize,
/// Mode switch
pub mode: Option<PoolMode>,
pub keys: InputMap<'static, Self, PoolCommand, TuiIn, SourceIter<'static>>,
}
impl Default for MidiPool {
@ -811,13 +809,6 @@ impl Default for MidiPool {
clips: Arc::from(RwLock::from(vec![])),
clip: 0.into(),
mode: None,
keys: InputMap::new(SourceIter(include_str!("../../../config/keys_pool.edn")))
.layer_if(|pool: &Self|matches!(pool.mode, Some(Import(..))|Some(Export(..))),
SourceIter(include_str!("../../../config/keys_pool_file.edn")))
.layer_if(|pool: &Self|matches!(pool.mode, Some(Rename(..))),
SourceIter(include_str!("../../../config/keys_clip_rename.edn")))
.layer_if(|pool: &Self|matches!(pool.mode, Some(Length(..))),
SourceIter(include_str!("../../../config/keys_clip_length.edn")))
}
}
}