mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
sampler: arrows select slot
This commit is contained in:
parent
b376d75396
commit
2877545140
3 changed files with 38 additions and 21 deletions
|
|
@ -22,10 +22,11 @@ impl Sampler {
|
|||
pub fn view_grid_cell <'a> (
|
||||
&'a self, name: &'a str, x: u16, y: u16, w: u16, h: u16
|
||||
) -> impl Content<TuiOut> + use<'a> {
|
||||
let cursor = self.cursor();
|
||||
let hi_fg = Color::Rgb(64, 64, 64);
|
||||
let hi_bg = if y == 0 { Color::Reset } else { Color::Rgb(64, 64, 64) /*prev*/ };
|
||||
let tx_fg = Color::Rgb(255, 255, 255);
|
||||
let tx_bg = if x as usize == self.cursor.0 && y as usize == self.cursor.1 {
|
||||
let tx_bg = if x as usize == cursor.0 && y as usize == cursor.1 {
|
||||
Color::Rgb(96, 96, 96)
|
||||
} else {
|
||||
Color::Rgb(64, 64, 64)
|
||||
|
|
@ -85,18 +86,6 @@ render!(TuiOut: |self: SamplesTui, to| {
|
|||
}
|
||||
});
|
||||
|
||||
impl NoteRange for Sampler {
|
||||
fn note_lo (&self) -> &AtomicUsize { &self.note_lo }
|
||||
fn note_axis (&self) -> &AtomicUsize { &self.size.y }
|
||||
}
|
||||
|
||||
impl NotePoint for Sampler {
|
||||
fn note_len (&self) -> usize {0/*TODO*/}
|
||||
fn set_note_len (&self, x: usize) {}
|
||||
fn note_pos (&self) -> usize { self.note_pt.load(Relaxed) }
|
||||
fn set_note_pos (&self, x: usize) { self.note_pt.store(x, Relaxed); }
|
||||
}
|
||||
|
||||
impl Sampler {
|
||||
const _EMPTY: &[(f64, f64)] = &[(0., 0.), (1., 1.), (2., 2.), (0., 2.), (2., 0.)];
|
||||
pub fn list <'a> (&'a self, compact: bool, editor: &MidiEditor) -> impl Content<TuiOut> + 'a {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue