pub struct OutputChannels<'a, S> { /* private fields */ }Expand description
An OutputPort’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
OutputPort::channels.
Implementations§
Source§impl<S> OutputChannels<'_, S>
impl<S> OutputChannels<'_, S>
Sourcepub fn frames_count(&self) -> u32
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.
Sourcepub fn raw_data(&self) -> &[*mut S]
pub fn raw_data(&self) -> &[*mut S]
Returns the raw pointer data, as provided by the host.
In CLAP’s API, hosts provide a port’s audio data as an array of raw pointers, each of which points
to the start of a sample array of type S and of frames_count length.
Sourcepub fn channel_count(&self) -> u32
pub fn channel_count(&self) -> u32
The number of channels.
Sourcepub fn channel(&self, channel_index: u32) -> Option<&[S]>
pub fn channel(&self, channel_index: u32) -> Option<&[S]>
Retrieves the sample buffer of the channel at a given index, as a read-only slice.
Sourcepub fn channel_mut(&mut self, channel_index: u32) -> Option<&mut [S]>
pub fn channel_mut(&mut self, channel_index: u32) -> Option<&mut [S]>
Retrieves the sample buffer of the channel at a given index, as a mutable slice.
Sourcepub fn iter(&self) -> InputChannelsIter<'_, S> ⓘ
pub fn iter(&self) -> InputChannelsIter<'_, S> ⓘ
Gets a read-only iterator over all the port’s channels’ sample buffers.
Sourcepub fn iter_mut(&mut self) -> OutputChannelsIter<'_, S> ⓘ
pub fn iter_mut(&mut self) -> OutputChannelsIter<'_, S> ⓘ
Gets an iterator over all the port’s channels’ writable sample buffers.
Sourcepub fn split_at_mut(
&mut self,
mid: u32,
) -> (OutputChannels<'_, S>, OutputChannels<'_, S>)
pub fn split_at_mut( &mut self, mid: u32, ) -> (OutputChannels<'_, S>, OutputChannels<'_, S>)
Divides the output channels into two at an index.
The first will contain all channels with indices from [0, mid) (excluding
the index mid itself) and the second will contain all channels with
indices from [mid, channel_count).
Unlike slice::split_at_mut, this method does not panic if
mid is larger than channel_count.
The second OutputChannels will only be empty in this case.