mixGetTaggedTracks function mixer

Pointer<Pointer<MixTrack>> mixGetTaggedTracks(
  1. Pointer<MixMixer> mixer,
  2. String? tag,
  3. Pointer<Int32> count
)

Get all tracks with a specific tag.

Tracks are not provided in any guaranteed order.

\param mixer the mixer to query. \param tag the tag to search. \param count a pointer filled in with the number of tracks returned, can be NULL. \returns an array of the tracks, NULL-terminated, or NULL on failure; call SDL_GetError() for more information. The returned pointer should be freed with SDL_free() when it is no longer needed.

\threadsafety It is safe to call this function from any thread.

\since This function is available since SDL_mixer 3.0.0.

extern SDL_DECLSPEC MIX_Track ** SDLCALL MIX_GetTaggedTracks(MIX_Mixer *mixer, const char *tag, int *count)

Implementation

Pointer<Pointer<MixTrack>> mixGetTaggedTracks(
  Pointer<MixMixer> mixer,
  String? tag,
  Pointer<Int32> count,
) {
  final mixGetTaggedTracksLookupFunction = _libMixer
      .lookupFunction<
        Pointer<Pointer<MixTrack>> Function(
          Pointer<MixMixer> mixer,
          Pointer<Utf8> tag,
          Pointer<Int32> count,
        ),
        Pointer<Pointer<MixTrack>> Function(
          Pointer<MixMixer> mixer,
          Pointer<Utf8> tag,
          Pointer<Int32> count,
        )
      >('MIX_GetTaggedTracks');
  final tagPointer = tag != null ? tag.toNativeUtf8() : nullptr;
  final result = mixGetTaggedTracksLookupFunction(mixer, tagPointer, count);
  calloc.free(tagPointer);
  return result;
}