pub struct Music { /* private fields */ }Expand description
A controller bound to one mixer and one fixed transport. It does not own sounds or mutate voices on the control thread; future operations target whichever track is active when they actually execute. Dropping it does not stop its track.
Implementations§
Source§impl Music
impl Music
pub fn new( handle: &mut MixerHandle, transport: Transport, bus: BusId, ) -> Result<Self>
pub fn transport(&self) -> Transport
Sourcepub fn transition(
&self,
handle: &mut MixerHandle,
track: Track,
intensity: f32,
timing: Timing,
fade: Fade,
) -> Result<MusicId>
pub fn transition( &self, handle: &mut MixerHandle, track: Track, intensity: f32, timing: Timing, fade: Fade, ) -> Result<MusicId>
Replace this controller’s track. All new stems start at source frame zero, fading in while the previous track fades out over the same duration/curve. Preparation/queue errors change no voice; audio capacity failures are events.
Sourcepub fn set_intensity(
&self,
handle: &mut MixerHandle,
intensity: f32,
timing: Timing,
fade: Fade,
) -> Result<MusicId>
pub fn set_intensity( &self, handle: &mut MixerHandle, intensity: f32, timing: Timing, fade: Fade, ) -> Result<MusicId>
Fade the active track’s layer gains without restarting or pausing any source.
Auto Trait Implementations§
impl Freeze for Music
impl RefUnwindSafe for Music
impl Send for Music
impl Sync for Music
impl Unpin for Music
impl UnsafeUnpin for Music
impl UnwindSafe for Music
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