mixSetTrackLoops function mixer

bool mixSetTrackLoops(
  1. Pointer<MixTrack> track,
  2. int numLoops
)

Change the number of times a currently-playing track will loop.

This replaces any previously-set remaining loops. A value of 1 will loop to the start of playback one time. Zero will not loop at all. A value of -1 requests infinite loops. If the input is not seekable and num_loops isn't zero, this function will report success but the track will stop at the point it should loop.

The new loop count replaces any previous state, even if the track has already looped.

This has no effect on a track that is stopped, or rather, starting a stopped track later will set a new loop count, replacing this value. Stopped tracks can specify a loop count while starting via MIX_PROP_PLAY_LOOPS_NUMBER. This function is intended to alter that count in the middle of playback.

\param track the track to configure. \param num_loops new number of times to loop. Zero to disable looping, -1 to loop infinitely. \returns true on success, false on error; call SDL_GetError() for details.

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

\since This function is available since SDL_mixer 3.0.0.

\sa MIX_GetTrackLoops

extern SDL_DECLSPEC bool SDLCALL MIX_SetTrackLoops(MIX_Track *track, int num_loops)

Implementation

bool mixSetTrackLoops(Pointer<MixTrack> track, int numLoops) {
  final mixSetTrackLoopsLookupFunction = _libMixer
      .lookupFunction<
        Uint8 Function(Pointer<MixTrack> track, Int32 numLoops),
        int Function(Pointer<MixTrack> track, int numLoops)
      >('MIX_SetTrackLoops');
  return mixSetTrackLoopsLookupFunction(track, numLoops) == 1;
}