comparison src/audio/mint/SDL_mintaudio_gsxb.c @ 2044:8d5d119b1640

Minor cleanup in the mint driver that was sitting on my laptop (sorry!).
author Ryan C. Gordon <icculus@icculus.org>
date Sun, 01 Oct 2006 01:12:08 +0000
parents adf732f1f016
children 5f6550e5184f b19680c84cdf
comparison
equal deleted inserted replaced
2043:adf732f1f016 2044:8d5d119b1640
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 /* Check formats available */
231 snd_format = Sndstatus(SND_QUERYFORMATS);
230 spec->format = test_format; 232 spec->format = test_format;
233 resolution = SDL_AUDIO_BITSIZE(spec->format);
234 format_signed = SDL_AUDIO_ISSIGNED(spec->format);
235 format_bigendian = SDL_AUDIO_ISBIGENDIAN(spec->format);
231 switch (test_format) { 236 switch (test_format) {
232 case AUDIO_U8: 237 case AUDIO_U8:
233 case AUDIO_S8: 238 case AUDIO_S8:
234 case AUDIO_U16LSB:
235 case AUDIO_S16LSB:
236 case AUDIO_U16MSB:
237 case AUDIO_S16MSB:
238 case AUDIO_S32LSB:
239 case AUDIO_S32MSB:
240 /* no float support... */
241 resolution = SDL_AUDIO_BITSIZE(spec->format);
242 format_signed = SDL_AUDIO_ISSIGNED(spec->format);
243 format_bigendian = SDL_AUDIO_ISBIGENDIAN(spec->format);
244
245 /* Check formats available */
246 snd_format = Sndstatus(SND_QUERYFORMATS);
247 switch (resolution) {
248 case 8:
249 if (snd_format & SND_FORMAT8) { 239 if (snd_format & SND_FORMAT8) {
250 valid_datatype = 1; 240 valid_datatype = 1;
251 snd_format = Sndstatus(SND_QUERY8BIT); 241 snd_format = Sndstatus(SND_QUERY8BIT);
252 } 242 }
253 break; 243 break;
254 case 16: 244
245 case AUDIO_U16LSB:
246 case AUDIO_S16LSB:
247 case AUDIO_U16MSB:
248 case AUDIO_S16MSB:
255 if (snd_format & SND_FORMAT16) { 249 if (snd_format & SND_FORMAT16) {
256 valid_datatype = 1; 250 valid_datatype = 1;
257 snd_format = Sndstatus(SND_QUERY16BIT); 251 snd_format = Sndstatus(SND_QUERY16BIT);
258 } 252 }
259 break; 253 break;
260 case 32: 254
255 case AUDIO_S32LSB:
256 case AUDIO_S32MSB:
261 if (snd_format & SND_FORMAT32) { 257 if (snd_format & SND_FORMAT32) {
262 valid_datatype = 1; 258 valid_datatype = 1;
263 snd_format = Sndstatus(SND_QUERY32BIT); 259 snd_format = Sndstatus(SND_QUERY32BIT);
264 } 260 }
265 break; 261 break;
266 } 262
267 263 /* no float support... */
268 break; 264
265 default:
266 test_format = SDL_NextAudioFormat();
267 break;
269 } 268 }
270 } 269 }
271 270
272 if (!valid_datatype) { 271 if (!valid_datatype) {
273 SDL_SetError("Unsupported audio format"); 272 SDL_SetError("Unsupported audio format");