Struct hodaun::source::Map

source ·
pub struct Map<S, F> { /* private fields */ }
Expand description

Source returned from Source::map

Trait Implementations§

source§

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

source§

fn clone(&self) -> Map<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: Debug, F: Debug> Debug for Map<S, F>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<S, F, B> Source for Map<S, F>where S: Source, F: Fn(S::Frame) -> B, B: Frame,

§

type Frame = B

The Frame type
source§

fn next(&mut self, sample_rate: f64) -> Option<Self::Frame>

Get the next frame Read more
source§

fn amplify<A>(self, amp: A) -> Amplify<Self, A>where Self: Sized, A: Automation,

Amplify the source by some multiplier
source§

fn take(self, dur: impl ToDuration) -> Take<Self, f64>where Self: Sized,

End the source after some duration
source§

fn take_release<R>(self, dur: impl ToDuration, release: R) -> Take<Self, R>where Self: Sized, R: Automation,

End the source after some duration and apply a release envelope
source§

fn chain<B>(self, next: B) -> Chain<Self, B>where Self: Sized, B: Source<Frame = Self::Frame>,

Chain the source with another
source§

fn low_pass<F>(self, freq: F) -> LowPass<Self, F>where Self: Sized, F: Automation,

Apply a low-pass filter with the given cut-off frequency
source§

fn map<F, B>(self, f: F) -> Map<Self, F>where Self: Sized, F: Fn(Self::Frame) -> B,

Transform each frame with the given function
source§

fn zip<F, B>(self, other: B, f: F) -> Zip<Self, B, F>where Self: Sized, B: Source, F: Fn(Self::Frame, B::Frame) -> Self::Frame,

Combine this source with another using the given frame-combining function
source§

fn mix<B>( self, other: B ) -> Zip<Self, B, fn(_: Self::Frame, _: Self::Frame) -> Self::Frame>where Self: Sized, B: Source<Frame = Self::Frame>,

Combine this source with another by adding their frames
source§

fn pan<P>(self, pan: P) -> Pan<Self, P>where Self: Sized, P: Automation,

Apply a pan to the source Read more
source§

fn positive(self) -> Positive<Self>where Self: Sized,

Map the source’s amplitude’s range from [-1, 1] to [0, 1] Read more
source§

fn repeat(self, n: usize) -> Repeat<Self, f64>where Self: Sized,

Repeat a source n times
source§

fn repeat_indefinitely(self) -> Repeat<Self, f64>where Self: Sized,

Repeat a source indefinitely
source§

fn no_repeat(self) -> NoRepeat<Self>where Self: Sized,

When repeated, make the source continue where it left off instead of starting over Read more
source§

fn ads<A, D, S>(self, envelope: AdsEnvelope<A, D, S>) -> Ads<Self, A, D, S>where Self: Sized, A: Automation, D: Automation, S: Automation,

Apply an attack-decay-sustain envelope to the source Read more
source§

fn maintained<R>(self, maintainer: &Maintainer<R>) -> Maintained<Self, R>where Self: Sized, R: Automation + Clone,

Keep playing this source as long as the given Maintainer is not dropped
source§

fn inspect(self) -> (SourceInspector<Self::Frame>, InspectedSource<Self>)where Self: Sized,

Allow the current frame of the source to be inspected
source§

fn buffer(self) -> Buffered<Self>where Self: Sized,

Buffer the source Read more
source§

fn unroll(self, sample_rate: f64) -> Unroll<Self> where Self: Sized,

Unroll the source so that its samples are flat
source§

impl<S: Copy, F: Copy> Copy for Map<S, F>

Auto Trait Implementations§

§

impl<S, F> RefUnwindSafe for Map<S, F>where F: RefUnwindSafe, S: RefUnwindSafe,

§

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

§

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

§

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

§

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

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<S> Automation for Swhere S: Source<Frame = f64>,

source§

fn next_value(&mut self, sample_rate: f64) -> Option<f64>

Get the next value
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

source§

impl<T, U> Into<U> for Twhere 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 Twhere T: Clone,

§

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
§

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

§

fn to_sample_(self) -> U

source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

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