Skip to main content

Music

Struct Music 

Source
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

Source

pub fn new( handle: &mut MixerHandle, transport: Transport, bus: BusId, ) -> Result<Self>

Source

pub fn transport(&self) -> Transport

Source

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.

Source

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.

Source

pub fn cue( &self, handle: &mut MixerHandle, sound: impl Into<Sound>, gain: f32, timing: Timing, ) -> Result<MusicId>

Layer a one-shot cue over music. Track transitions/stops do not stop cues.

Source

pub fn stop( &self, handle: &mut MixerHandle, timing: Timing, fade: Fade, ) -> Result<MusicId>

Stop all this controller’s track voices, including earlier crossfade tails. Independently layered cues keep playing.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.