pub struct AudioHandle { /* private fields */ }Expand description
Clonable handle the VM and editors use to poke the synth.
Implementations§
Source§impl AudioHandle
impl AudioHandle
pub fn new(synth: Arc<Mutex<Synth>>) -> Self
pub fn with_synth<R>(&self, f: impl FnOnce(&mut Synth) -> R) -> R
pub fn play_sfx(&self, n: i32, channel: i32)
Sourcepub fn channel_step(&self) -> [Option<usize>; 4]
pub fn channel_step(&self) -> [Option<usize>; 4]
The step each channel’s voice is sounding (for editor playheads).
pub fn play_music( &self, n: i32, fade_duration: i32, channel_mask: i32, token: i32, ) -> i32
pub fn stop_all(&self)
pub fn load(&self, sfx: Vec<Sfx>, music: Vec<MusicPattern>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AudioHandle
impl RefUnwindSafe for AudioHandle
impl Send for AudioHandle
impl Sync for AudioHandle
impl Unpin for AudioHandle
impl UnsafeUnpin for AudioHandle
impl UnwindSafe for AudioHandle
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