src/audio/SDL_audio.c
changeset 1982 3b4ce57c6215
parent 1978 542c78b6fb12
child 1993 7a3889fc9e5d
--- a/src/audio/SDL_audio.c	Thu Aug 10 15:15:06 2006 +0000
+++ b/src/audio/SDL_audio.c	Thu Aug 24 12:10:46 2006 +0000
@@ -286,10 +286,10 @@
     SDL_mutexV(audio->mixer_lock);
 }
 
-static Uint16
+static SDL_AudioFormat
 SDL_ParseAudioFormat(const char *string)
 {
-    Uint16 format = 0;
+    SDL_AudioFormat format = 0;
 
     switch (*string) {
     case 'U':
@@ -740,26 +740,34 @@
     }
 }
 
-#define NUM_FORMATS	6
+#define NUM_FORMATS 10
 static int format_idx;
 static int format_idx_sub;
-static Uint16 format_list[NUM_FORMATS][NUM_FORMATS] = {
+static SDL_AudioFormat format_list[NUM_FORMATS][NUM_FORMATS] = {
     {AUDIO_U8, AUDIO_S8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB,
-     AUDIO_U16MSB},
+     AUDIO_U16MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB},
     {AUDIO_S8, AUDIO_U8, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB,
-     AUDIO_U16MSB},
-    {AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_U8,
-     AUDIO_S8},
-    {AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_U8,
-     AUDIO_S8},
-    {AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U8,
-     AUDIO_S8},
-    {AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_U8,
-     AUDIO_S8},
+     AUDIO_U16MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB},
+    {AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_S32LSB,
+     AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_U8, AUDIO_S8},
+    {AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_S32MSB,
+     AUDIO_S32LSB, AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_U8, AUDIO_S8},
+    {AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_S32LSB,
+     AUDIO_S32MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_U8, AUDIO_S8},
+    {AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_S32MSB,
+     AUDIO_S32LSB, AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_U8, AUDIO_S8},
+    {AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_U16LSB, AUDIO_U16MSB, AUDIO_S16LSB,
+     AUDIO_S16MSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_U8, AUDIO_S8},
+    {AUDIO_S32MSB, AUDIO_S32LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_S16MSB,
+     AUDIO_S16LSB, AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_U8, AUDIO_S8},
+    {AUDIO_F32LSB, AUDIO_F32MSB, AUDIO_S32LSB, AUDIO_S32MSB, AUDIO_U16LSB,
+     AUDIO_U16MSB, AUDIO_S16LSB, AUDIO_S16MSB, AUDIO_U8, AUDIO_S8},
+    {AUDIO_F32MSB, AUDIO_F32LSB, AUDIO_S32MSB, AUDIO_S32LSB, AUDIO_U16MSB,
+     AUDIO_U16LSB, AUDIO_S16MSB, AUDIO_S16LSB, AUDIO_U8, AUDIO_S8},
 };
 
-Uint16
-SDL_FirstAudioFormat(Uint16 format)
+SDL_AudioFormat
+SDL_FirstAudioFormat(SDL_AudioFormat format)
 {
     for (format_idx = 0; format_idx < NUM_FORMATS; ++format_idx) {
         if (format_list[format_idx][0] == format) {
@@ -770,7 +778,7 @@
     return (SDL_NextAudioFormat());
 }
 
-Uint16
+SDL_AudioFormat
 SDL_NextAudioFormat(void)
 {
     if ((format_idx == NUM_FORMATS) || (format_idx_sub == NUM_FORMATS)) {