# HG changeset patch # User Ryan C. Gordon # Date 1001168957 0 # Node ID 2b63642fb6ffddcb2f7085fd5ecf6c750a2a1116 # Parent 0d5ff56795235e615884b6e9a16091b5304fde47 Removed MULTIPLE_STREAMS_PER_RWOPS and added init() and quit() methods to Sound_DecoderFunctions. diff -r 0d5ff5679523 -r 2b63642fb6ff SDL_sound_internal.h --- a/SDL_sound_internal.h Sat Sep 22 12:28:58 2001 +0000 +++ b/SDL_sound_internal.h Sat Sep 22 14:29:17 2001 +0000 @@ -47,6 +47,29 @@ const Sound_DecoderInfo info; /* + * This is called during the Sound_Init() function. Use this to + * set up any global state that your decoder needs, such as + * initializing an external library, etc. + * + * Return non-zero if initialization is successful, zero if there's + * a fatal error. If this method fails, then this decoder is + * flagged as unavailable until SDL_sound() is shut down and + * reinitialized, in which case this method will be tried again. + * + * Note that the decoders quit() method won't be called if this + * method fails, so if you can't intialize, you'll have to clean + * up the half-initialized state in this method. + */ + int (*init)(void); + + /* + * This is called during the Sound_Quit() function. Use this to + * clean up any global state that your decoder has used during its + * lifespan. + */ + void (*quit)(void); + + /* * Returns non-zero if (sample) has a valid fileformat that this * driver can handle. Zero if this driver can NOT handle the data. * @@ -135,19 +158,11 @@ } Sound_DecoderFunctions; -/* (for now. --ryan.) */ -#define MULTIPLE_STREAMS_PER_RWOPS 1 - - - typedef struct __SOUND_SAMPLEINTERNAL__ { Sound_Sample *next; Sound_Sample *prev; SDL_RWops *rw; -#if (defined MULTIPLE_STREAMS_PER_RWOPS) - int pos; /* !!! FIXME: Int? Really? */ -#endif const Sound_DecoderFunctions *funcs; SDL_AudioCVT sdlcvt; void *buffer;