Struct vst::host::HostBuffer

source ·
pub struct HostBuffer<T: Float> { /* private fields */ }
Expand description

Used for constructing AudioBuffer instances on the host.

This struct contains all necessary allocations for an AudioBuffer apart from the actual sample arrays. This way, the inner processing loop can be allocation free even if AudioBuffer instances are repeatedly created.

let mut host_buffer: HostBuffer<f32> = HostBuffer::new(2, 2);
let inputs = vec![vec![0.0; 1000]; 2];
let mut outputs = vec![vec![0.0; 1000]; 2];
let mut audio_buffer = host_buffer.bind(&inputs, &mut outputs);
plugin.process(&mut audio_buffer);

Implementations§

Create a HostBuffer for a given number of input and output channels.

Create a HostBuffer for the number of input and output channels specified in an Info struct.

Bind sample arrays to the HostBuffer to create an AudioBuffer to pass to a plugin.

Panics

This function will panic if more inputs or outputs are supplied than the HostBuffer was created for, or if the sample arrays do not all have the same length.

Number of input channels supported by this HostBuffer.

Number of output channels supported by this HostBuffer.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.