Mercurial > SDL_sound_CoreAudio
comparison SDL_sound_internal.h @ 42:2b63642fb6ff
Removed MULTIPLE_STREAMS_PER_RWOPS and added init() and quit() methods to
Sound_DecoderFunctions.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Sat, 22 Sep 2001 14:29:17 +0000 |
parents | eeb874083218 |
children | b13fafb976be |
comparison
equal
deleted
inserted
replaced
41:0d5ff5679523 | 42:2b63642fb6ff |
---|---|
43 | 43 |
44 typedef struct __SOUND_DECODERFUNCTIONS__ | 44 typedef struct __SOUND_DECODERFUNCTIONS__ |
45 { | 45 { |
46 /* This is a block of info about your decoder. See SDL_sound.h. */ | 46 /* This is a block of info about your decoder. See SDL_sound.h. */ |
47 const Sound_DecoderInfo info; | 47 const Sound_DecoderInfo info; |
48 | |
49 /* | |
50 * This is called during the Sound_Init() function. Use this to | |
51 * set up any global state that your decoder needs, such as | |
52 * initializing an external library, etc. | |
53 * | |
54 * Return non-zero if initialization is successful, zero if there's | |
55 * a fatal error. If this method fails, then this decoder is | |
56 * flagged as unavailable until SDL_sound() is shut down and | |
57 * reinitialized, in which case this method will be tried again. | |
58 * | |
59 * Note that the decoders quit() method won't be called if this | |
60 * method fails, so if you can't intialize, you'll have to clean | |
61 * up the half-initialized state in this method. | |
62 */ | |
63 int (*init)(void); | |
64 | |
65 /* | |
66 * This is called during the Sound_Quit() function. Use this to | |
67 * clean up any global state that your decoder has used during its | |
68 * lifespan. | |
69 */ | |
70 void (*quit)(void); | |
48 | 71 |
49 /* | 72 /* |
50 * Returns non-zero if (sample) has a valid fileformat that this | 73 * Returns non-zero if (sample) has a valid fileformat that this |
51 * driver can handle. Zero if this driver can NOT handle the data. | 74 * driver can handle. Zero if this driver can NOT handle the data. |
52 * | 75 * |
133 */ | 156 */ |
134 Uint32 (*read)(Sound_Sample *sample); | 157 Uint32 (*read)(Sound_Sample *sample); |
135 } Sound_DecoderFunctions; | 158 } Sound_DecoderFunctions; |
136 | 159 |
137 | 160 |
138 /* (for now. --ryan.) */ | |
139 #define MULTIPLE_STREAMS_PER_RWOPS 1 | |
140 | |
141 | |
142 | |
143 typedef struct __SOUND_SAMPLEINTERNAL__ | 161 typedef struct __SOUND_SAMPLEINTERNAL__ |
144 { | 162 { |
145 Sound_Sample *next; | 163 Sound_Sample *next; |
146 Sound_Sample *prev; | 164 Sound_Sample *prev; |
147 SDL_RWops *rw; | 165 SDL_RWops *rw; |
148 #if (defined MULTIPLE_STREAMS_PER_RWOPS) | |
149 int pos; /* !!! FIXME: Int? Really? */ | |
150 #endif | |
151 const Sound_DecoderFunctions *funcs; | 166 const Sound_DecoderFunctions *funcs; |
152 SDL_AudioCVT sdlcvt; | 167 SDL_AudioCVT sdlcvt; |
153 void *buffer; | 168 void *buffer; |
154 Uint32 buffer_size; | 169 Uint32 buffer_size; |
155 void *decoder_private; | 170 void *decoder_private; |