[go: up one dir, main page]

pub struct Music<'a> {
    pub raw: *mut Mix_Music,
    pub owned: bool,
    /* private fields */
}
Expand description

This is an opaque data type used for Music data.

Fields

raw: *mut Mix_Musicowned: bool

Implementations

Load music file to use.

Load music from a static byte buffer.

The file format encoding of the music.

Play the loaded music loop times through from start to finish. Pass -1 to loop forever.

Fade in over ms milliseconds of time, the loaded music, playing it loop times through from start to finish.

Fade in over ms milliseconds of time, from position.

Returns current volume

Set the volume on a scale of 0 to 128. Values greater than 128 will use 128.

Pause the music playback.

Unpause the music.

Rewind the music to the start.

Set the position of the currently playing music.

Setup a command line music player to use to play music.

Halt playback of music.

Gradually fade out the music over ms milliseconds starting from now.

Sets up a function to be called when music playback is halted.

Examples
fn after_music() {
    println!("Music has ended");
}

sdl2::mixer::Music::hook_finished(after_music);

A previously set up function would no longer be called when music playback is halted.

If music is actively playing, or not.

If music is paused, or not.

If music is fading, or not.

Trait Implementations

Shows the original regular expression.

Executes the destructor for this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.