pub struct Sampler { /* private fields */ }
Expand description
A vecmap of FMOD sounds.
Implementations§
Source§impl Sampler
impl Sampler
pub fn new(system: &System) -> Self
pub fn load(&mut self, files: VecMap<String>)
pub fn load_memory(&mut self, files: VecMap<&[u8]>)
pub fn load_pcm(&mut self, pcms: VecMap<&[i16]>)
pub fn get(&self, id: Id) -> Option<&Sound>
pub fn get_mut(&mut self, id: Id) -> Option<&mut Sound>
pub fn set(&mut self, sample: Sound, id: Id)
pub fn remove(&mut self, id: Id) -> Option<Sound>
Sourcepub fn play(
&mut self,
id: Id,
mode: Option<Mode>,
channel_group: Option<&mut ChannelGroup>,
) -> Channel
pub fn play( &mut self, id: Id, mode: Option<Mode>, channel_group: Option<&mut ChannelGroup>, ) -> Channel
Start playing on a fresh channel; the priority system will “steal” an existing channel if there are no free channels.
If no mode is given, the current mode for the sound (sound.get_mode()
)
will be used. Providing a mode will set the mode on the sound.
Trait Implementations§
impl StructuralPartialEq for Sampler
Auto Trait Implementations§
impl Freeze for Sampler
impl RefUnwindSafe for Sampler
impl !Send for Sampler
impl !Sync for Sampler
impl Unpin for Sampler
impl UnwindSafe for Sampler
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