Struct synth::envelope::Envelope
[−]
[src]
pub struct Envelope { pub points: Vec<Point>, }
An alias for the envelope to be used used for amp and freq interpolation.
Fields
points: Vec<Point>
Trait Implementations
impl Clone for Envelope
[src]
fn clone(&self) -> Envelope
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Envelope
[src]
impl PartialEq for Envelope
[src]
fn eq(&self, __arg_0: &Envelope) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Envelope) -> bool
This method tests for !=
.
impl FromIterator<Point> for Envelope
[src]
fn from_iter<T>(iter: T) -> Self where
T: IntoIterator<Item = Point>,
T: IntoIterator<Item = Point>,
Creates a value from an iterator. Read more
impl From<Vec<Point>> for Envelope
[src]
impl<'a> Trait<'a> for Envelope
[src]
type X = f64
type Y = f64
type Point = Point
The Point
type which may be referenced and interpolated by the Envelope
.
type Points = Iter<'a, Point>
An iterator yielding references to Self::Point
s.
fn points(&'a self) -> Self::Points
An iterator yielding the Point
s of the Envelope.
fn point_idx_before(&'a self, x: Self::X) -> Option<usize>
The index of the Point
that comes directly before the given x
.
fn point_idx_on_or_before(&'a self, x: Self::X) -> Option<usize>
The index of the Point
that either lands on or comes directly before the given x
.
fn point_idx_after(&'a self, x: Self::X) -> Option<usize>
The index of the Point
that comes directly after the given x
.
fn point_idx_on_or_after(&'a self, x: Self::X) -> Option<usize>
The index of the Point
that comes directly after the given x
.
fn point_before(&'a self, x: Self::X) -> Option<&'a Self::Point>
A reference to the first point that comes before the given x
.
fn point_on_or_before(&'a self, x: Self::X) -> Option<&'a Self::Point>
A reference to the first point that is equal to or comes before the given x
.
fn point_before_with_idx(
&'a self,
x: Self::X
) -> Option<(usize, &'a Self::Point)>
&'a self,
x: Self::X
) -> Option<(usize, &'a Self::Point)>
A reference to the first point that comes before the given x
along with its index.
fn point_on_or_before_with_idx(
&'a self,
x: Self::X
) -> Option<(usize, &'a Self::Point)>
&'a self,
x: Self::X
) -> Option<(usize, &'a Self::Point)>
A reference to the first point that is equal to or comes before the given x
along with its index. Read more
fn point_after(&'a self, x: Self::X) -> Option<&'a Self::Point>
A reference to the first point that comes after the given x
.
fn point_on_or_after(&'a self, x: Self::X) -> Option<&'a Self::Point>
A reference to the first point that is equal to or comes after the given x
.
fn point_after_with_idx(
&'a self,
x: Self::X
) -> Option<(usize, &'a Self::Point)>
&'a self,
x: Self::X
) -> Option<(usize, &'a Self::Point)>
A reference to the first point that comes after the given x
along with its index.
fn point_on_or_after_with_idx(
&'a self,
x: Self::X
) -> Option<(usize, &'a Self::Point)>
&'a self,
x: Self::X
) -> Option<(usize, &'a Self::Point)>
A reference to the first point that is equal to or comes after the given x
along with its index. Read more
fn point_at(&'a self, x: Self::X) -> Option<&'a Self::Point>
A reference to the first point lying directly on the given x
if there is one.
fn point_at_with_idx(&'a self, x: Self::X) -> Option<(usize, &'a Self::Point)>
A reference to the first point (along with it's index) lying directly on the given x
if there is one. Read more
fn surrounding_points(
&'a self,
x: Self::X
) -> (Option<&'a Self::Point>, Option<&'a Self::Point>)
&'a self,
x: Self::X
) -> (Option<&'a Self::Point>, Option<&'a Self::Point>)
The points that lie on either side of the given x
. Read more
fn closest_point(&'a self, x: Self::X) -> Option<&'a Self::Point> where
Self::X: Sub<Self::X>,
<Self::X as Sub<Self::X>>::Output == Self::X,
Self::X: Sub<Self::X>,
<Self::X as Sub<Self::X>>::Output == Self::X,
A reference point that is closest to the given x
if there is one. Read more
fn y(&'a self, x: Self::X) -> Option<Self::Y> where
<Self::Y as Spatial>::Scalar: Scalar,
<Self::Y as Spatial>::Scalar: Scalar,
Return y
for the given x
. Read more
fn steps(&'a self, start: Self::X, step: Self::X) -> Option<Steps<'a, Self>>
Sample the Envelope
's y
value for every given positive x
step starting from the first point's X
value. Read more