Skip to main content

InputAudioBuffers

Struct InputAudioBuffers 

Source
pub struct InputAudioBuffers<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> InputAudioBuffers<'a>

Source

pub const fn empty() -> Self

Source

pub fn truncate(&mut self, max_buffer_size: u32)

Shortens the frames_count of these input buffers.

This does not actually change the underlying buffers themselves, it only reduces the slice that will be exposed to the plugin.

This method does nothing if max_buffer_size is greater or equal than the current frames_count.

Source

pub unsafe fn from_raw_buffers( buffers: &'a [clap_audio_buffer], frames_count: u32, ) -> Self

§Safety

The caller must ensure all buffer structs are valid for ’a, including all the buffer pointers they contain.

The caller must also ensure frames_count is lower than or equal to the sizes of the channel buffers pointed to by buffers.

Source

pub fn from_plugin_audio(audio: &Audio<'a>) -> InputAudioBuffers<'a>

Available on crate feature clack-plugin only.
Source

pub fn as_plugin_audio(&self) -> Audio<'a>

Available on crate feature clack-plugin only.
Source

pub fn as_raw_buffers(&self) -> &'a [clap_audio_buffer]

Source

pub fn port_count(&self) -> u32

The number of port buffers this InputAudioBuffers has been given.

Source

pub fn frames_count(&self) -> Option<u32>

The number of frames in these input buffers.

This is the minimum frame count of all the port buffers this has been given.

If this has no port buffer (i.e. port_count is zero), this returns None.

Source

pub fn port_info(&self, port_index: u32) -> Option<AudioPortProcessingInfo>

Source

pub fn port_infos(&self) -> impl Iterator<Item = AudioPortProcessingInfo> + '_

Source

pub fn min_available_frames_with(&self, outputs: &OutputAudioBuffers<'_>) -> u32

Returns the minimum number of frames available both in this InputAudioBuffers and the given OutputAudioBuffers.

This is useful to ensure a safe frame count for a process batch that would receive those input and output audio buffers.

Auto Trait Implementations§

§

impl<'a> Freeze for InputAudioBuffers<'a>

§

impl<'a> RefUnwindSafe for InputAudioBuffers<'a>

§

impl<'a> Send for InputAudioBuffers<'a>

§

impl<'a> Sync for InputAudioBuffers<'a>

§

impl<'a> Unpin for InputAudioBuffers<'a>

§

impl<'a> UnsafeUnpin for InputAudioBuffers<'a>

§

impl<'a> UnwindSafe for InputAudioBuffers<'a>

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.