comparison 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
comparison
equal deleted inserted replaced
3789:e2f68b579a01 3790:8f8209f8da6d
452 const char * 452 const char *
453 SDL_GetCurrentAudioDriver() 453 SDL_GetCurrentAudioDriver()
454 { 454 {
455 return current_audio.name; 455 return current_audio.name;
456 } 456 }
457
458
459 int
460 SDL_GetNumAudioDevices(int iscapture)
461 {
462 if (!SDL_WasInit(SDL_INIT_AUDIO) || !current_audio.impl.DetectDevices) {
463 return -1;
464 }
465 return current_audio.impl.DetectDevices(iscapture);
466 }
467
468
469 const char *
470 SDL_GetAudioDevice(int index, int iscapture)
471 {
472 if (!SDL_WasInit(SDL_INIT_AUDIO)) {
473 SDL_SetError("Audio subsystem is not initialized");
474 return NULL;
475 }
476
477 if ((index < 0) && (!current_audio.impl.GetAudioDevice)) {
478 SDL_SetError("No such device");
479 return NULL;
480 }
481
482 return current_audio.impl.GetAudioDevice(index, iscapture);
483 }
484
457 485
458 static void 486 static void
459 close_audio_device(SDL_AudioDevice *device) 487 close_audio_device(SDL_AudioDevice *device)
460 { 488 {
461 device->enabled = 0; 489 device->enabled = 0;