mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 11:46:41 +01:00
reenable sample viewer in groovebox
cleanup unused expose! bindings
This commit is contained in:
parent
f8994d3e2d
commit
e4808f8fc1
8 changed files with 32 additions and 50 deletions
|
|
@ -11,7 +11,4 @@
|
|||
|
||||
(@q launch)
|
||||
|
||||
(@shift-I input add)
|
||||
(@shift-O output add)
|
||||
|
||||
(@r record/begin :sample)
|
||||
(@r record/begin :note-pos)
|
||||
|
|
|
|||
|
|
@ -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<usize>] => {
|
||||
":scene" => self.selected.scene(),
|
||||
":track" => self.selected.track(),
|
||||
}
|
||||
[Color] => {}
|
||||
[Arc<RwLock<MidiClip>>] => {}
|
||||
[u16] => { ":w-sidebar" => self.w_sidebar(), }
|
||||
[usize] => { ":scene-last" => self.scenes.len(),
|
||||
":track-last" => self.tracks.len(), }
|
||||
[Option<usize>] => { ":scene" => self.selected.scene(),
|
||||
":track" => self.selected.track(), }
|
||||
[Option<Arc<RwLock<MidiClip>>>] => {
|
||||
":clip" => match self.selected {
|
||||
Selection::Clip(t, s) => self.scenes[s].clips[t].clone(),
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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)))))
|
||||
|
|
|
|||
|
|
@ -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)))))))
|
||||
|
|
|
|||
|
|
@ -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))))
|
||||
|
|
|
|||
|
|
@ -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)))))
|
||||
|
|
|
|||
|
|
@ -89,14 +89,14 @@ impl Sampler {
|
|||
draw_list_item(&self.mapped[note])
|
||||
}
|
||||
}
|
||||
pub fn viewer (&self, note_pt: usize) -> impl Content<TuiOut> + use<'_> {
|
||||
draw_viewer(if let Some((_, sample)) = &self.recording {
|
||||
pub fn view_sample (&self, note_pt: usize) -> impl Content<TuiOut> + 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<TuiOut> {
|
||||
draw_status(self.mapped[index].as_ref())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue