mixSetSoundFonts function

bool mixSetSoundFonts(
  1. String? paths
)

Set SoundFonts paths to use by supported MIDI backends.

You may specify multiple paths in a single string by separating them with semicolons; they will be searched in the order listed.

This function replaces any previously-specified paths.

Passing a NULL path will remove any previously-specified paths.

Note that unlike most SDL and SDL_mixer functions, this function returns zero if there's an error, not on success. We apologize for the API design inconsistency here.

\param paths Paths on the filesystem where SoundFonts are available, separated by semicolons. \returns true on success or false on failure; call SDL_GetError() for more information.

\since This function is available since SDL_mixer 3.0.0.

extern SDL_DECLSPEC bool SDLCALL Mix_SetSoundFonts(const char *paths)

Implementation

bool mixSetSoundFonts(String? paths) {
  final mixSetSoundFontsLookupFunction = libSdl3Mixer.lookupFunction<
      Uint8 Function(Pointer<Utf8> paths),
      int Function(Pointer<Utf8> paths)>('Mix_SetSoundFonts');
  final pathsPointer = paths != null ? paths.toNativeUtf8() : nullptr;
  final result = mixSetSoundFontsLookupFunction(pathsPointer) == 1;
  calloc.free(pathsPointer);
  return result;
}