MIX_GetTrackFadeFrames(3)
β¨ NAME β¨
MIX_GetTrackFadeFrames</b> β it's giving "is this track fading rn??" π
This page lives in the SDL_mixer3 FUNCTIONS section of the manual, bestie, so if you were looking for it there: found it. π«Ά
πΈ SYNOPSIS πΈ
#include <SDL3_mixer/SDL_mixer.h>
Sint64 MIX_GetTrackFadeFrames(MIX_Track *track);
π DESCRIPTION π
Okay so here's the tea: this function very specifically checks that the track is _not stopped_ (so it's either paused or playing β ), and that it's currently fading in or fading out, and then it hands you back the number of frames still left in that fade. Literally the countdown to the end of the fade. β³β¨
- If it's fading out, the value you get back will be negative. π
- If it's fading in, the value you get back will be positive. π
- If it's not fading at all, this function returns zero. π
π¨ And now the part nobody likes: on various errors (MIX_Init()was not called, the track isNULL), this also returns0. There is no mechanism to distinguish errors from tracks that aren't fading. So a zero could be "chill, no fade happening" or "everything is on fire" and the API is not about to tell you which. Bestie. π Not me having to warn you about this.
π FUNCTION PARAMETERS π
trackβ the track you wanna query, queen. π
π¦ RETURN VALUE π¦
- less than
0β the track is fading out π - greater than
0β the track is fading in π 0β otherwise, i.e. not fading (or an error, see above, iykyk π)
π THREAD SAFETY π
It is safe to call this function from any thread. Slay. No locking drama, no anxiety, just vibes. β¨
π AVAILABILITY π
This function is available since SDL_mixer 3.0.0. So if you're on something ancient, this is not your era, bestie. π°οΈ
k bye, that's the whole page π this was written for SDL_mixer 3.2.4, and the manual section is MIX_GetTrackFadeFrames(3) β mwah, go query your fades, main character π
π
π¦ where this page comes from
- fedora 44: SDL3_mixer-doc 3.2.4-3.fc44 Β· Zlib AND (GPL-2.0-or-later OR LGPL-2.0-or-later)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms