mixGetTrackPlaybackPosition function mixer

int mixGetTrackPlaybackPosition(
  1. Pointer<MixTrack> track
)

Get the current input position of a playing track.

(Not to be confused with MIX_GetTrack3DPosition(), which is positioning of the track in 3D space, not the playback position of its audio data.)

Position is defined in sample frames of decoded audio, not units of time, so that sample-perfect mixing can be achieved. To instead operate in units of time, use MIX_TrackFramesToMS() to convert the return value to milliseconds.

Stopped and paused tracks will report the position when they halted. Playing tracks will report the current position, which will change over time.

\param track the track to change. \returns the track's current sample frame position, or -1 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_SetTrackPlaybackPosition

extern SDL_DECLSPEC Sint64 SDLCALL MIX_GetTrackPlaybackPosition(MIX_Track *track)

Implementation

int mixGetTrackPlaybackPosition(Pointer<MixTrack> track) {
  final mixGetTrackPlaybackPositionLookupFunction = _libMixer
      .lookupFunction<
        Int64 Function(Pointer<MixTrack> track),
        int Function(Pointer<MixTrack> track)
      >('MIX_GetTrackPlaybackPosition');
  return mixGetTrackPlaybackPositionLookupFunction(track);
}