fn on_parameter_update(&mut self, reset: bool) {
        self.smoothing_samples = InterpolatedValue::calculate_smoothing_samples(
            self.sample_rate,
            self.smoothing_duration,
        );

        // Reset currently running interpolation
        if reset {
            if let Some(target) = self.interpolation_state.as_ref().map(|s| s.target) {
                self.set(target);
            }
            return;
        }

        // Update currently running interpolation
        if let Some(state) = &mut self.interpolation_state {
            let delta = state.target - state.start;
            let tick_increment = delta / self.smoothing_samples;
            state.tick_increment = tick_increment;
        }
    }
/// Update internal state when sample rate or duration changes.
Update internal state when sample rate or duration changes.
Update internal state when sample rate or duration changes .
fn on_parameter_update(&mut self, reset: bool) {
        self.smoothing_samples = InterpolatedValue::calculate_smoothing_samples(
            self.sample_rate,
            self.smoothing_duration,
        );
        // Reset currently running interpolation
        if reset {
            if let Some(target) = self.interpolation_state.as_ref().map(|s| s.target) {
                self.set(target);
            }
            return;
        }
        // Update currently running interpolation
        if let Some(state) = &mut self.interpolation_state {
            let delta = state.target - state.start;
            let tick_increment = delta / self.smoothing_samples;
            state.tick_increment = tick_increment;
        }
    }
fn on_parameter_update ( & mut self , reset : bool ) { self . smoothing_samples = InterpolatedValue :: calculate_smoothing_samples ( self . sample_rate , self . smoothing_duration , ) ; // Reset currently running interpolation if reset { if let Some ( target ) = self . interpolation_state . as_ref ( ) . map ( | s | s . target ) { self . set ( target ) ; } return ; } // Update currently running interpolation if let Some ( state ) = & mut self . interpolation_state { let delta = state . target - state . start ; let tick_increment = delta / self . smoothing_samples ; state . tick_increment = tick_increment ; } }
Update internal state when sample rate or duration changes.
Update internal state when sample rate or duration changes .
&mut self
reset
bool
&mut self
reset
bool