comparison src/audio/mint/SDL_mintaudio_gsxb.c @ 2043:adf732f1f016

Formatting update
author Sam Lantinga <slouken@libsdl.org>
date Sun, 24 Sep 2006 15:56:55 +0000
parents d48ead2d2ba5
children 8d5d119b1640
comparison
equal deleted inserted replaced
2042:3908e1f808e1 2043:adf732f1f016
221 DEBUG_PRINT(("big endian=%d, ", format_bigendian)); 221 DEBUG_PRINT(("big endian=%d, ", format_bigendian));
222 DEBUG_PRINT(("channels=%d, ", spec->channels)); 222 DEBUG_PRINT(("channels=%d, ", spec->channels));
223 DEBUG_PRINT(("freq=%d\n", spec->freq)); 223 DEBUG_PRINT(("freq=%d\n", spec->freq));
224 224
225 if (spec->channels > 2) { 225 if (spec->channels > 2) {
226 spec->channels = 2; /* no more than stereo! */ 226 spec->channels = 2; /* no more than stereo! */
227 } 227 }
228 228
229 while ((!valid_datatype) && (test_format)) { 229 while ((!valid_datatype) && (test_format)) {
230 spec->format = test_format; 230 spec->format = test_format;
231 switch (test_format) { 231 switch (test_format) {
232 case AUDIO_U8: 232 case AUDIO_U8:
233 case AUDIO_S8: 233 case AUDIO_S8:
234 case AUDIO_U16LSB: 234 case AUDIO_U16LSB:
235 case AUDIO_S16LSB: 235 case AUDIO_S16LSB:
236 case AUDIO_U16MSB: 236 case AUDIO_U16MSB:
237 case AUDIO_S16MSB: 237 case AUDIO_S16MSB:
238 case AUDIO_S32LSB: 238 case AUDIO_S32LSB:
239 case AUDIO_S32MSB: 239 case AUDIO_S32MSB:
240 /* no float support... */ 240 /* no float support... */
241 resolution = SDL_AUDIO_BITSIZE(spec->format); 241 resolution = SDL_AUDIO_BITSIZE(spec->format);
242 format_signed = SDL_AUDIO_ISSIGNED(spec->format); 242 format_signed = SDL_AUDIO_ISSIGNED(spec->format);
243 format_bigendian = SDL_AUDIO_ISBIGENDIAN(spec->format); 243 format_bigendian = SDL_AUDIO_ISBIGENDIAN(spec->format);
244 244
245 /* Check formats available */ 245 /* Check formats available */
246 snd_format = Sndstatus(SND_QUERYFORMATS); 246 snd_format = Sndstatus(SND_QUERYFORMATS);
247 switch (resolution) { 247 switch (resolution) {
248 case 8: 248 case 8:
249 if (snd_format & SND_FORMAT8) { 249 if (snd_format & SND_FORMAT8) {
250 valid_datatype = 1; 250 valid_datatype = 1;
251 snd_format = Sndstatus(SND_QUERY8BIT); 251 snd_format = Sndstatus(SND_QUERY8BIT);
252 }
253 break;
254 case 16:
255 if (snd_format & SND_FORMAT16) {
256 valid_datatype = 1;
257 snd_format = Sndstatus(SND_QUERY16BIT);
258 }
259 break;
260 case 32:
261 if (snd_format & SND_FORMAT32) {
262 valid_datatype = 1;
263 snd_format = Sndstatus(SND_QUERY32BIT);
264 }
265 break;
266 } 252 }
267
268 break; 253 break;
254 case 16:
255 if (snd_format & SND_FORMAT16) {
256 valid_datatype = 1;
257 snd_format = Sndstatus(SND_QUERY16BIT);
258 }
259 break;
260 case 32:
261 if (snd_format & SND_FORMAT32) {
262 valid_datatype = 1;
263 snd_format = Sndstatus(SND_QUERY32BIT);
264 }
265 break;
266 }
267
268 break;
269 } 269 }
270 } 270 }
271 271
272 if (!valid_datatype) { 272 if (!valid_datatype) {
273 SDL_SetError("Unsupported audio format"); 273 SDL_SetError("Unsupported audio format");
326 #endif 326 #endif
327 327
328 MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, spec->freq); 328 MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, spec->freq);
329 spec->freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency; 329 spec->freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
330 330
331 DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ", SDL_AUDIO_BITSIZE(spec->format))); 331 DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",
332 SDL_AUDIO_BITSIZE(spec->format)));
332 DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format))); 333 DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(spec->format)));
333 DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format))); 334 DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(spec->format)));
334 DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format))); 335 DEBUG_PRINT(("big endian=%d, ", SDL_AUDIO_ISBIGENDIAN(spec->format)));
335 DEBUG_PRINT(("channels=%d, ", spec->channels)); 336 DEBUG_PRINT(("channels=%d, ", spec->channels));
336 DEBUG_PRINT(("freq=%d\n", spec->freq)); 337 DEBUG_PRINT(("freq=%d\n", spec->freq));