Function libpd_rs::array::read_float_array_from
source · [−]pub fn read_float_array_from<T: AsRef<str>>(
source_name: T,
source_read_offset: i32,
source_read_amount: i32,
destination: &mut [f32]
) -> Result<(), ArrayError>Expand description
Reads a named array from pd to a mutable slice of f32.
Reads values as much as source_read_amount from the array which is specified with the source_name argument
starting from source_read_offset and writes them to destination.
Example
use libpd_rs::array::read_float_array_from;
let mut destination = [0.0_f32; 64];
read_float_array_from("my_array", 32, 32, &mut destination).unwrap();Errors
This function performs no bounds checking on the destination.
If destination_offset + read_amount is greater than the size of the destination or
the array which we’re trying to read from is not existent it will return an error.
A list of errors that can occur:
