Mercurial > sdl-ios-xcode
changeset 3554:cf815007e443
Name the audio callback for documentation clarity.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 13 Dec 2009 06:21:22 +0000 |
parents | a579694613fd |
children | 7549b986ccb1 |
files | include/SDL_audio.h |
diffstat | 1 files changed, 15 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- 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;