sampler: cleanup

This commit is contained in:
🪞👃🪞 2025-04-27 03:28:01 +03:00
parent 3ef3d5eb6f
commit 22155f7acf
2 changed files with 2 additions and 46 deletions

View file

@ -103,47 +103,3 @@
//gain: 1.0 //gain: 1.0
//})))) //}))))
//}); //});
//content!(TuiOut: |self: Sampler| {
//let keys_width = 5;
//let keys = move||"";//SamplerKeys(self);
//let fg = self.color.base.rgb;
//let bg = self.color.darkest.rgb;
//let border = Fill::xy(Outer(true, Style::default().fg(fg).bg(bg)));
//let with_border = |x|lay!(border, Fill::xy(x));
//let with_size = |x|lay!(self.size.clone(), x);
//Tui::bg(bg, Fill::xy(with_border(Bsp::s(
//Tui::fg(self.color.light.rgb, Tui::bold(true, &"Sampler")),
//with_size(Shrink::y(1, Bsp::e(
//Fixed::x(keys_width, keys()),
//Fill::xy(SamplesTui {
//color: self.color,
//note_hi: self.note_hi(),
//note_pt: self.note_pos(),
//height: self.size.h(),
//}),
//))),
//))))
//});
//struct SamplesTui {
//color: ItemTheme,
//note_hi: usize,
//note_pt: usize,
//height: usize,
//}
//render!(TuiOut: |self: SamplesTui, to| {
//let x = to.area.x();
//let bg_base = self.color.darkest.rgb;
//let bg_selected = self.color.darker.rgb;
//let style_empty = Style::default().fg(self.color.base.rgb);
//let style_full = Style::default().fg(self.color.lighter.rgb);
//for y in 0..self.height {
//let note = self.note_hi - y as usize;
//let bg = if note == self.note_pt { bg_selected } else { bg_base };
//let style = Some(style_empty.bg(bg));
//to.blit(&" (no sample) ", x, to.area.y() + y as u16, style);
//}
//});

View file

@ -61,7 +61,7 @@ impl Sampler {
let note_lo = editor.note_lo().load(Relaxed); let note_lo = editor.note_lo().load(Relaxed);
let note_pt = editor.note_pos(); let note_pt = editor.note_pos();
let note_hi = editor.note_hi(); let note_hi = editor.note_hi();
Fixed::x(16, Map::south( Fixed::x(12, Map::south(
1, 1,
move||(note_lo..=note_hi).rev(), move||(note_lo..=note_hi).rev(),
move|note, i| { move|note, i| {
@ -114,7 +114,7 @@ fn draw_list_item (sample: &Option<Arc<RwLock<Sample>>>) -> String {
sample.channels[0].len() sample.channels[0].len()
) )
} else { } else {
String::from("(none)") String::from("........")
} }
} }