comparison src/audio/esd/SDL_esdaudio.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 3234d6eee011
children 66fb40445587
comparison
equal deleted inserted replaced
3815:3234d6eee011 3816:9d070c1a45fa
42 #define SDL_NAME(X) X 42 #define SDL_NAME(X) X
43 #endif 43 #endif
44 44
45 /* The tag name used by ESD audio */ 45 /* The tag name used by ESD audio */
46 #define ESD_DRIVER_NAME "esd" 46 #define ESD_DRIVER_NAME "esd"
47
48 /* Audio driver functions */
49 static int ESD_OpenDevice(_THIS, const char *devname, int iscapture);
50 static void ESD_WaitDevice(_THIS);
51 static void ESD_PlayDevice(_THIS);
52 static Uint8 *ESD_GetDeviceBuf(_THIS);
53 static void ESD_CloseDevice(_THIS);
54 47
55 #ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC 48 #ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC
56 49
57 static const char *esd_library = SDL_AUDIO_DRIVER_ESD_DYNAMIC; 50 static const char *esd_library = SDL_AUDIO_DRIVER_ESD_DYNAMIC;
58 static void *esd_handle = NULL; 51 static void *esd_handle = NULL;
120 return 0; 113 return 0;
121 } 114 }
122 115
123 #endif /* SDL_AUDIO_DRIVER_ESD_DYNAMIC */ 116 #endif /* SDL_AUDIO_DRIVER_ESD_DYNAMIC */
124 117
125 /* Audio driver bootstrap functions */
126
127 static int 118 static int
128 ESD_Available(void) 119 ESD_Available(void)
129 { 120 {
130 int available = 0; 121 int available = 0;
131 if (LoadESDLibrary() == 0) { 122 if (LoadESDLibrary() == 0) {
141 UnloadESDLibrary(); 132 UnloadESDLibrary();
142 } 133 }
143 return available; 134 return available;
144 } 135 }
145 136
146
147 static int
148 ESD_Init(SDL_AudioDriverImpl *impl)
149 {
150 /* Set the function pointers */
151 impl->OpenDevice = ESD_OpenDevice;
152 impl->PlayDevice = ESD_PlayDevice;
153 impl->WaitDevice = ESD_WaitDevice;
154 impl->GetDeviceBuf = ESD_GetDeviceBuf;
155 impl->CloseDevice = ESD_CloseDevice;
156 impl->OnlyHasDefaultOutputDevice = 1;
157
158 return 1;
159 }
160
161
162 AudioBootStrap ESD_bootstrap = {
163 ESD_DRIVER_NAME, "Enlightened Sound Daemon",
164 ESD_Available, ESD_Init, 0
165 };
166 137
167 /* This function waits until it is possible to write a full sound buffer */ 138 /* This function waits until it is possible to write a full sound buffer */
168 static void 139 static void
169 ESD_WaitDevice(_THIS) 140 ESD_WaitDevice(_THIS)
170 { 141 {
358 329
359 /* We're ready to rock and roll. :-) */ 330 /* We're ready to rock and roll. :-) */
360 return 1; 331 return 1;
361 } 332 }
362 333
334
335 static int
336 ESD_Init(SDL_AudioDriverImpl *impl)
337 {
338 /* Set the function pointers */
339 impl->OpenDevice = ESD_OpenDevice;
340 impl->PlayDevice = ESD_PlayDevice;
341 impl->WaitDevice = ESD_WaitDevice;
342 impl->GetDeviceBuf = ESD_GetDeviceBuf;
343 impl->CloseDevice = ESD_CloseDevice;
344 impl->OnlyHasDefaultOutputDevice = 1;
345
346 return 1;
347 }
348
349
350 AudioBootStrap ESD_bootstrap = {
351 ESD_DRIVER_NAME, "Enlightened Sound Daemon",
352 ESD_Available, ESD_Init, 0
353 };
354
363 /* vi: set ts=4 sw=4 expandtab: */ 355 /* vi: set ts=4 sw=4 expandtab: */