comparison SDL_sound_internal.h @ 12:2888101dcf98

Added _D(()) macro, decoder_private field, and changed read() method from returning an (int) to returning a (Uint32).
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 18 Sep 2001 11:00:31 +0000
parents 341cea3e13c6
children eeb874083218
comparison
equal deleted inserted replaced
11:5ff1dce70aec 12:2888101dcf98
32 #ifndef __SDL_SOUND_INTERNAL__ 32 #ifndef __SDL_SOUND_INTERNAL__
33 #error Do not include this header from your applications. 33 #error Do not include this header from your applications.
34 #endif 34 #endif
35 35
36 #include "SDL.h" 36 #include "SDL.h"
37
38 #if (defined DEBUG_CHATTER)
39 #define _D(x) printf x
40 #else
41 #define _D(x)
42 #endif
37 43
38 typedef struct __SOUND_DECODERFUNCTIONS__ 44 typedef struct __SOUND_DECODERFUNCTIONS__
39 { 45 {
40 /* 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. */
41 const Sound_DecoderInfo info; 47 const Sound_DecoderInfo info;
66 * SDL_RWops *rw; (can use, but do NOT close it) 72 * SDL_RWops *rw; (can use, but do NOT close it)
67 * const Sound_DecoderFunctions *funcs; (that's this structure) 73 * const Sound_DecoderFunctions *funcs; (that's this structure)
68 * SDL_AudioCVT sdlcvt; (offlimits) 74 * SDL_AudioCVT sdlcvt; (offlimits)
69 * void *buffer; (offlimits until read() method) 75 * void *buffer; (offlimits until read() method)
70 * Uint32 buffer_size; (offlimits until read() method) 76 * Uint32 buffer_size; (offlimits until read() method)
77 * void *decoder_private; (read and write access)
71 * 78 *
72 * in rest of Sound_Sample: 79 * in rest of Sound_Sample:
73 * void *opaque; (this was internal section, above) 80 * void *opaque; (this was internal section, above)
74 * const Sound_DecoderInfo *decoder; (read only) 81 * const Sound_DecoderInfo *decoder; (read only)
75 * Sound_AudioInfo desired; (read only, usually not needed here) 82 * Sound_AudioInfo desired; (read only, usually not needed here)
122 * SDL_sound will not call your read() method for any samples with 129 * SDL_sound will not call your read() method for any samples with
123 * SOUND_SAMPLEFLAG_EOF or SOUND_SAMPLEFLAG_ERROR set. The 130 * SOUND_SAMPLEFLAG_EOF or SOUND_SAMPLEFLAG_ERROR set. The
124 * SOUND_SAMPLEFLAG_EAGAIN flag is reset before each call to this 131 * SOUND_SAMPLEFLAG_EAGAIN flag is reset before each call to this
125 * method. 132 * method.
126 */ 133 */
127 int (*read)(Sound_Sample *sample); 134 Uint32 (*read)(Sound_Sample *sample);
128 } Sound_DecoderFunctions; 135 } Sound_DecoderFunctions;
129 136
130 137
131 typedef struct __SOUND_SAMPLEINTERNAL__ 138 typedef struct __SOUND_SAMPLEINTERNAL__
132 { 139 {
135 SDL_RWops *rw; 142 SDL_RWops *rw;
136 const Sound_DecoderFunctions *funcs; 143 const Sound_DecoderFunctions *funcs;
137 SDL_AudioCVT sdlcvt; 144 SDL_AudioCVT sdlcvt;
138 void *buffer; 145 void *buffer;
139 Uint32 buffer_size; 146 Uint32 buffer_size;
147 void *decoder_private;
140 } Sound_SampleInternal; 148 } Sound_SampleInternal;
141 149
142 150
143 151
144 /* error messages... */ 152 /* error messages... */