Skip to content

Commit 7baa66f

Browse files
committed
Updated for latest wikiheaders.
1 parent 59caf94 commit 7baa66f

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

.wikiheaders-options

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ wikiurl = https://wiki.libsdl.org/SDL_mixer
1414
bugreporturl = https://github.com/libsdl-org/sdlwiki/issues/new
1515
warn_about_missing = 0
1616
wikipreamble = (This function is part of SDL_mixer, a separate library from SDL.)
17+
wikiheaderfiletext = Defined in [<%fname%>](https://github.com/libsdl-org/SDL_mixer/blob/SDL2/include/%fname%)
18+
manpageheaderfiletext = Defined in %fname%

include/SDL_mixer.h

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,8 @@ extern DECLSPEC const char *SDLCALL Mix_GetMusicAlbumTag(const Mix_Music *music)
11161116
*/
11171117
extern DECLSPEC const char *SDLCALL Mix_GetMusicCopyrightTag(const Mix_Music *music);
11181118

1119+
typedef void (SDLCALL *Mix_MixCallback)(void *udata, Uint8 *stream, int len);
1120+
11191121
/**
11201122
* Set a function that is called after all mixing is performed.
11211123
*
@@ -1152,7 +1154,7 @@ extern DECLSPEC const char *SDLCALL Mix_GetMusicCopyrightTag(const Mix_Music *mu
11521154
*
11531155
* \sa Mix_HookMusic
11541156
*/
1155-
extern DECLSPEC void SDLCALL Mix_SetPostMix(void (SDLCALL *mix_func)(void *udata, Uint8 *stream, int len), void *arg);
1157+
extern DECLSPEC void SDLCALL Mix_SetPostMix(Mix_MixCallback mix_func, void *arg);
11561158

11571159
/**
11581160
* Add your own music player or additional mixer function.
@@ -1198,7 +1200,9 @@ extern DECLSPEC void SDLCALL Mix_SetPostMix(void (SDLCALL *mix_func)(void *udata
11981200
*
11991201
* \sa Mix_SetPostMix
12001202
*/
1201-
extern DECLSPEC void SDLCALL Mix_HookMusic(void (SDLCALL *mix_func)(void *udata, Uint8 *stream, int len), void *arg);
1203+
extern DECLSPEC void SDLCALL Mix_HookMusic(Mix_MixCallback mix_func, void *arg);
1204+
1205+
typedef void (SDLCALL *Mix_MusicFinishedCallback)(void);
12021206

12031207
/**
12041208
* Set a callback that runs when a music object has stopped playing.
@@ -1223,7 +1227,7 @@ extern DECLSPEC void SDLCALL Mix_HookMusic(void (SDLCALL *mix_func)(void *udata,
12231227
*
12241228
* \since This function is available since SDL_mixer 2.0.0.
12251229
*/
1226-
extern DECLSPEC void SDLCALL Mix_HookMusicFinished(void (SDLCALL *music_finished)(void));
1230+
extern DECLSPEC void SDLCALL Mix_HookMusicFinished(Mix_MusicFinishedCallback music_finished);
12271231

12281232
/**
12291233
* Get a pointer to the user data for the current music hook.
@@ -1237,6 +1241,8 @@ extern DECLSPEC void SDLCALL Mix_HookMusicFinished(void (SDLCALL *music_finished
12371241
*/
12381242
extern DECLSPEC void * SDLCALL Mix_GetMusicHookData(void);
12391243

1244+
typedef void (SDLCALL *Mix_ChannelFinishedCallback)(int channel);
1245+
12401246
/**
12411247
* Set a callback that runs when a channel has finished playing.
12421248
*
@@ -1257,7 +1263,7 @@ extern DECLSPEC void * SDLCALL Mix_GetMusicHookData(void);
12571263
*
12581264
* \since This function is available since SDL_mixer 2.0.0.
12591265
*/
1260-
extern DECLSPEC void SDLCALL Mix_ChannelFinished(void (SDLCALL *channel_finished)(int channel));
1266+
extern DECLSPEC void SDLCALL Mix_ChannelFinished(Mix_ChannelFinishedCallback channel_finished);
12611267

12621268

12631269
#define MIX_CHANNEL_POST (-2)
@@ -2672,6 +2678,8 @@ extern DECLSPEC int SDLCALL Mix_SetSoundFonts(const char *paths);
26722678
*/
26732679
extern DECLSPEC const char* SDLCALL Mix_GetSoundFonts(void);
26742680

2681+
typedef int (SDLCALL *Mix_EachSoundFontCallback)(const char*, void*);
2682+
26752683
/**
26762684
* Iterate SoundFonts paths to use by supported MIDI backends.
26772685
*
@@ -2697,7 +2705,7 @@ extern DECLSPEC const char* SDLCALL Mix_GetSoundFonts(void);
26972705
*
26982706
* \sa Mix_GetSoundFonts
26992707
*/
2700-
extern DECLSPEC int SDLCALL Mix_EachSoundFont(int (SDLCALL *function)(const char*, void*), void *data);
2708+
extern DECLSPEC int SDLCALL Mix_EachSoundFont(Mix_EachSoundFontCallback function, void *data);
27012709

27022710
/**
27032711
* Set full path of the Timidity config file.

src/mixer.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ static int reserved_channels = 0;
9696

9797

9898
/* Support for hooking into the mixer callback system */
99-
static void (SDLCALL *mix_postmix)(void *udata, Uint8 *stream, int len) = NULL;
99+
static Mix_MixCallback mix_postmix = NULL;
100100
static void *mix_postmix_data = NULL;
101101

102102
/* rcg07062001 callback to alert when channels are done playing. */
103-
static void (SDLCALL *channel_done_callback)(int channel) = NULL;
103+
static Mix_ChannelFinishedCallback channel_done_callback = NULL;
104104

105105
/* Support for user defined music functions */
106-
static void (SDLCALL *mix_music)(void *udata, Uint8 *stream, int len) = music_mixer;
106+
static Mix_MixCallback mix_music = music_mixer;
107107
static void *music_data = NULL;
108108

109109
/* rcg06042009 report available decoders at runtime. */
@@ -1006,8 +1006,7 @@ void Mix_FreeChunk(Mix_Chunk *chunk)
10061006
This can be used to provide real-time visual display of the audio stream
10071007
or add a custom mixer filter for the stream data.
10081008
*/
1009-
void Mix_SetPostMix(void (SDLCALL *mix_func)
1010-
(void *udata, Uint8 *stream, int len), void *arg)
1009+
void Mix_SetPostMix(Mix_MixCallback mix_func, void *arg)
10111010
{
10121011
Mix_LockAudio();
10131012
mix_postmix_data = arg;
@@ -1018,8 +1017,7 @@ void Mix_SetPostMix(void (SDLCALL *mix_func)
10181017
/* Add your own music player or mixer function.
10191018
If 'mix_func' is NULL, the default music player is re-enabled.
10201019
*/
1021-
void Mix_HookMusic(void (SDLCALL *mix_func)(void *udata, Uint8 *stream, int len),
1022-
void *arg)
1020+
void Mix_HookMusic(Mix_MixCallback mix_func, void *arg)
10231021
{
10241022
Mix_LockAudio();
10251023
if (mix_func != NULL) {
@@ -1037,7 +1035,7 @@ void *Mix_GetMusicHookData(void)
10371035
return music_data;
10381036
}
10391037

1040-
void Mix_ChannelFinished(void (SDLCALL *channel_finished)(int channel))
1038+
void Mix_ChannelFinished(Mix_ChannelFinishedCallback channel_finished)
10411039
{
10421040
Mix_LockAudio();
10431041
channel_done_callback = channel_finished;

src/music.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,7 @@ const char* Mix_GetSoundFonts(void)
15441544
return NULL;
15451545
}
15461546

1547-
int Mix_EachSoundFont(int (SDLCALL *function)(const char*, void*), void *data)
1547+
int Mix_EachSoundFont(Mix_EachSoundFontCallback function, void *data)
15481548
{
15491549
char *context, *path, *paths;
15501550
const char* cpaths = Mix_GetSoundFonts();

0 commit comments

Comments
 (0)