Struct audio_processor_traits::audio_buffer::vst::VSTAudioBuffer
source · [−]pub struct VSTAudioBuffer<'a, SampleType> { /* private fields */ }
Expand description
Wraps a VST buffer with a generic AudioBuffer.
NOTE:
Due to Rust VST using different references for input & output buffers the API here is slightly dubious.
audio_buffer.get(channel, sample)
will return a sample from the INPUT buffer.
Meanwhile audio_buffer.get_mut(channel, sample)
will return a sample from the OUTPUT
buffer.
This means it might be that audio_buffer.get(channel, sample)
is different to
audio_buffer.get_mut(channel, sample)
.
Implementations
sourceimpl<'a, SampleType: Float> VSTAudioBuffer<'a, SampleType>
impl<'a, SampleType: Float> VSTAudioBuffer<'a, SampleType>
pub fn new(
inputs: Inputs<'a, SampleType>,
outputs: Outputs<'a, SampleType>
) -> Self
pub fn with_buffer(buffer: &'a mut AudioBuffer<'a, SampleType>) -> Self
Trait Implementations
sourceimpl<'a, SampleType> AudioBuffer for VSTAudioBuffer<'a, SampleType>
impl<'a, SampleType> AudioBuffer for VSTAudioBuffer<'a, SampleType>
type SampleType = SampleType
type SampleType = SampleType
The type of samples within this buffer.
sourcefn num_channels(&self) -> usize
fn num_channels(&self) -> usize
The number of channels in this buffer
sourcefn num_samples(&self) -> usize
fn num_samples(&self) -> usize
The number of samples in this buffer
sourcefn slice(&self) -> &[Self::SampleType]
fn slice(&self) -> &[Self::SampleType]
Get a slice to the internal data. Will not work with VST adapter Read more
sourcefn slice_mut(&mut self) -> &mut [Self::SampleType]
fn slice_mut(&mut self) -> &mut [Self::SampleType]
Get a mutable slice to the internal data. Will not work with VST adapter Read more
sourcefn get(&self, channel: usize, sample: usize) -> &Self::SampleType
fn get(&self, channel: usize, sample: usize) -> &Self::SampleType
Get a ref to an INPUT sample in this buffer. Read more
sourcefn get_mut(&mut self, channel: usize, sample: usize) -> &mut Self::SampleType
fn get_mut(&mut self, channel: usize, sample: usize) -> &mut Self::SampleType
Get a mutable ref to an OUTPUT sample in this buffer Read more
sourcefn set(&mut self, channel: usize, sample: usize, value: Self::SampleType)
fn set(&mut self, channel: usize, sample: usize, value: Self::SampleType)
Set an OUTPUT sample in this buffer
sourcefn frames(&self) -> Chunks<'_, Self::SampleType>
fn frames(&self) -> Chunks<'_, Self::SampleType>
Shortcut for .slice().chunks(num_channels)
sourcefn frames_mut(&mut self) -> ChunksMut<'_, Self::SampleType>
fn frames_mut(&mut self) -> ChunksMut<'_, Self::SampleType>
Shortcut for .slice_mut().chunks_mut(num_channels)
Read more
sourceunsafe fn get_unchecked(
&self,
channel: usize,
sample: usize
) -> &Self::SampleType
unsafe fn get_unchecked(
&self,
channel: usize,
sample: usize
) -> &Self::SampleType
Unsafe, no bounds check - Get a ref to an INPUT sample in this buffer Read more
sourceunsafe fn get_unchecked_mut(
&mut self,
channel: usize,
sample: usize
) -> &mut Self::SampleType
unsafe fn get_unchecked_mut(
&mut self,
channel: usize,
sample: usize
) -> &mut Self::SampleType
Unsafe, no bounds check - Get a mutable ref to an OUTPUT sample in this buffer Read more
sourceunsafe fn set_unchecked(
&mut self,
channel: usize,
sample: usize,
value: Self::SampleType
)
unsafe fn set_unchecked(
&mut self,
channel: usize,
sample: usize,
value: Self::SampleType
)
Unsafe, no bounds check - Set an OUTPUT sample in this buffer Read more
Auto Trait Implementations
impl<'a, SampleType> RefUnwindSafe for VSTAudioBuffer<'a, SampleType> where
SampleType: RefUnwindSafe,
impl<'a, SampleType> !Send for VSTAudioBuffer<'a, SampleType>
impl<'a, SampleType> !Sync for VSTAudioBuffer<'a, SampleType>
impl<'a, SampleType> Unpin for VSTAudioBuffer<'a, SampleType>
impl<'a, SampleType> UnwindSafe for VSTAudioBuffer<'a, SampleType> where
SampleType: RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more