pub struct Sources { /* private fields */ }Expand description
Source registry. Insertion and optional synthesis happen on the control thread.
Prepared banks retain Arcs, so the registry may be dropped after preparation.
Implementations§
Source§impl Sources
impl Sources
Sourcepub fn insert(&mut self, name: &str, audio: impl Into<Arc<Audio>>) -> Result<()>
pub fn insert(&mut self, name: &str, audio: impl Into<Arc<Audio>>) -> Result<()>
Registers mono/stereo audio without copying its samples. Duplicate or invalid names are errors, leaving the previous entry intact.
Sourcepub fn insert_effect(
&mut self,
name: &str,
effect: &Effect,
rate: u32,
) -> Result<()>
pub fn insert_effect( &mut self, name: &str, effect: &Effect, rate: u32, ) -> Result<()>
Renders and caches an effect once; requires sfx.
Sourcepub fn insert_score(
&mut self,
name: &str,
score: &Score,
rate: u32,
options: &RenderOptions,
) -> Result<()>
pub fn insert_score( &mut self, name: &str, score: &Score, rate: u32, options: &RenderOptions, ) -> Result<()>
Renders and caches a finite score once; requires synth.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Sources
impl RefUnwindSafe for Sources
impl Send for Sources
impl Sync for Sources
impl Unpin for Sources
impl UnsafeUnpin for Sources
impl UnwindSafe for Sources
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more