change Device from trait to enum

This commit is contained in:
🪞👃🪞 2025-04-24 22:30:43 +03:00
parent 866d88c8ec
commit 1cc3a58826
8 changed files with 150 additions and 92 deletions

View file

@ -6,20 +6,6 @@ provide!(f32: |self: Sampler| {});
provide!(u7: |self: Sampler| {});
provide!(usize: |self: Sampler| {});
//handle!(TuiIn: |self: Sampler, input|SamplerCommand::execute_with_state(self, input.event()));
//input_to_command!(SamplerCommand: |state: Sampler, 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_pos().overflowing_add(1).0.min(127)),
//kpat!(KeyCode::Down) => Self::Select(state.note_pos().overflowing_sub(1).0.min(127)),
//_ => return None
//}
//});
defcom! { |self, state: Sampler|
SamplerCommand {

View file

@ -1,5 +1,11 @@
use crate::*;
impl Sampler {
pub fn view_grid (&self) -> impl Content<TuiOut> {
"sampler grid view"
}
}
content!(TuiOut: |self: Sampler| {
let keys_width = 5;
let keys = move||"";//SamplerKeys(self);