comparison src/audio/disk/SDL_diskaudio.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 866c310e2cb5
children ef7f7be318da
comparison
equal deleted inserted replaced
3797:9dc81c6acaf5 3798:c8b3d3d13ed1
62 62
63 /* Audio driver bootstrap functions */ 63 /* Audio driver bootstrap functions */
64 static int 64 static int
65 DISKAUD_Available(void) 65 DISKAUD_Available(void)
66 { 66 {
67 /* !!! FIXME: check this at a higher level... */ 67 return 1; /* always available. */
68 /* only ever use this driver if explicitly requested. */
69 const char *envr = SDL_getenv("SDL_AUDIODRIVER");
70 if (envr && (SDL_strcasecmp(envr, DISKAUD_DRIVER_NAME) == 0)) {
71 return (1);
72 }
73 return (0);
74 } 68 }
75 69
76 static int 70 static int
77 DISKAUD_Init(SDL_AudioDriverImpl *impl) 71 DISKAUD_Init(SDL_AudioDriverImpl *impl)
78 { 72 {
89 return 1; 83 return 1;
90 } 84 }
91 85
92 AudioBootStrap DISKAUD_bootstrap = { 86 AudioBootStrap DISKAUD_bootstrap = {
93 DISKAUD_DRIVER_NAME, "direct-to-disk audio", 87 DISKAUD_DRIVER_NAME, "direct-to-disk audio",
94 DISKAUD_Available, DISKAUD_Init 88 DISKAUD_Available, DISKAUD_Init, 1
95 }; 89 };
96 90
97 /* This function waits until it is possible to write a full sound buffer */ 91 /* This function waits until it is possible to write a full sound buffer */
98 static void 92 static void
99 DISKAUD_WaitDevice(_THIS) 93 DISKAUD_WaitDevice(_THIS)