comparison src/audio/arts/SDL_artsaudio.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 8e1af9ff0e1f
children 66fb40445587
comparison
equal deleted inserted replaced
3815:3234d6eee011 3816:9d070c1a45fa
36 #define SDL_NAME(X) X 36 #define SDL_NAME(X) X
37 #endif 37 #endif
38 38
39 /* The tag name used by artsc audio */ 39 /* The tag name used by artsc audio */
40 #define ARTS_DRIVER_NAME "arts" 40 #define ARTS_DRIVER_NAME "arts"
41
42 /* Audio driver functions */
43 static int ARTS_OpenDevice(_THIS, const char *devname, int iscapture);
44 static void ARTS_WaitDevice(_THIS);
45 static void ARTS_PlayDevice(_THIS);
46 static Uint8 *ARTS_GetDeviceBuf(_THIS);
47 static void ARTS_CloseDevice(_THIS);
48 static void ARTS_WaitDone(_THIS);
49 41
50 #ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC 42 #ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
51 43
52 static const char *arts_library = SDL_AUDIO_DRIVER_ARTS_DYNAMIC; 44 static const char *arts_library = SDL_AUDIO_DRIVER_ARTS_DYNAMIC;
53 static void *arts_handle = NULL; 45 static void *arts_handle = NULL;
158 150
159 return available; 151 return available;
160 } 152 }
161 153
162 154
163 static int
164 ARTS_Init(SDL_AudioDriverImpl *impl)
165 {
166 /* Set the function pointers */
167 impl->OpenDevice = ARTS_OpenDevice;
168 impl->PlayDevice = ARTS_PlayDevice;
169 impl->WaitDevice = ARTS_WaitDevice;
170 impl->GetDeviceBuf = ARTS_GetDeviceBuf;
171 impl->CloseDevice = ARTS_CloseDevice;
172 impl->WaitDone = ARTS_WaitDone;
173 impl->OnlyHasDefaultOutputDevice = 1;
174
175 return 1;
176 }
177
178
179 AudioBootStrap ARTS_bootstrap = {
180 ARTS_DRIVER_NAME, "Analog RealTime Synthesizer",
181 ARTS_Available, ARTS_Init, 0
182 };
183
184
185 /* This function waits until it is possible to write a full sound buffer */ 155 /* This function waits until it is possible to write a full sound buffer */
186 static void 156 static void
187 ARTS_WaitDevice(_THIS) 157 ARTS_WaitDevice(_THIS)
188 { 158 {
189 Sint32 ticks; 159 Sint32 ticks;
368 338
369 /* We're ready to rock and roll. :-) */ 339 /* We're ready to rock and roll. :-) */
370 return 1; 340 return 1;
371 } 341 }
372 342
343
344 static int
345 ARTS_Init(SDL_AudioDriverImpl *impl)
346 {
347 /* Set the function pointers */
348 impl->OpenDevice = ARTS_OpenDevice;
349 impl->PlayDevice = ARTS_PlayDevice;
350 impl->WaitDevice = ARTS_WaitDevice;
351 impl->GetDeviceBuf = ARTS_GetDeviceBuf;
352 impl->CloseDevice = ARTS_CloseDevice;
353 impl->WaitDone = ARTS_WaitDone;
354 impl->OnlyHasDefaultOutputDevice = 1;
355
356 return 1;
357 }
358
359
360 AudioBootStrap ARTS_bootstrap = {
361 ARTS_DRIVER_NAME, "Analog RealTime Synthesizer",
362 ARTS_Available, ARTS_Init, 0
363 };
364
373 /* vi: set ts=4 sw=4 expandtab: */ 365 /* vi: set ts=4 sw=4 expandtab: */