AuxOutput

Struct AuxOutput 

Source
pub struct AuxOutput<'borrow, 'data, S: Sample = f32> { /* private fields */ }
Expand description

Mutable view of an auxiliary output bus.

Provides access to output channels for a single auxiliary bus (e.g., aux sends, multi-out). Created via AuxiliaryBuffers::output().

§Type Parameter

S is the sample type, defaulting to f32.

§Lifetime Parameters

  • 'borrow - The borrow lifetime (from &mut self on AuxiliaryBuffers)
  • 'data - The underlying audio data lifetime

This separation is required because &'a mut [&'a mut T] is invariant in Rust, which prevents returning borrowed data from methods.

§Example

if let Some(mut aux_out) = aux.output(0) {
    // Write to aux output
    for sample in aux_out.channel(0) {
        *sample = processed_signal;
    }
}

Implementations§

Source§

impl<'borrow, 'data, S: Sample> AuxOutput<'borrow, 'data, S>

Source

pub fn num_samples(&self) -> usize

Number of samples in each channel.

Source

pub fn num_channels(&self) -> usize

Number of channels in this bus.

Source

pub fn channel(&mut self, index: usize) -> &mut [S]

Get a mutable channel by index.

§Panics

Panics if the channel index is out of bounds.

Source

pub fn channel_checked(&mut self, index: usize) -> Option<&mut [S]>

Try to get a mutable channel by index.

Returns None if the channel doesn’t exist.

Source

pub fn iter_channels( &mut self, ) -> impl Iterator<Item = &mut [S]> + use<'_, 'data, S>

Iterate over all channel slices mutably.

Source

pub fn clear(&mut self)

Clear all channels to silence.

Source

pub fn fill(&mut self, value: S)

Fill all channels with a constant value.

Auto Trait Implementations§

§

impl<'borrow, 'data, S> Freeze for AuxOutput<'borrow, 'data, S>

§

impl<'borrow, 'data, S> RefUnwindSafe for AuxOutput<'borrow, 'data, S>
where S: RefUnwindSafe,

§

impl<'borrow, 'data, S> Send for AuxOutput<'borrow, 'data, S>

§

impl<'borrow, 'data, S> Sync for AuxOutput<'borrow, 'data, S>

§

impl<'borrow, 'data, S> Unpin for AuxOutput<'borrow, 'data, S>

§

impl<'borrow, 'data, S = f32> !UnwindSafe for AuxOutput<'borrow, 'data, S>

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.