MIX_SetTrackGroup(3)

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

πŸ’– MIX_SetTrackGroup(3) πŸ’–

okay bestie, welcome to the SDL_mixer3 girlies' corner of the manual πŸ’… this one's MIX_SetTrackGroup and honestly? she's a baddie with ONE job and she does it flawlessly. no notes.


✨ NAME ✨

MIX_SetTrackGroup β€” assign a track to a mixing group πŸŽ€


✨ SYNOPSIS ✨

#include <SDL3_mixer/SDL_mixer.h>

bool MIX_SetTrackGroup(MIX_Track *track, MIX_Group *group);

✨ DESCRIPTION ✨

okay so here's the tea πŸ“ every track in a group gets mixed together, and that combined output is handed to your app before it gets mixed into the final output. it's like the group has its own lil pre-party before the main party πŸŽ‰ so your app gets first dibs on that group's blend. iconic behavior, honestly.

ngl there are strict rules tho:

  • a track can only be in one group at a time. no polyamory for tracks. periodt πŸ’€
  • the track and the group must have been created on the same MIX_Mixer. mismatched mixer parents = not it.

and here's the lil glow-up move ✨: setting a track's group to a NULL group yanks it out of any app-created groups and reassigns it to the mixer's internal default group. it's giving "returning to your roots" 🌸 she's back home, safe and sound.


🫢 FUNCTION PARAMETERS 🫢

  • track β€” the track you're giving a group assignment to. this is the main character πŸ’…
  • group β€” the new mixing group you're assigning it to. may be NULL (and as we just said, NULL = back to the default group vibe).

⭐ RETURN VALUE ⭐

returns true on success or false on failure 😭 and if it flops, call SDL_GetError() for more info β€” she'll tell you exactly what went wrong, no gatekeeping.


🧚 THREAD SAFETY 🧚

it is safe to call this function from any thread πŸ¦‹ yes queen, thread-safe, go wild, no cap.


🌸 AVAILABILITY 🌸

this function is available since SDL_mixer 3.0.0. she's been here, she's a veteran, respect her πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page bestie, you ate it up πŸ”₯ this has been SDL_mixer version 3.2.4, straight from the SDL_mixer source, mwah πŸ’– k bye βœ¨πŸŽ€πŸŒˆ

πŸ“¦ where this page comes from