[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.5.13 Mix_SetMusicPosition

int Mix_SetMusicPosition(double position)

position
Posistion to play from.

Set the position of the currently playing music. The position takes different meanings for different music sources. It only works on the music sources listed below.

MOD
The double is cast to Uint16 and used for a pattern number in the module.
Passing zero is similar to rewinding the song.
OGG
Jumps to position seconds from the beginning of the song.
MP3
Jumps to position seconds from the current position in the stream.
So you may want to call Mix_RewindMusic before this.
Does not go in reverse...negative values do nothing.

Returns: 0 on success, or -1 if the codec doesn't support this function.

 
// skip one minute into the song, from the start
// this assumes you are playing an MP3
Mix_RewindMusic();
if(Mix_SetMusicPosition(60.0)==-1) {
    printf("Mix_SetMusicPosition: %s\n", Mix_GetError());
}

See Also:
4.5.7 Mix_FadeInMusicPos



This document was generated on November, 13 2009 using texi2html