SDL_image 1.2.4: Mix_GetMusicType

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

### 4.5.16 Mix_GetMusicType

`Mix_MusicType Mix_GetMusicType(const Mix_Music *music)`

music
  The music to get the type of.
  NULL will get the currently playing music type.

Tells you the file format encoding of the music. This may be handy when used with `Mix_SetMusicPosition`, and other music functions that vary based on the type of music being played. If you want to know the type of music currently being played, pass in NULL to music.

Returns: The type of music or if music is NULL then the currently playing music type, otherwise MUS_NONE if no music is playing.

    // print the type of music currently playing
    switch(Mix_GetMusicType(NULL))
    {
        case MUS_NONE:
        MUS_CMD:
            printf("Command based music is playing.\n");
            break;
        MUS_WAV:
            printf("WAVE/RIFF music is playing.\n");
            break;
        MUS_MOD:
            printf("MOD music is playing.\n");
            break;
        MUS_MID:
            printf("MIDI music is playing.\n");
            break;
        MUS_OGG:
            printf("OGG music is playing.\n");
            break;
        MUS_MP3:
            printf("MP3 music is playing.\n");
            break;
        default:
            printf("Unknown music is playing.\n");
            break;
    }

See Also:
5.3 Mix_MusicType, 4.6.7 Mix_SetPosition

This document was generated on November, 1 2002 using texi2html