MIX_PlayTag(3)

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

πŸ’– MIX_PlayTag(3) πŸ’–

okay bestie, welcome to the MIX_PlayTag(3) page from the SDL_mixer3 FUNCTIONS manual, aka the vibe check you didn't know you needed 🌸

✨ NAME ✨

MIX_PlayTag β€” start (or restart) mixing all the tracks that rock a specific tag, for playback πŸ’…

πŸŽ€ SYNOPSIS πŸŽ€

#include <SDL3_mixer/SDL_mixer.h>

bool MIX_PlayTag(MIX_Mixer *mixer, const char *tag, SDL_PropertiesID options);

πŸ¦‹ DESCRIPTION πŸ¦‹

so this one is literally the group-chat version of MIX_PlayTrack() β€” it follows all the same rules as that function, no cap. please go read its documentation for the deets, fr fr. the difference? MIX_PlayTrack() deals with one track, and MIX_PlayTag() is out here handling multiple tracks at once, all the ones that have the specified tag applied, via MIX_TagTrack(). icon behaviour, honestly πŸ‘‘

if all your tagged tracks have different sample rates, it would make sense to use the *_MILLISECONDS_NUMBER properties in your options, instead of *_FRAMES_NUMBER, and just let SDL_mixer figure out how to apply it to each track. she's smart like that, let her cook πŸ“

this function returns true if all tagged tracks are started (or restarted). if any track fails, this function returns false β€” but bestie, listen, all the tracks that could start will still be started even when this function reports failure. not me being honest about the partial slay 😭

and from the point of view of the mixing process, all tracks that successfully (re)start will do so at the exact same moment. synchronized queens, every single one 🌈

πŸ’œ FUNCTION PARAMETERS πŸ’œ

  • mixer β€” the mixer on which to look for tagged tracks, iykyk πŸ”
  • tag β€” the tag to use when searching for tracks, the little label that says "yes, her" πŸŽ€
  • options β€” the set of options that will be applied to each track ✨

🌟 RETURN VALUE 🌟

returns true on success, false on error β€” and if it's erroring, call SDL_GetError() for the details, she'll spill the tea πŸ’€

🧚 THREAD SAFETY 🧚

it is safe to call this function from any thread. multitasking main character energy, periodt πŸ’…

⭐ AVAILABILITY ⭐

this function is available since SDL_mixer 3.0.0. vintage but still iconic 🫢

πŸ‘‘ SEE ALSO πŸ‘‘


aaaaand that's the page, bestie!! this whole thing came to you courtesy of SDL_mixer 3.2.4 🌸 go forth and play those tagged tracks, you absolute legend β€” mwah πŸ’–βœ¨

πŸ“¦ where this page comes from