# HG changeset patch # User Sam Lantinga # Date 1260685282 0 # Node ID cf815007e443df7cfb7f4575f68cf27602bf5a92 # Parent a579694613fdaa4fdb1a5b85abf6e5fe0cfb1424 Name the audio callback for documentation clarity. diff -r a579694613fd -r cf815007e443 include/SDL_audio.h --- a/include/SDL_audio.h Sun Dec 13 06:19:32 2009 +0000 +++ b/include/SDL_audio.h Sun Dec 13 06:21:22 2009 +0000 @@ -153,6 +153,20 @@ /*@}*//*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(). */ typedef struct SDL_AudioSpec @@ -164,16 +178,7 @@ 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;