diff --git a/crates/app/edn/groovebox_keys.edn b/crates/app/edn/groovebox_keys.edn index ba69dbb0..174f9b0f 100644 --- a/crates/app/edn/groovebox_keys.edn +++ b/crates/app/edn/groovebox_keys.edn @@ -11,7 +11,4 @@ (@q launch) -(@shift-I input add) -(@shift-O output add) - -(@r record/begin :sample) +(@r record/begin :note-pos) diff --git a/crates/app/src/api.rs b/crates/app/src/api.rs index 6142c754..5d501a8e 100644 --- a/crates/app/src/api.rs +++ b/crates/app/src/api.rs @@ -1,28 +1,15 @@ use crate::*; expose!([self: Tek] { - [bool] => {} - [u16] => { - ":h-ins" => self.h_inputs(), - ":h-outs" => self.h_outputs(), - ":h-sample" => if self.is_editing() { 0 } else { 5 }, - ":w-samples" => if self.is_editing() { 4 } else { 11 }, - ":w-sidebar" => self.w_sidebar(), - ":y-ins" => (self.size.h() as u16).saturating_sub(self.h_inputs() + 1), - ":y-outs" => (self.size.h() as u16).saturating_sub(self.h_outputs() + 1), - ":y-samples" => if self.is_editing() { 1 } else { 0 }, - } - [usize] => { - ":scene-last" => self.scenes.len(), - ":track-last" => self.tracks.len(), - } + [bool] => {} [isize] => {} - [Option] => { - ":scene" => self.selected.scene(), - ":track" => self.selected.track(), - } [Color] => {} [Arc>] => {} + [u16] => { ":w-sidebar" => self.w_sidebar(), } + [usize] => { ":scene-last" => self.scenes.len(), + ":track-last" => self.tracks.len(), } + [Option] => { ":scene" => self.selected.scene(), + ":track" => self.selected.track(), } [Option>>] => { ":clip" => match self.selected { Selection::Clip(t, s) => self.scenes[s].clips[t].clone(), diff --git a/crates/app/src/view.rs b/crates/app/src/view.rs index 1d15e0f8..e3bbc305 100644 --- a/crates/app/src/view.rs +++ b/crates/app/src/view.rs @@ -20,14 +20,12 @@ view!(TuiOut: |self: Tek| { self.editor.as_ref() .map(|e|Bsp::n(Bsp::e(e.clip_status(), e.edit_status()), e)) .boxed(), - ":sample" => - ().boxed(),//self.view_sample(self.is_editing()).boxed(), - ":sampler" => - ().boxed(),//self.view_sampler(self.is_editing(), &self.editor).boxed(), ":samples-keys" => self.tracks[0].sampler(0).map(|s|s.view_list(false, self.editor.as_ref().unwrap())).boxed(), ":samples-grid" => self.tracks[0].sampler(0).map(|s|s.view_grid()).boxed(), + ":sample-viewer" => + self.tracks[0].sampler(0).map(|s|s.view_sample(self.editor.as_ref().unwrap().note_pos())).boxed(), ":status" => self.view_status().boxed(), ":pool" => self.pool.as_ref() diff --git a/crates/cli/edn/arranger.edn b/crates/cli/edn/arranger.edn index 2b423c59..a1074d30 100644 --- a/crates/cli/edn/arranger.edn +++ b/crates/cli/edn/arranger.edn @@ -1,6 +1,6 @@ -(bsp/a :modal - (bsp/s (fixed/y 1 :transport) - (bsp/n (fixed/y 1 :status) +(bsp/a :modal + (bsp/s (fixed/y 1 :transport) + (bsp/n (fixed/y 1 :status) (fill/xy (bsp/a - (fill/xy (align/e :pool)) - :arranger))))) + (fill/xy (align/e :pool)) + :arranger))))) diff --git a/crates/cli/edn/groovebox.edn b/crates/cli/edn/groovebox.edn index 0d3f744f..b358fe2d 100644 --- a/crates/cli/edn/groovebox.edn +++ b/crates/cli/edn/groovebox.edn @@ -1,7 +1,7 @@ -(bsp/a :modal - (bsp/s (fixed/y 1 :transport) - (bsp/s :sample - (bsp/n (fixed/y 1 :status) - (bsp/w (fixed/x :w-sidebar :pool) - (bsp/e :samples-keys - (fill/y :editor))))))) +(bsp/a :modal + (bsp/s (fixed/y 1 :transport) + (bsp/n (fixed/y 1 :status) + (bsp/n (fixed/y 5 :sample-viewer) + (bsp/w (fixed/x :w-sidebar :pool) + (bsp/e :samples-keys + (fill/y :editor))))))) diff --git a/crates/cli/edn/sampler.edn b/crates/cli/edn/sampler.edn index fac8138c..6cad9cdc 100644 --- a/crates/cli/edn/sampler.edn +++ b/crates/cli/edn/sampler.edn @@ -1,4 +1,4 @@ -(bsp/a :modal - (bsp/s (fixed/y 1 :transport) +(bsp/a :modal + (bsp/s (fixed/y 1 :transport) (bsp/n (fixed/y 1 :status) - (fill/xy :samples-grid)))) + (fill/xy :samples-grid)))) diff --git a/crates/cli/edn/sequencer.edn b/crates/cli/edn/sequencer.edn index 8a602581..d1ee923e 100644 --- a/crates/cli/edn/sequencer.edn +++ b/crates/cli/edn/sequencer.edn @@ -1,6 +1,6 @@ -(bsp/a :modal - (bsp/s (fixed/y 1 :transport) - (bsp/n (fixed/y 1 :status) +(bsp/a :modal + (bsp/s (fixed/y 1 :transport) + (bsp/n (fixed/y 1 :status) (fill/xy (bsp/a - (fill/xy (align/e :pool)) - :editor))))) + (fill/xy (align/e :pool)) + :editor))))) diff --git a/crates/sampler/src/sampler_view.rs b/crates/sampler/src/sampler_view.rs index c8da3bd2..117a656b 100644 --- a/crates/sampler/src/sampler_view.rs +++ b/crates/sampler/src/sampler_view.rs @@ -89,14 +89,14 @@ impl Sampler { draw_list_item(&self.mapped[note]) } } - pub fn viewer (&self, note_pt: usize) -> impl Content + use<'_> { - draw_viewer(if let Some((_, sample)) = &self.recording { + pub fn view_sample (&self, note_pt: usize) -> impl Content + use<'_> { + Outer(true, Style::default().fg(Tui::g(96))).enclose(draw_viewer(if let Some((_, sample)) = &self.recording { Some(sample) } else if let Some(sample) = &self.mapped[note_pt] { Some(sample) } else { None - }) + })) } pub fn status (&self, index: usize) -> impl Content { draw_status(self.mapped[index].as_ref())