Mercurial > sdl-ios-xcode
comparison src/audio/macosx/SDL_coreaudio.c @ 3816:9d070c1a45fa SDL-ryan-multiple-audio-device
Moved AudioBootstrap section in converted drivers to bottom of source, so I
could delete the predeclarations (one more thing to forget to update when
changing the API, otherwise). There're a few other cleanups that snuck into
this commit, too.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Fri, 06 Oct 2006 04:46:58 +0000 |
parents | 1485d42cf1a0 |
children | 29e83f221c62 |
comparison
equal
deleted
inserted
replaced
3815:3234d6eee011 | 3816:9d070c1a45fa |
---|---|
199 } | 199 } |
200 | 200 |
201 return 0; | 201 return 0; |
202 } | 202 } |
203 | 203 |
204 | |
205 /* Audio driver functions */ | |
206 | |
207 static int COREAUDIO_DetectDevices(int iscapture); | |
208 static const char *COREAUDIO_GetDeviceName(int index, int iscapture); | |
209 static int COREAUDIO_OpenDevice(_THIS, const char *devname, int iscapture); | |
210 static void COREAUDIO_WaitDevice(_THIS); | |
211 static void COREAUDIO_PlayDevice(_THIS); | |
212 static Uint8 *COREAUDIO_GetDeviceBuf(_THIS); | |
213 static void COREAUDIO_CloseDevice(_THIS); | |
214 static void COREAUDIO_Deinitialize(void); | |
215 | |
216 /* Audio driver bootstrap functions */ | |
217 | |
218 static int | 204 static int |
219 COREAUDIO_Available(void) | 205 COREAUDIO_Available(void) |
220 { | 206 { |
221 return 1; /* always available on Mac OS X. */ | 207 return 1; /* always available on Mac OS X. */ |
222 } | 208 } |
223 | |
224 static int | |
225 COREAUDIO_Init(SDL_AudioDriverImpl *impl) | |
226 { | |
227 /* Set the function pointers */ | |
228 impl->DetectDevices = COREAUDIO_DetectDevices; | |
229 impl->GetDeviceName = COREAUDIO_GetDeviceName; | |
230 impl->OpenDevice = COREAUDIO_OpenDevice; | |
231 impl->CloseDevice = COREAUDIO_CloseDevice; | |
232 impl->Deinitialize = COREAUDIO_Deinitialize; | |
233 impl->ProvidesOwnCallbackThread = 1; | |
234 | |
235 build_device_lists(); /* do an initial check for devices... */ | |
236 | |
237 return 1; | |
238 } | |
239 | |
240 AudioBootStrap COREAUDIO_bootstrap = { | |
241 "coreaudio", "Mac OS X CoreAudio", | |
242 COREAUDIO_Available, COREAUDIO_Init, 0 | |
243 }; | |
244 | |
245 | 209 |
246 static int | 210 static int |
247 COREAUDIO_DetectDevices(int iscapture) | 211 COREAUDIO_DetectDevices(int iscapture) |
248 { | 212 { |
249 if (iscapture) { | 213 if (iscapture) { |
599 } | 563 } |
600 | 564 |
601 return 1; /* good to go. */ | 565 return 1; /* good to go. */ |
602 } | 566 } |
603 | 567 |
568 static int | |
569 COREAUDIO_Init(SDL_AudioDriverImpl *impl) | |
570 { | |
571 /* Set the function pointers */ | |
572 impl->DetectDevices = COREAUDIO_DetectDevices; | |
573 impl->GetDeviceName = COREAUDIO_GetDeviceName; | |
574 impl->OpenDevice = COREAUDIO_OpenDevice; | |
575 impl->CloseDevice = COREAUDIO_CloseDevice; | |
576 impl->Deinitialize = COREAUDIO_Deinitialize; | |
577 impl->ProvidesOwnCallbackThread = 1; | |
578 | |
579 build_device_lists(); /* do an initial check for devices... */ | |
580 | |
581 return 1; | |
582 } | |
583 | |
584 AudioBootStrap COREAUDIO_bootstrap = { | |
585 "coreaudio", "Mac OS X CoreAudio", | |
586 COREAUDIO_Available, COREAUDIO_Init, 0 | |
587 }; | |
588 | |
604 /* vi: set ts=4 sw=4 expandtab: */ | 589 /* vi: set ts=4 sw=4 expandtab: */ |