comparison src/audio/macosx/SDL_coreaudio.c @ 3796:b19680c84cdf SDL-ryan-multiple-audio-device

Bunch of 1.3 audio cleanups to remove FIXMEs, get driver specific crap out of the core and into the drivers where it belongs, and push generic responsibilities out of the drivers and into the core where they belong.
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 04 Oct 2006 19:54:23 +0000
parents 589bc3d060cd
children c8b3d3d13ed1
comparison
equal deleted inserted replaced
3795:589bc3d060cd 3796:b19680c84cdf
231 impl->WaitDevice = COREAUDIO_WaitDevice; 231 impl->WaitDevice = COREAUDIO_WaitDevice;
232 impl->PlayDevice = COREAUDIO_PlayDevice; 232 impl->PlayDevice = COREAUDIO_PlayDevice;
233 impl->GetDeviceBuf = COREAUDIO_GetDeviceBuf; 233 impl->GetDeviceBuf = COREAUDIO_GetDeviceBuf;
234 impl->CloseDevice = COREAUDIO_CloseDevice; 234 impl->CloseDevice = COREAUDIO_CloseDevice;
235 impl->Deinitialize = COREAUDIO_Deinitialize; 235 impl->Deinitialize = COREAUDIO_Deinitialize;
236 236 impl->ProvidesOwnCallbackThread = 1;
237 return 1; 237 return 1;
238 } 238 }
239 239
240 AudioBootStrap COREAUDIO_bootstrap = { 240 AudioBootStrap COREAUDIO_bootstrap = {
241 "coreaudio", "Mac OS X CoreAudio", 241 "coreaudio", "Mac OS X CoreAudio",
380 if (this->hidden != NULL) { 380 if (this->hidden != NULL) {
381 OSStatus result = noErr; 381 OSStatus result = noErr;
382 AURenderCallbackStruct callback; 382 AURenderCallbackStruct callback;
383 const AudioUnitElement output_bus = 0; 383 const AudioUnitElement output_bus = 0;
384 const AudioUnitElement input_bus = 1; 384 const AudioUnitElement input_bus = 1;
385 const int iscapture = this->hidden->isCapture; 385 const int iscapture = this->iscapture;
386 const AudioUnitElement bus = ((iscapture) ? input_bus : output_bus); 386 const AudioUnitElement bus = ((iscapture) ? input_bus : output_bus);
387 const AudioUnitScope scope = ((iscapture) ? kAudioUnitScope_Output : 387 const AudioUnitScope scope = ((iscapture) ? kAudioUnitScope_Output :
388 kAudioUnitScope_Input); 388 kAudioUnitScope_Input);
389 389
390 /* stop processing the audio unit */ 390 /* stop processing the audio unit */
568 if (this->hidden == NULL) { 568 if (this->hidden == NULL) {
569 SDL_OutOfMemory(); 569 SDL_OutOfMemory();
570 return (0); 570 return (0);
571 } 571 }
572 SDL_memset(this->hidden, 0, (sizeof *this->hidden)); 572 SDL_memset(this->hidden, 0, (sizeof *this->hidden));
573
574 this->hidden->isCapture = iscapture;
575 573
576 /* Setup a AudioStreamBasicDescription with the requested format */ 574 /* Setup a AudioStreamBasicDescription with the requested format */
577 memset(&strdesc, '\0', sizeof(AudioStreamBasicDescription)); 575 memset(&strdesc, '\0', sizeof(AudioStreamBasicDescription));
578 strdesc.mFormatID = kAudioFormatLinearPCM; 576 strdesc.mFormatID = kAudioFormatLinearPCM;
579 strdesc.mFormatFlags = kLinearPCMFormatFlagIsPacked; 577 strdesc.mFormatFlags = kLinearPCMFormatFlagIsPacked;