pub enum NumericBufferState<I> {
    Constant(f32),
    PiecewiseLinear(PiecewiseLinearCurve<I>),
}Expand description
Represents the state of a numeric value across a buffer
Variants§
Constant(f32)
The value is constant across the buffer.
PiecewiseLinear(PiecewiseLinearCurve<I>)
The value changes over the course of the buffer, represented by a
PiecewiseLinearCurve.
Implementations§
Source§impl<I: IntoIterator<Item = PiecewiseLinearCurvePoint>> NumericBufferState<I>
 
impl<I: IntoIterator<Item = PiecewiseLinearCurvePoint>> NumericBufferState<I>
Sourcepub fn value_at_start_of_buffer(self) -> f32
 
pub fn value_at_start_of_buffer(self) -> f32
Get the value of the parameter at the start of the buffer.
§Examples
assert_eq!(NumericBufferState::PiecewiseLinear(PiecewiseLinearCurve::new(
  vec![PiecewiseLinearCurvePoint { sample_offset: 0, value: 0.5 },
      PiecewiseLinearCurvePoint { sample_offset: 100, value: 1.0 }],
  128,
  0.0..=1.0,
).unwrap()).value_at_start_of_buffer(), 0.5);Trait Implementations§
Source§impl<I: Clone> Clone for NumericBufferState<I>
 
impl<I: Clone> Clone for NumericBufferState<I>
Source§fn clone(&self) -> NumericBufferState<I>
 
fn clone(&self) -> NumericBufferState<I>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreAuto Trait Implementations§
impl<I> Freeze for NumericBufferState<I>where
    I: Freeze,
impl<I> RefUnwindSafe for NumericBufferState<I>where
    I: RefUnwindSafe,
impl<I> Send for NumericBufferState<I>where
    I: Send,
impl<I> Sync for NumericBufferState<I>where
    I: Sync,
impl<I> Unpin for NumericBufferState<I>where
    I: Unpin,
impl<I> UnwindSafe for NumericBufferState<I>where
    I: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more