Function libpd_rs::open_patch
source · [−]pub fn open_patch<T: AsRef<Path>>(
path_to_patch: T
) -> Result<PatchFileHandle, PatchLifeCycleError>Expand description
Opens a pd patch.
The argument should be an absolute path to the patch file. It would be useful to keep the return value of this function. It can be used later to close it. Absolute and relative paths are supported. Relative paths and single file names are tried in executable directory and manifest directory.
Tha function first checks the executable directory and then the manifest directory.
Examples
use libpd_rs::open_patch;
use std::path::PathBuf;
let absolute_path = PathBuf::from("/home/user/my_patch.pd");
let relative_path = PathBuf::from("../my_patch.pd");
let patch_name = PathBuf::from("my_patch.pd");
let patch_handle = open_patch(&patch_name).unwrap();
// or others..Errors
A list of errors that can occur:
