High level now lets user select a specific audio device with an environment SDL-ryan-multiple-audio-device
authorRyan C. Gordon <icculus@icculus.org>
Tue, 03 Oct 2006 16:02:08 +0000
branchSDL-ryan-multiple-audio-device
changeset 3786 b70f4e9291bb
parent 3785 da2ea0694d11
child 3787 8d74a4721ca9
High level now lets user select a specific audio device with an environment variable, when the app requested the default device.
src/audio/SDL_audio.c
src/audio/macosx/SDL_coreaudio.c
--- a/src/audio/SDL_audio.c	Tue Oct 03 05:58:44 2006 +0000
+++ b/src/audio/SDL_audio.c	Tue Oct 03 16:02:08 2006 +0000
@@ -572,6 +572,11 @@
         return 0;
     }
 
+    /* If app doesn't care about a specific device, let the user override. */
+    if (devname == NULL) {
+        devname = SDL_getenv("SDL_AUDIO_DEVICE_NAME");
+    }
+
     device = (SDL_AudioDevice *) SDL_AllocAudioMem(sizeof (SDL_AudioDevice));
     if (device == NULL) {
         SDL_OutOfMemory();
--- a/src/audio/macosx/SDL_coreaudio.c	Tue Oct 03 05:58:44 2006 +0000
+++ b/src/audio/macosx/SDL_coreaudio.c	Tue Oct 03 16:02:08 2006 +0000
@@ -223,8 +223,11 @@
     UInt32 remaining, len;
     void *ptr;
 
+    /*
+     * !!! FIXME: I'm not sure if you can ever have more than one
+     *            buffer, or what this signifies, or what to do with it...
+     */
     if (ioDataList->mNumberBuffers != 1) {
-        fprintf(stderr, "!!! FIXME SDL!\n");
         return noErr;
     }
 
@@ -406,10 +409,6 @@
     const AudioUnitScope scope = ((iscapture) ? kAudioUnitScope_Output :
                                                 kAudioUnitScope_Input);
 
-    /* !!! FIXME: move something like this to higher level. */
-    if ( (devname == NULL) && (SDL_getenv("SDL_AUDIO_DEVNAME")) )
-        devname = SDL_getenv("SDL_AUDIO_DEVNAME");
-
     if (!find_device_by_name(this, devname, iscapture)) {
         SDL_SetError("Couldn't find requested CoreAudio device");
         return 0;