comparison src/audio/dart/SDL_dart.c @ 2043:adf732f1f016

Formatting update
author Sam Lantinga <slouken@libsdl.org>
date Sun, 24 Sep 2006 15:56:55 +0000
parents 02108bfd6550
children 5f6550e5184f b19680c84cdf
comparison
equal deleted inserted replaced
2042:3908e1f808e1 2043:adf732f1f016
106 // We will use this in the next calls! 106 // We will use this in the next calls!
107 iDeviceOrd = AmpOpenParms.usDeviceID; 107 iDeviceOrd = AmpOpenParms.usDeviceID;
108 108
109 // Determine the audio parameters from the AudioSpec 109 // Determine the audio parameters from the AudioSpec
110 if (spec->channels > 2) 110 if (spec->channels > 2)
111 spec->channels = 2; // !!! FIXME: more than stereo support in OS/2? 111 spec->channels = 2; // !!! FIXME: more than stereo support in OS/2?
112 112
113 while ((!valid_datatype) && (test_format)) { 113 while ((!valid_datatype) && (test_format)) {
114 spec->format = test_format; 114 spec->format = test_format;
115 valid_datatype = 1; 115 valid_datatype = 1;
116 switch (test_format) { 116 switch (test_format) {
117 case AUDIO_U8: 117 case AUDIO_U8:
118 // Unsigned 8 bit audio data 118 // Unsigned 8 bit audio data
119 iSilence = 0x80; 119 iSilence = 0x80;
120 iBits = 8; 120 iBits = 8;
121 break; 121 break;
122 122
123 case AUDIO_S16LSB: 123 case AUDIO_S16LSB:
124 // Signed 16 bit audio data 124 // Signed 16 bit audio data
125 iSilence = 0x00; 125 iSilence = 0x00;
126 iBits = 16; 126 iBits = 16;
127 break; 127 break;
128 128
129 // !!! FIXME: int32? 129 // !!! FIXME: int32?
130 130
131 default: 131 default:
132 valid_datatype = 0; 132 valid_datatype = 0;
133 test_format = SDL_NextAudioFormat(); 133 test_format = SDL_NextAudioFormat();
134 break; 134 break;
135 } 135 }
136 } 136 }
137 137
138 if (!valid_datatype) { // shouldn't happen, but just in case... 138 if (!valid_datatype) { // shouldn't happen, but just in case...
139 // Close DART, and exit with error code! 139 // Close DART, and exit with error code!
140 mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0); 140 mciSendCommand(iDeviceOrd, MCI_CLOSE, MCI_WAIT, &GenericParms, 0);
141 SDL_SetError("Unsupported audio format"); 141 SDL_SetError("Unsupported audio format");
142 return (-1); 142 return (-1);
143 } 143 }