Mercurial > sdl-ios-xcode
comparison src/audio/macosx/SDL_coreaudio.c @ 3786:b70f4e9291bb SDL-ryan-multiple-audio-device
High level now lets user select a specific audio device with an environment
variable, when the app requested the default device.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Tue, 03 Oct 2006 16:02:08 +0000 |
parents | da2ea0694d11 |
children | 8d74a4721ca9 |
comparison
equal
deleted
inserted
replaced
3785:da2ea0694d11 | 3786:b70f4e9291bb |
---|---|
221 SDL_AudioDevice *this = (SDL_AudioDevice *) inRefCon; | 221 SDL_AudioDevice *this = (SDL_AudioDevice *) inRefCon; |
222 AudioBuffer *ioData = &ioDataList->mBuffers[0]; | 222 AudioBuffer *ioData = &ioDataList->mBuffers[0]; |
223 UInt32 remaining, len; | 223 UInt32 remaining, len; |
224 void *ptr; | 224 void *ptr; |
225 | 225 |
226 /* | |
227 * !!! FIXME: I'm not sure if you can ever have more than one | |
228 * buffer, or what this signifies, or what to do with it... | |
229 */ | |
226 if (ioDataList->mNumberBuffers != 1) { | 230 if (ioDataList->mNumberBuffers != 1) { |
227 fprintf(stderr, "!!! FIXME SDL!\n"); | |
228 return noErr; | 231 return noErr; |
229 } | 232 } |
230 | 233 |
231 /* Only do anything if audio is enabled and not paused */ | 234 /* Only do anything if audio is enabled and not paused */ |
232 if (!this->enabled || this->paused) { | 235 if (!this->enabled || this->paused) { |
403 const AudioUnitElement output_bus = 0; | 406 const AudioUnitElement output_bus = 0; |
404 const AudioUnitElement input_bus = 1; | 407 const AudioUnitElement input_bus = 1; |
405 const AudioUnitElement bus = ((iscapture) ? input_bus : output_bus); | 408 const AudioUnitElement bus = ((iscapture) ? input_bus : output_bus); |
406 const AudioUnitScope scope = ((iscapture) ? kAudioUnitScope_Output : | 409 const AudioUnitScope scope = ((iscapture) ? kAudioUnitScope_Output : |
407 kAudioUnitScope_Input); | 410 kAudioUnitScope_Input); |
408 | |
409 /* !!! FIXME: move something like this to higher level. */ | |
410 if ( (devname == NULL) && (SDL_getenv("SDL_AUDIO_DEVNAME")) ) | |
411 devname = SDL_getenv("SDL_AUDIO_DEVNAME"); | |
412 | 411 |
413 if (!find_device_by_name(this, devname, iscapture)) { | 412 if (!find_device_by_name(this, devname, iscapture)) { |
414 SDL_SetError("Couldn't find requested CoreAudio device"); | 413 SDL_SetError("Couldn't find requested CoreAudio device"); |
415 return 0; | 414 return 0; |
416 } | 415 } |