pub struct RawBufferScratch {
pub input_slices: Vec<&'static [f32]>,
pub output_slices: Vec<&'static mut [f32]>,
}Expand description
Scratch space for AudioBuffer::from_raw_ptrs.
Callers allocate this on the stack and pass it to from_raw_ptrs.
The buffer borrows the slices stored here, so this struct must
outlive the returned AudioBuffer.
Fields§
§input_slices: Vec<&'static [f32]>§output_slices: Vec<&'static mut [f32]>Implementations§
Source§impl RawBufferScratch
impl RawBufferScratch
Sourcepub unsafe fn build<'a>(
&'a mut self,
inputs: *const *const f32,
outputs: *mut *mut f32,
num_in: u32,
num_out: u32,
num_frames: u32,
) -> AudioBuffer<'a>
pub unsafe fn build<'a>( &'a mut self, inputs: *const *const f32, outputs: *mut *mut f32, num_in: u32, num_out: u32, num_frames: u32, ) -> AudioBuffer<'a>
Build an AudioBuffer from raw C pointers.
This is the common FFI pattern used by VST3, VST2, AU, and AAX wrappers. It:
- Converts raw
*const f32/*mut f32channel pointers to slices - Copies input channels to output channels (in-place effect processing)
- Returns an
AudioBufferborrowing the scratch slices
§Safety
inputsmust point tonum_invalid*const f32pointers, each pointing tonum_framessamples.outputsmust point tonum_outvalid*mut f32pointers, each pointing tonum_framessamples.- The pointed-to memory must remain valid for the lifetime of
the returned
AudioBuffer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RawBufferScratch
impl RefUnwindSafe for RawBufferScratch
impl Send for RawBufferScratch
impl Sync for RawBufferScratch
impl Unpin for RawBufferScratch
impl UnsafeUnpin for RawBufferScratch
impl !UnwindSafe for RawBufferScratch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more