midi: return old values from cursor traits

This commit is contained in:
🪞👃🪞 2025-04-27 17:07:09 +03:00
parent 397e71edee
commit e9c825e865
6 changed files with 76 additions and 92 deletions

View file

@ -123,15 +123,16 @@ impl NoteRange for Sampler {
}
impl NotePoint for Sampler {
fn note_len (&self) -> usize {0/*TODO*/}
fn set_note_len (&self, x: usize) {}
fn note_len (&self) -> usize { 0/*TODO*/ }
fn set_note_len (&self, x: usize) -> usize { 0 /*TODO*/ }
fn note_pos (&self) -> usize {
self.note_pt.load(Relaxed)
}
fn set_note_pos (&self, x: usize) {
self.note_pt.store(x, Relaxed);
fn set_note_pos (&self, x: usize) -> usize {
let old = self.note_pt.swap(x, Relaxed);
self.cursor.0.store(x % 8, Relaxed);
self.cursor.1.store(x / 8, Relaxed);
old
}
}