Struct sdl2_mixer::Music [] [src]

pub struct Music {
    pub raw: *mut c_void,
    pub owned: bool,
}

This is an opaque data type used for Music data.

Fields

Methods

impl Music
[src]

Load music file to use.

The file format encoding of the music.

Play the loaded music loop times through from start to finish.

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

impl PartialEq for Music
[src]

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

This method tests for !=.

impl Drop for Music
[src]

A method called when the value goes out of scope. Read more

impl Debug for Music
[src]

Shows the original regular expression.