Struct vst2::buffer::AudioBuffer
[−]
[src]
pub struct AudioBuffer<'a, T: 'a + Float> { /* fields omitted */ }
A buffer containing ChannelBuffer
buffers for each input/output.
Methods
impl<'a, T: 'a + Float> AudioBuffer<'a, T>
[src]
fn new(
inputs: Vec<&'a mut [T]>,
outputs: Vec<&'a mut [T]>
) -> AudioBuffer<'a, T>
inputs: Vec<&'a mut [T]>,
outputs: Vec<&'a mut [T]>
) -> AudioBuffer<'a, T>
Create an AudioBuffer
from vectors of slices.
Each vector item represents either an input or output, and contains an array of samples. Eg if inputs was a vector of size 2 containing slices of size 512, it would hold 2 inputs where each input holds 512 samples.
unsafe fn from_raw(
inputs_raw: *mut *mut T,
outputs_raw: *mut *mut T,
num_inputs: usize,
num_outputs: usize,
samples: usize
) -> AudioBuffer<'a, T>
inputs_raw: *mut *mut T,
outputs_raw: *mut *mut T,
num_inputs: usize,
num_outputs: usize,
samples: usize
) -> AudioBuffer<'a, T>
Create an AudioBuffer
from raw pointers. Only really useful for interacting with the VST
API.
fn inputs(&'a mut self) -> &'a mut Vec<&'a mut [T]>
Return a reference to all inputs.
fn outputs(&'a mut self) -> &'a mut Vec<&'a mut [T]>
Return a reference to all outputs.
fn split(self) -> (Vec<&'a mut [T]>, Vec<&'a mut [T]>)
Consume this buffer and split it into separate inputs and outputs.
Example
let (mut inputs, mut outputs) = buffer.split(); let input: &mut [f32] = &mut inputs[0]; // First input
fn zip(self) -> Zip<ChannelBufferIter<'a, T>, ChannelBufferIter<'a, T>>
Zip together buffers.