Stereo

Struct Stereo 

Source
pub struct Stereo<X: Signal<Sample = Mono>, Y: Signal<Sample = Mono>>(pub X, pub Y);
Expand description

Combines two smp::Mono signals into a smp::Stereo signal. One signal plays on each channel.

Tuple Fields§

§0: X§1: Y

Implementations§

Source§

impl<X: Signal<Sample = Mono>, Y: Signal<Sample = Mono>> Stereo<X, Y>

Source

pub const fn new(sgn1: X, sgn2: Y) -> Self

Initializes a new Stereo.

Source§

impl<Z: Signal<Sample = Mono> + Clone> Stereo<Z, Z>

Source

pub fn dup(sgn: Z) -> Self

Duplicates a smp::Mono signal.

Trait Implementations§

Source§

impl<X: Done<Sample = Mono>, Y: Done<Sample = Mono>> Done for Stereo<X, Y>

Source§

fn is_done(&self) -> bool

Returns whether the signal has stopped producing any sound altogether. If this returns true once, it must return true in all successive times, unless retriggered. Read more
Source§

impl<X: Panic<Sample = Mono>, Y: Panic<Sample = Mono>> Panic for Stereo<X, Y>

Source§

fn panic(&mut self)

Stops all subsequent sound.
Source§

impl<X: Signal<Sample = Mono>, Y: Signal<Sample = Mono>> Signal for Stereo<X, Y>

Source§

type Sample = Stereo

The type of sample generated by the signal.
Source§

fn get(&self) -> Self::Sample

Gets the next sample from the signal. Read more
Source§

fn _get(&self) -> Self::Sample

Currently, rust-analyzer trips up sometimes that get is called, confusing it with Array::get. This hack bypasses this.
Source§

impl<X: SignalMut<Sample = Mono>, Y: SignalMut<Sample = Mono>> SignalMut for Stereo<X, Y>

Source§

fn advance(&mut self)

Advances the state of the signal by a frame.
Source§

fn retrigger(&mut self)

Resets the signal to its initial state.
Source§

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

Gets the next sample and advances the state of the signal.
Source§

impl<X: Stop<Sample = Mono>, Y: Stop<Sample = Mono>> Stop for Stereo<X, Y>

Source§

fn stop(&mut self)

Releases a note.

Auto Trait Implementations§

§

impl<X, Y> Freeze for Stereo<X, Y>
where X: Freeze, Y: Freeze,

§

impl<X, Y> RefUnwindSafe for Stereo<X, Y>

§

impl<X, Y> Send for Stereo<X, Y>
where X: Send, Y: Send,

§

impl<X, Y> Sync for Stereo<X, Y>
where X: Sync, Y: Sync,

§

impl<X, Y> Unpin for Stereo<X, Y>
where X: Unpin, Y: Unpin,

§

impl<X, Y> UnwindSafe for Stereo<X, Y>
where X: UnwindSafe, Y: 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V