MIX_TrackPlaying(3)

πŸ“¦
version 3.2.4 Β· 2 versions
, in fedora 44

πŸ’– MIX_TrackPlaying(3) β€” from the SDL_mixer3 FUNCTIONS era ✨

okay bestie, welcome to the manual page for MIX_TrackPlaying, a little semicolon-adjacent baddie in section 3 of the SDL_mixer3 docs. it's giving "one function, one job, zero drama." let's get into it 🫢


🌸 NAME 🌸

MIX_TrackPlaying β€” ask the universe (well, the mixer) whether a track is currently playing πŸ‘‘


✨ SYNOPSIS ✨

#include <SDL3_mixer/SDL_mixer.h>

bool MIX_TrackPlaying(MIX_Track *track);

πŸ’… DESCRIPTION πŸ’…

so if this returns true, the track is actively contributing to the mixer's output β€” it is, in the most literal sense, "playing" πŸ”₯ it is not stopped, and it is not paused. main character energy, no notes.

⚠️ but listen β€” on various errors (like MIX_Init() was not called, or the track is NULL), this returns false too. and there is no mechanism to distinguish errors from non-playing tracks. so a false is lowkey ambiguous, and you just have to live with that. it's fine. everything's fine. 😭

πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • track β€” the track you wanna query. that's the one. the it-girl in question. 🌈

⭐ RETURN VALUE ⭐

Returns true if playing, false otherwise. that's it, that's the arc. πŸ’–


πŸ¦‹ THREAD SAFETY πŸ¦‹

It is safe to call this function from any thread ✨ no cap, go wild, all your threads can ask at once, she doesn't mind. πŸ’œ


🌸 AVAILABILITY 🌸

This function is available since SDL_mixer 3.0.0. so if you're on anything older... bestie, no. πŸ“…


🫢 SEE ALSO 🫢

the whole friend group, fr fr:


aaaaand that's the page!! this was written for SDL_mixer 3.2.4 and lives in the SDL_mixer corner of the manual, so if you ever forget where you read it: it was here, with me, and it slayed πŸ’…πŸŽ€ bye bestie, go query a track 🧚

πŸ“¦ where this page comes from