.\" This manpage content is licensed under Creative Commons .\" Attribution 4.0 International (CC BY 4.0) .\" https://creativecommons.org/licenses/by/4.0/ .\" This manpage was generated from SDL_mixer's wiki page for Mix_HookMusicFinished: .\" https://wiki.libsdl.org/SDL_mixer/Mix_HookMusicFinished .\" Generated with SDL/build-scripts/wikiheaders.pl .\" revision 3~git20240319~12fb85e+ds-1 .\" Please report issues in this manpage's content at: .\" https://github.com/libsdl-org/sdlwiki/issues/new .\" Please report issues in the generation of this manpage from the wiki at: .\" https://github.com/libsdl-org/SDL/issues/new?title=Misgenerated%20manpage%20for%20Mix_HookMusicFinished .\" SDL_mixer can be found at https://libsdl.org/projects/SDL_mixer .de URL \$2 \(laURL: \$1 \(ra\$3 .. .if \n[.g] .mso www.tmac .TH Mix_HookMusicFinished 3 "SDL_mixer 3.0.0" "SDL_mixer" "SDL_mixer3 FUNCTIONS" .SH NAME Mix_HookMusicFinished \- Set a callback that runs when a music object has stopped playing\[char46] .SH SYNOPSIS .nf .B #include \(dqSDL3_mixer/SDL_mixer.h\(dq .PP .BI "void Mix_HookMusicFinished(void (SDLCALL *music_finished)(void)); .fi .SH DESCRIPTION This callback will fire when the currently-playing music has completed, or when it has been explicitly stopped from a call to .BR Mix_HaltMusic \[char46] As such, this callback might fire from an arbitrary background thread at almost any time; try to limit what you do here\[char46] It is legal to start a new music object playing in this callback (or restart the one that just stopped)\[char46] If the music finished normally, this can be used to loop the music without a gap in the audio playback\[char46] Do not call SDL_LockAudio() from this callback; you will either be inside the audio callback, or SDL_mixer will explicitly lock the audio before calling your callback\[char46] A NULL pointer will disable the callback\[char46] .SH FUNCTION PARAMETERS .TP .I music_finished the callback function to become the new notification mechanism\[char46] .SH AVAILABILITY This function is available since SDL_mixer 3\[char46]0\[char46]0\[char46]