mixGetMusicDecoder function

String? mixGetMusicDecoder(
  1. int index
)

Get a music decoder's name.

The requested decoder's index must be between zero and Mix_GetNumMusicDecoders()-1. It's safe to call this with an invalid index; this function will return NULL in that case.

This list can change between builds AND runs of the program, if external libraries that add functionality become available. You must successfully call Mix_OpenAudio() before calling this function, as decoders are activated at device open time.

\param index index of the music decoder. \returns the music decoder's name.

\since This function is available since SDL_mixer 3.0.0.

\sa Mix_GetNumMusicDecoders

extern SDL_DECLSPEC const char * SDLCALL Mix_GetMusicDecoder(int index)

Implementation

String? mixGetMusicDecoder(int index) {
  final mixGetMusicDecoderLookupFunction = libSdl3Mixer.lookupFunction<
      Pointer<Utf8> Function(Int32 index),
      Pointer<Utf8> Function(int index)>('Mix_GetMusicDecoder');
  final result = mixGetMusicDecoderLookupFunction(index);
  if (result == nullptr) {
    return null;
  }
  return result.toDartString();
}