Ramp

Struct Ramp 

Source
pub struct Ramp { /* private fields */ }
Expand description

When input 0 changes, move smoothly to the new value over the time in seconds given by input 1.

Implementations§

Source§

impl Ramp

Source

pub fn new(start_value: Sample) -> Self

Source

pub fn process( &mut self, value: &[Sample], time: &[Sample], ramped_value: &mut [Sample], block_size: BlockSize, sample_rate: SampleRate, ) -> GenState

Source

pub fn init(&mut self)

Source§

impl Ramp

Source

pub fn upload(self) -> Handle<RampHandle>

Upload the Gen to the currently selected Graph and return a handle

Trait Implementations§

Source§

impl Default for Ramp

Source§

fn default() -> Ramp

Returns the “default value” for a type. Read more
Source§

impl Gen for Ramp

Source§

fn process( &mut self, ctx: GenContext<'_, '_>, resources: &mut Resources, ) -> GenState

The input and output buffers are both indexed using [in/out_index][sample_index]. Read more
Source§

fn num_inputs(&self) -> usize

The number of inputs this Gen takes. Determines how big the input buffer is.
Source§

fn num_outputs(&self) -> usize

The number of outputs this Gen produces. Determines how big the output buffer is.
Source§

fn input_desc(&self, input: usize) -> &'static str

Return a label for a given input channel index. This sets the label in the Connection API.
Source§

fn output_desc(&self, output: usize) -> &'static str

Return a label for a given output channel index. This sets the label in the Connection API.
Source§

fn init(&mut self, block_size: usize, sample_rate: Sample, node_id: NodeId)

Initialize buffers etc. Default: noop
Source§

fn name(&self) -> &'static str

A name identifying this Gen.

Auto Trait Implementations§

§

impl Freeze for Ramp

§

impl RefUnwindSafe for Ramp

§

impl Send for Ramp

§

impl Sync for Ramp

§

impl Unpin for Ramp

§

impl UnwindSafe for Ramp

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> GenOrGraph for T
where T: Gen + Send + 'static,

Source§

fn components( self, _parent_graph_block_size: usize, _parent_graph_sample_rate: f32, _parent_graph_oversampling: Oversampling, ) -> (Option<Graph>, Box<dyn Gen + Send>)

Source§

fn into_gen_or_graph_enum(self) -> GenOrGraphEnum

Source§

fn num_outputs(&self) -> usize

Source§

fn num_inputs(&self) -> usize

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,