Skip to main content

PairedChannels

Struct PairedChannels 

Source
pub struct PairedChannels<'a, S> { /* private fields */ }
Expand description

An PortPair’s channels’ data buffers, which contains samples of a given type S.

The sample type S is always going to be either f32 or f64, as returned by PortPair::channels.

Implementations§

Source§

impl<'a, S> PairedChannels<'a, S>

Source

pub fn frames_count(&self) -> u32

Returns the number of frames to process in this block.

This will always match the number of samples of every audio channel buffer, from both the input and output port.

Source

pub fn input_channel_count(&self) -> usize

The number of input channels.

Source

pub fn output_channel_count(&self) -> usize

The number of output channels.

Source

pub fn channel_pair_count(&self) -> usize

The total number of channel pairs.

Since there may be more channels in one port than in the other, this method also counts the partial ChannelPairs that can be returned, and therefore returns the maximum number of channels between the input and output ports.

Source

pub fn channel_pair(&mut self, index: usize) -> Option<ChannelPair<'a, S>>

Retrieves the pair of sample buffers for the pair of channels at a given index.

If there is no channel at the given index (i.e. channel_index is greater or equal than channel_pair_count), this returns None.

See ChannelPair’s documentation for examples on how to access sample buffers from it.

Source

pub fn iter_mut(&mut self) -> PairedChannelsIter<'_, S> ⓘ

Gets an iterator over all the ports’ ChannelPairs.

Trait Implementations§

Source§

impl<'a, S> IntoIterator for PairedChannels<'a, S>

Source§

type Item = ChannelPair<'a, S>

The type of the elements being iterated over.
Source§

type IntoIter = PairedChannelsIter<'a, S>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<'a, S> !Send for PairedChannels<'a, S>

§

impl<'a, S> !Sync for PairedChannels<'a, S>

§

impl<'a, S> !UnwindSafe for PairedChannels<'a, S>

§

impl<'a, S> Freeze for PairedChannels<'a, S>
where &'a [*mut S]: Freeze, &'a mut [*mut S]: Freeze,

§

impl<'a, S> RefUnwindSafe for PairedChannels<'a, S>
where &'a [*mut S]: RefUnwindSafe, &'a mut [*mut S]: RefUnwindSafe,

§

impl<'a, S> Unpin for PairedChannels<'a, S>
where &'a [*mut S]: Unpin, &'a mut [*mut S]: Unpin,

§

impl<'a, S> UnsafeUnpin for PairedChannels<'a, S>
where &'a [*mut S]: UnsafeUnpin, &'a mut [*mut S]: UnsafeUnpin,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.