diff src/audio/SDL_audio.c @ 3790:8f8209f8da6d SDL-ryan-multiple-audio-device

Added audio device enumeration for 1.3.
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 03 Oct 2006 20:07:50 +0000
parents 7006b176ef4f
children 866c310e2cb5
line wrap: on
line diff
--- a/src/audio/SDL_audio.c	Tue Oct 03 20:05:33 2006 +0000
+++ b/src/audio/SDL_audio.c	Tue Oct 03 20:07:50 2006 +0000
@@ -455,6 +455,34 @@
     return current_audio.name;
 }
 
+
+int
+SDL_GetNumAudioDevices(int iscapture)
+{
+    if (!SDL_WasInit(SDL_INIT_AUDIO) || !current_audio.impl.DetectDevices) {
+        return -1;
+    }
+    return current_audio.impl.DetectDevices(iscapture);
+}
+
+
+const char *
+SDL_GetAudioDevice(int index, int iscapture)
+{
+    if (!SDL_WasInit(SDL_INIT_AUDIO)) {
+        SDL_SetError("Audio subsystem is not initialized");
+        return NULL;
+    }
+
+    if ((index < 0) && (!current_audio.impl.GetAudioDevice)) {
+        SDL_SetError("No such device");
+        return NULL;
+    }
+
+    return current_audio.impl.GetAudioDevice(index, iscapture);
+}
+
+
 static void
 close_audio_device(SDL_AudioDevice *device)
 {