add getter/setters to note cursor traits

This commit is contained in:
🪞👃🪞 2025-05-08 03:19:47 +03:00
parent a6100ab1d6
commit a8be2e9dad
8 changed files with 214 additions and 188 deletions

View file

@ -93,13 +93,19 @@ impl NoteRange for Sampler {
}
impl NotePoint for Sampler {
fn note_len (&self) -> usize {
0 /*TODO?*/
fn note_len (&self) -> &AtomicUsize {
unreachable!();
}
fn get_note_len (&self) -> usize {
0
}
fn set_note_len (&self, x: usize) -> usize {
0 /*TODO?*/
}
fn note_pos (&self) -> usize {
fn note_pos (&self) -> &AtomicUsize {
&self.note_pt
}
fn get_note_pos (&self) -> usize {
self.note_pt.load(Relaxed)
}
fn set_note_pos (&self, x: usize) -> usize {

View file

@ -56,9 +56,9 @@ impl Sampler {
pub fn view_list <'a, T: NotePoint + NoteRange> (
&'a self, compact: bool, editor: &T
) -> impl Content<TuiOut> + 'a {
let note_lo = editor.note_lo().load(Relaxed);
let note_pt = editor.note_pos();
let note_hi = editor.note_hi();
let note_lo = editor.get_note_lo();
let note_pt = editor.get_note_pos();
let note_hi = editor.get_note_hi();
Fixed::x(12, Map::south(
1,
move||(note_lo..=note_hi).rev(),