Struct hexodsp::sample_lib::SampleLibrary
source · [−]Expand description
Loads and stores samples, for use as SAtom parameters for nodes.
Fields
loaded_samples: HashMap<String, SAtom>
max_length_s: usize
Implementations
sourceimpl SampleLibrary
impl SampleLibrary
pub fn new() -> Self
sourcepub fn load<'a>(&'a mut self, path: &str) -> Result<&'a SAtom, SampleLoadError>
pub fn load<'a>(&'a mut self, path: &str) -> Result<&'a SAtom, SampleLoadError>
Synchronous/blocking loading of a sample from path
.
Returns an SAtom reference that you can clone and send directly
to the sampling node of your choice.
Keep in mind that blocking on I/O in the UI might not be desireable.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for SampleLibrary
impl Send for SampleLibrary
impl Sync for SampleLibrary
impl Unpin for SampleLibrary
impl UnwindSafe for SampleLibrary
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more