Function libpd_rs::array::read_double_array_from
source · [−]pub fn read_double_array_from<T: AsRef<str>>(
source_name: T,
source_read_offset: i32,
source_read_amount: i32,
destination: &mut [f64]
) -> Result<(), ArrayError>
Expand description
Reads a named array from pd to a mutable slice of f64
.
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_double_array_from;
let mut destination = [0.0_f64; 64];
read_double_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: