/// Create an `AudioBuffer` from raw pointers. Only really useful for interacting with the VST
/// API.
Create an `AudioBuffer` from raw pointers. Only really useful for interacting with the VST
API.
Create an ` AudioBuffer ` from raw pointers . Only really useful for interacting with the VST API .
pub 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> {
        let inputs =
            // Create a slice of type &mut [*mut f32]
            slice::from_raw_parts_mut(inputs_raw, num_inputs).iter()
            // Convert to &mut [&mut [f32]]
            .map(|input| slice::from_raw_parts_mut(*input, samples))
            // Collect into Vec<&mut [f32]>
            .collect();
        let outputs =
            // Create a slice of type &mut [*mut f32]
            slice::from_raw_parts_mut(outputs_raw, num_outputs).iter()
            // Convert to &mut [&mut [f32]]
            .map(|output| slice::from_raw_parts_mut(*output, samples))
            // Collect into Vec<&mut [f32]>
            .collect();
        // Call constructor with vectors
        AudioBuffer::new(inputs, outputs)
    }
pub 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 > { let inputs = // Create a slice of type &mut [*mut f32] slice :: from_raw_parts_mut ( inputs_raw , num_inputs ) . iter ( ) // Convert to &mut [&mut [f32]] . map ( | input | slice :: from_raw_parts_mut ( * input , samples ) ) // Collect into Vec<&mut [f32]> . collect ( ) ; let outputs = // Create a slice of type &mut [*mut f32] slice :: from_raw_parts_mut ( outputs_raw , num_outputs ) . iter ( ) // Convert to &mut [&mut [f32]] . map ( | output | slice :: from_raw_parts_mut ( * output , samples ) ) // Collect into Vec<&mut [f32]> . collect ( ) ; // Call constructor with vectors AudioBuffer :: new ( inputs , outputs ) }
Create an `AudioBuffer` from raw pointers.
Create an ` AudioBuffer ` from raw pointers .
inputs_raw
*mut *mut T
outputs_raw
*mut *mut T
num_inputs
usize
num_outputs
usize
samples
usize