pub struct SmoothValue { /* private fields */ }Expand description
A linearly ramped scalar that glides from its current value to a target over a fixed number of samples.
Implementations§
Source§impl SmoothValue
impl SmoothValue
Sourcepub fn set_target(&mut self, target: f32, samples: u32)
pub fn set_target(&mut self, target: f32, samples: u32)
Sets a new target reached over samples samples; 0 jumps immediately.
Sourcepub fn next_sample(&mut self) -> f32
pub fn next_sample(&mut self) -> f32
Advances one sample along the ramp and returns the new current value.
Trait Implementations§
Source§impl Clone for SmoothValue
impl Clone for SmoothValue
Source§fn clone(&self) -> SmoothValue
fn clone(&self) -> SmoothValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SmoothValue
Source§impl Debug for SmoothValue
impl Debug for SmoothValue
Source§impl PartialEq for SmoothValue
impl PartialEq for SmoothValue
impl StructuralPartialEq for SmoothValue
Auto Trait Implementations§
impl Freeze for SmoothValue
impl RefUnwindSafe for SmoothValue
impl Send for SmoothValue
impl Sync for SmoothValue
impl Unpin for SmoothValue
impl UnsafeUnpin for SmoothValue
impl UnwindSafe for SmoothValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more