dasp_signal

Struct OffsetAmpPerChannel

Source
pub struct OffsetAmpPerChannel<S, F> { /* private fields */ }
Expand description

An Iterator that scales the amplitude of every Frame in self by the respective amplitudes in each channel of the given amp Frame.

Trait Implementations§

Source§

impl<S: Clone, F: Clone> Clone for OffsetAmpPerChannel<S, F>

Source§

fn clone(&self) -> OffsetAmpPerChannel<S, F>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<S, F> Signal for OffsetAmpPerChannel<S, F>
where S: Signal, F: Frame<Sample = <<S::Frame as Frame>::Sample as Sample>::Signed, NumChannels = <S::Frame as Frame>::NumChannels>,

Source§

type Frame = <S as Signal>::Frame

The Frame type returned by the Signal.
Source§

fn next(&mut self) -> Self::Frame

Yield the next Frame in the Signal. Read more
Source§

fn is_exhausted(&self) -> bool

Whether or not the signal is exhausted of meaningful frames. Read more
Source§

fn map<M, F>(self, map: M) -> Map<Self, M, F>
where Self: Sized, M: FnMut(Self::Frame) -> F, F: Frame,

A signal that maps one set of frames to another. Read more
Source§

fn zip_map<O, M, F>(self, other: O, map: M) -> ZipMap<Self, O, M, F>
where Self: Sized, M: FnMut(Self::Frame, O::Frame) -> F, O: Signal, F: Frame,

A signal that maps one set of frames to another. Read more
Source§

fn add_amp<S>(self, other: S) -> AddAmp<Self, S>
where Self: Sized, S: Signal, S::Frame: Frame<Sample = <<Self::Frame as Frame>::Sample as Sample>::Signed, NumChannels = <Self::Frame as Frame>::NumChannels>,

Provides an iterator that yields the sum of the frames yielded by both other and self in lock-step. Read more
Source§

fn mul_amp<S>(self, other: S) -> MulAmp<Self, S>
where Self: Sized, S: Signal, S::Frame: Frame<Sample = <<Self::Frame as Frame>::Sample as Sample>::Float, NumChannels = <Self::Frame as Frame>::NumChannels>,

Provides an iterator that yields the product of the frames yielded by both other and self in lock-step. Read more
Source§

fn offset_amp( self, offset: <<Self::Frame as Frame>::Sample as Sample>::Signed, ) -> OffsetAmp<Self>
where Self: Sized,

Provides an iterator that offsets the amplitude of every channel in each frame of the signal by some sample value and yields the resulting frames. Read more
Source§

fn scale_amp( self, amp: <<Self::Frame as Frame>::Sample as Sample>::Float, ) -> ScaleAmp<Self>
where Self: Sized,

Produces an Iterator that scales the amplitude of the sample of each channel in every Frame yielded by self by the given amplitude. Read more
Source§

fn offset_amp_per_channel<F>(self, amp_frame: F) -> OffsetAmpPerChannel<Self, F>
where Self: Sized, F: Frame<Sample = <<Self::Frame as Frame>::Sample as Sample>::Signed, NumChannels = <Self::Frame as Frame>::NumChannels>,

Produces a new Signal that offsets the amplitude of every Frame in self by the respective amplitudes in each channel of the given amp_frame. Read more
Source§

fn scale_amp_per_channel<F>(self, amp_frame: F) -> ScaleAmpPerChannel<Self, F>
where Self: Sized, F: Frame<Sample = <<Self::Frame as Frame>::Sample as Sample>::Float, NumChannels = <Self::Frame as Frame>::NumChannels>,

Produces a new Signal that scales the amplitude of every Frame in self by the respective amplitudes in each channel of the given amp_frame. Read more
Source§

fn mul_hz<M, I>(self, interpolator: I, mul_per_frame: M) -> MulHz<Self, M, I>
where Self: Sized, M: Signal<Frame = f64>, I: Interpolator,

Multiplies the rate at which frames of self are yielded by the given signal. Read more
Source§

fn from_hz_to_hz<I>( self, interpolator: I, source_hz: f64, target_hz: f64, ) -> Converter<Self, I>
where Self: Sized, I: Interpolator,

Converts the rate at which frames of the Signal are yielded using interpolation. Read more
Source§

fn scale_hz<I>(self, interpolator: I, multi: f64) -> Converter<Self, I>
where Self: Sized, I: Interpolator,

Multiplies the rate at which frames of the Signal are yielded by the given value. Read more
Source§

fn delay(self, n_frames: usize) -> Delay<Self>
where Self: Sized,

Delays the Signal by the given number of frames. Read more
Source§

fn into_interleaved_samples(self) -> IntoInterleavedSamples<Self>
where Self: Sized,

Converts a Signal into a type that yields the interleaved Samples. Read more
Source§

fn clip_amp( self, thresh: <<Self::Frame as Frame>::Sample as Sample>::Signed, ) -> ClipAmp<Self>
where Self: Sized,

Clips the amplitude of each channel in each Frame yielded by self to the given threshold amplitude. Read more
Source§

fn inspect<F>(self, inspect: F) -> Inspect<Self, F>
where Self: Sized, F: FnMut(&Self::Frame),

Create a new Signal that calls the enclosing function on each iteration. Read more
Source§

fn fork<S>(self, ring_buffer: Bounded<S>) -> Fork<Self, S>
where Self: Sized, S: SliceMut<Element = Self::Frame>,

Forks Self into two signals that produce the same frames. Read more
Source§

fn take(self, n: usize) -> Take<Self>
where Self: Sized,

Converts the Signal into an Iterator that will yield the given number for Frames before returning None. Read more
Source§

fn until_exhausted(self) -> UntilExhausted<Self>
where Self: Sized,

Converts the Signal into an Iterator yielding frames until the signal.is_exhausted() returns true. Read more
Source§

fn buffered<S>(self, ring_buffer: Bounded<S>) -> Buffered<Self, S>
where Self: Sized, S: Slice<Element = Self::Frame> + SliceMut,

Buffers the signal using the given ring buffer. Read more
Source§

fn by_ref(&mut self) -> &mut Self
where Self: Sized,

Borrows a Signal rather than consuming it. Read more

Auto Trait Implementations§

§

impl<S, F> Freeze for OffsetAmpPerChannel<S, F>
where S: Freeze, F: Freeze,

§

impl<S, F> RefUnwindSafe for OffsetAmpPerChannel<S, F>

§

impl<S, F> Send for OffsetAmpPerChannel<S, F>
where S: Send, F: Send,

§

impl<S, F> Sync for OffsetAmpPerChannel<S, F>
where S: Sync, F: Sync,

§

impl<S, F> Unpin for OffsetAmpPerChannel<S, F>
where S: Unpin, F: Unpin,

§

impl<S, F> UnwindSafe for OffsetAmpPerChannel<S, F>
where S: UnwindSafe, F: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
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, 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<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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>,