diff --git a/src/editor.rs b/src/editor.rs index 4a13a4d..286f6ab 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -13,7 +13,7 @@ use nih_plug_vizia::{ use crate::{ util, AtomicBoolArray, AtomicByteArray, Del2Params, LastPlayedNotes, SharedDelayData, - SharedDelayDataOutput, LEARNING, LOCK_TAPS, MUTE_IN, MUTE_OUT, NO_LEARNED_NOTE, RESET_TAPS, + SharedDelayDataOutput, CLEAR_TAPS, LEARNING, LOCK_TAPS, MUTE_IN, MUTE_OUT, NO_LEARNED_NOTE, }; #[derive(Lens, Clone)] @@ -168,7 +168,7 @@ pub fn create(editor_data: Data, editor_state: Arc) -> Option) -> Option vg::Paint::color(border_color), (_, _, _, true, true) => vg::Paint::color(outline_color), diff --git a/src/lib.rs b/src/lib.rs index e4e498a..e627b7b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,7 +47,7 @@ const LEARNING: u8 = 129; // should be 0..7 because of AtomicByteArray size const MUTE_IN: usize = 0; const MUTE_OUT: usize = 1; -const RESET_TAPS: usize = 2; +const CLEAR_TAPS: usize = 2; const LOCK_TAPS: usize = 3; const MAX_HAAS_MS: f32 = 5.0; @@ -1038,7 +1038,7 @@ impl Del2 { CountingState::TimeOut => { if is_delay_note && !is_learning && taps_unlocked { // If in TimeOut state, reset and start new counting phase - self.reset_taps(timing, true); + self.clear_taps(timing, true); } } CountingState::CountingInBuffer => { @@ -1124,9 +1124,9 @@ impl Del2 { } // self.last_played_notes.note_off(note); } - if self.is_playing_action(RESET_TAPS) { - self.reset_taps(timing, false); - // self.last_played_notes.note_off(self.learned_notes.load(RESET_TAPS)) + if self.is_playing_action(CLEAR_TAPS) { + self.clear_taps(timing, false); + // self.last_played_notes.note_off(self.learned_notes.load(CLEAR_TAPS)) } } } @@ -1144,7 +1144,7 @@ impl Del2 { self.last_played_notes.note_off(note); } - fn reset_taps(&mut self, timing: u32, restart: bool) { + fn clear_taps(&mut self, timing: u32, restart: bool) { self.enabled_actions.store(LOCK_TAPS, false); self.delay_data.current_tap = 0; self.start_release_for_all_delay_taps(self.sample_rate);