comparison src/audio/macosx/SDL_coreaudio.c @ 3798:c8b3d3d13ed1 SDL-ryan-multiple-audio-device

Audio bootstraps can now specify that a driver is only to be used if explicitly requested (for things like the "disk" driver that is always available but you would never want to default to using). Trimmed out code that can be handled by stubs in the core. The "dummy" driver is pretty damned small now. :)
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 04 Oct 2006 21:27:53 +0000
parents b19680c84cdf
children f424927138ff
comparison
equal deleted inserted replaced
3797:9dc81c6acaf5 3798:c8b3d3d13ed1
216 /* Audio driver bootstrap functions */ 216 /* Audio driver bootstrap functions */
217 217
218 static int 218 static int
219 COREAUDIO_Available(void) 219 COREAUDIO_Available(void)
220 { 220 {
221 return (1); 221 return 1; /* always available on Mac OS X. */
222 } 222 }
223 223
224 static int 224 static int
225 COREAUDIO_Init(SDL_AudioDriverImpl *impl) 225 COREAUDIO_Init(SDL_AudioDriverImpl *impl)
226 { 226 {
227 /* Set the function pointers */ 227 /* Set the function pointers */
228 impl->DetectDevices = COREAUDIO_DetectDevices; 228 impl->DetectDevices = COREAUDIO_DetectDevices;
229 impl->GetDeviceName = COREAUDIO_GetDeviceName; 229 impl->GetDeviceName = COREAUDIO_GetDeviceName;
230 impl->OpenDevice = COREAUDIO_OpenDevice; 230 impl->OpenDevice = COREAUDIO_OpenDevice;
231 impl->WaitDevice = COREAUDIO_WaitDevice;
232 impl->PlayDevice = COREAUDIO_PlayDevice;
233 impl->GetDeviceBuf = COREAUDIO_GetDeviceBuf;
234 impl->CloseDevice = COREAUDIO_CloseDevice; 231 impl->CloseDevice = COREAUDIO_CloseDevice;
235 impl->Deinitialize = COREAUDIO_Deinitialize; 232 impl->Deinitialize = COREAUDIO_Deinitialize;
236 impl->ProvidesOwnCallbackThread = 1; 233 impl->ProvidesOwnCallbackThread = 1;
237 return 1; 234 return 1;
238 } 235 }
239 236
240 AudioBootStrap COREAUDIO_bootstrap = { 237 AudioBootStrap COREAUDIO_bootstrap = {
241 "coreaudio", "Mac OS X CoreAudio", 238 "coreaudio", "Mac OS X CoreAudio",
242 COREAUDIO_Available, COREAUDIO_Init 239 COREAUDIO_Available, COREAUDIO_Init, 0
243 }; 240 };
244 241
245 242
246 static int 243 static int
247 COREAUDIO_DetectDevices(int iscapture) 244 COREAUDIO_DetectDevices(int iscapture)
352 //err = AudioUnitRender(afr->fAudioUnit, ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, afr->fAudioBuffer); 349 //err = AudioUnitRender(afr->fAudioUnit, ioActionFlags, inTimeStamp, inBusNumber, inNumberFrames, afr->fAudioBuffer);
353 // !!! FIXME: write me! 350 // !!! FIXME: write me!
354 return noErr; 351 return noErr;
355 } 352 }
356 353
357
358 /* Dummy functions -- we don't use thread-based audio */
359 static void
360 COREAUDIO_WaitDevice(_THIS)
361 {
362 return;
363 }
364
365 static void
366 COREAUDIO_PlayDevice(_THIS)
367 {
368 return;
369 }
370
371 static Uint8 *
372 COREAUDIO_GetDeviceBuf(_THIS)
373 {
374 return (NULL);
375 }
376 354
377 static void 355 static void
378 COREAUDIO_CloseDevice(_THIS) 356 COREAUDIO_CloseDevice(_THIS)
379 { 357 {
380 if (this->hidden != NULL) { 358 if (this->hidden != NULL) {