MIX_TagTrack(3)

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

πŸ’– MIX_TagTrack(3) πŸ’–

okay bestie, welcome to the SDL_mixer3 girlies' corner of the manual ✨ this one lives in the SDL_mixer3 FUNCTIONS section and it's literally so cute, let's go πŸŽ€


✨ NAME ✨

MIX_TagTrack β€” slap an arbitrary tag onto a track, no cap 🏷️


🌸 SYNOPSIS 🌸

#include <SDL3_mixer/SDL_mixer.h>

bool MIX_TagTrack(MIX_Track *track, const char *tag);

πŸ¦‹ DESCRIPTION πŸ¦‹

ok so a tag can be any valid C string in UTF-8 encoding. that's it. that's the rule πŸ’…

and like… why would you even want that? because grouping tracks is lowkey iconic, that's why. picture this: everything in-game gets tagged "game", and then when the user pops open the settings menu, your app can pause every single track involved in gameplay all at once β€” while background music and menu sound effects just keep vibing 🎢✨ main character energy fr fr.

a track can have as many tags as desired, until the machine runs out of memory 😭 (we don't talk about that part).

it's also totally legal to add the same tag to a track more than once 🫢 the extra attempts will report success but won't actually change anything. so like, no harm, no foul, no drama.

and when you're done with a tag? tags can later be removed with MIX_UntagTrack() 🧹✨


πŸ’œ FUNCTION PARAMETERS πŸ’œ

  • track β€” the track you're adding a tag to 🎯
  • tag β€” the tag you're adding 🏷️

⭐ RETURN VALUE ⭐

returns true on success, false on error 😭 and if it's an error you gotta call SDL_GetError() for the details, iykyk πŸ‘‘


πŸ”₯ THREAD SAFETY πŸ”₯

it is safe to call this function from any thread. go off, multithreaded queen πŸ‘‘βœ¨


🌈 AVAILABILITY 🌈

this function is available since SDL_mixer 3.0.0 πŸ’– so if you're on anything older… bestie. upgrade. πŸ™ˆ


πŸŽ€ SEE ALSO πŸŽ€


and that's the whole page, periodt πŸ’… this masterpiece was brought to you by SDL_mixer 3.2.4 β€” mwah, love u, go tag some tracks πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from