From e5a7db48026d0d392e1552cd13c119203bc27d31 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 13 Dec 2009 06:21:22 +0000 Subject: [PATCH] Name the audio callback for documentation clarity. --- include/SDL_audio.h | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/include/SDL_audio.h b/include/SDL_audio.h index ea11225e5..50a1326d4 100644 --- a/include/SDL_audio.h +++ b/include/SDL_audio.h @@ -152,6 +152,20 @@ typedef Uint16 SDL_AudioFormat; /*@}*//*Audio flags*/ +/** + * This function is called when the audio device needs more data. + * + * \param userdata An application-specific parameter saved in + * the SDL_AudioSpec structure + * \param stream A pointer to the audio data buffer. + * \param len The length of that buffer in bytes. + * + * Once the callback returns, the buffer will no longer be valid. + * Stereo samples are stored in a LRLRLR ordering. + */ +typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream, + int len); + /** * The calculated values in this structure are calculated by SDL_OpenAudio(). */ @@ -164,16 +178,7 @@ typedef struct SDL_AudioSpec Uint16 samples; /**< Audio buffer size in samples (power of 2) */ Uint16 padding; /**< Necessary for some compile environments */ Uint32 size; /**< Audio buffer size in bytes (calculated) */ - /** - * This function is called when the audio device needs more data. - * - * \param stream A pointer to the audio data buffer. - * \param len The length of that buffer in bytes. - * - * Once the callback returns, the buffer will no longer be valid. - * Stereo samples are stored in a LRLRLR ordering. - */ - void (SDLCALL * callback) (void *userdata, Uint8 * stream, int len); + SDL_AudioCallback callback; void *userdata; } SDL_AudioSpec;