Mercurial > sdl-ios-xcode
comparison src/audio/SDL_sysaudio.h @ 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 |
---|---|
43 void (*WaitDone) (_THIS); | 43 void (*WaitDone) (_THIS); |
44 void (*CloseDevice) (_THIS); | 44 void (*CloseDevice) (_THIS); |
45 void (*LockDevice) (_THIS); | 45 void (*LockDevice) (_THIS); |
46 void (*UnlockDevice) (_THIS); | 46 void (*UnlockDevice) (_THIS); |
47 void (*Deinitialize) (void); | 47 void (*Deinitialize) (void); |
48 | |
49 /* Some flags to push duplicate code into the core and reduce #ifdefs. */ | |
50 int ProvidesOwnCallbackThread:1; | |
51 int SkipMixerLock:1; | |
52 int HasCaptureSupport:1; | |
53 int OnlyHasDefaultOutputDevice:1; | |
54 int OnlyHasDefaultInputDevice:1; | |
48 } SDL_AudioDriverImpl; | 55 } SDL_AudioDriverImpl; |
49 | 56 |
50 | 57 |
51 typedef struct SDL_AudioDriver | 58 typedef struct SDL_AudioDriver |
52 { | 59 { |
64 | 71 |
65 /* Define the SDL audio driver structure */ | 72 /* Define the SDL audio driver structure */ |
66 struct SDL_AudioDevice | 73 struct SDL_AudioDevice |
67 { | 74 { |
68 /* * * */ | 75 /* * * */ |
69 /* Lowlevel audio implementation */ | |
70 const SDL_AudioDriver *driver; | |
71 | |
72 /* * * */ | |
73 /* Data common to all devices */ | 76 /* Data common to all devices */ |
74 | 77 |
75 /* The current audio specification (shared with audio thread) */ | 78 /* The current audio specification (shared with audio thread) */ |
76 SDL_AudioSpec spec; | 79 SDL_AudioSpec spec; |
77 | 80 |
78 /* An audio conversion block for audio format emulation */ | 81 /* An audio conversion block for audio format emulation */ |
79 SDL_AudioCVT convert; | 82 SDL_AudioCVT convert; |
80 | 83 |
81 /* Current state flags */ | 84 /* Current state flags */ |
85 int iscapture; | |
82 int enabled; | 86 int enabled; |
83 int paused; | 87 int paused; |
84 int opened; | 88 int opened; |
85 | 89 |
86 /* Fake audio buffer for when the audio hardware is busy */ | 90 /* Fake audio buffer for when the audio hardware is busy */ |
94 Uint32 threadid; | 98 Uint32 threadid; |
95 | 99 |
96 /* * * */ | 100 /* * * */ |
97 /* Data private to this driver */ | 101 /* Data private to this driver */ |
98 struct SDL_PrivateAudioData *hidden; | 102 struct SDL_PrivateAudioData *hidden; |
99 | |
100 /* * * */ | |
101 /* The function used to dispose of this structure */ | |
102 void (*free) (_THIS); | |
103 }; | 103 }; |
104 #undef _THIS | 104 #undef _THIS |
105 | 105 |
106 typedef struct AudioBootStrap | 106 typedef struct AudioBootStrap |
107 { | 107 { |
109 const char *desc; | 109 const char *desc; |
110 int (*available) (void); | 110 int (*available) (void); |
111 int (*init) (SDL_AudioDriverImpl *impl); | 111 int (*init) (SDL_AudioDriverImpl *impl); |
112 } AudioBootStrap; | 112 } AudioBootStrap; |
113 | 113 |
114 #if SDL_AUDIO_DRIVER_BSD | |
115 extern AudioBootStrap BSD_AUDIO_bootstrap; | |
116 #endif | |
117 #if SDL_AUDIO_DRIVER_OSS | |
118 extern AudioBootStrap DSP_bootstrap; | |
119 extern AudioBootStrap DMA_bootstrap; | |
120 #endif | |
121 #if SDL_AUDIO_DRIVER_ALSA | |
122 extern AudioBootStrap ALSA_bootstrap; | |
123 #endif | |
124 #if SDL_AUDIO_DRIVER_QNXNTO | |
125 extern AudioBootStrap QNXNTOAUDIO_bootstrap; | |
126 #endif | |
127 #if SDL_AUDIO_DRIVER_SUNAUDIO | |
128 extern AudioBootStrap SUNAUDIO_bootstrap; | |
129 #endif | |
130 #if SDL_AUDIO_DRIVER_DMEDIA | |
131 extern AudioBootStrap DMEDIA_bootstrap; | |
132 #endif | |
133 #if SDL_AUDIO_DRIVER_ARTS | |
134 extern AudioBootStrap ARTS_bootstrap; | |
135 #endif | |
136 #if SDL_AUDIO_DRIVER_ESD | |
137 extern AudioBootStrap ESD_bootstrap; | |
138 #endif | |
139 #if SDL_AUDIO_DRIVER_NAS | |
140 extern AudioBootStrap NAS_bootstrap; | |
141 #endif | |
142 #if SDL_AUDIO_DRIVER_DSOUND | |
143 extern AudioBootStrap DSOUND_bootstrap; | |
144 #endif | |
145 #if SDL_AUDIO_DRIVER_WAVEOUT | |
146 extern AudioBootStrap WAVEOUT_bootstrap; | |
147 #endif | |
148 #if SDL_AUDIO_DRIVER_PAUD | |
149 extern AudioBootStrap Paud_bootstrap; | |
150 #endif | |
151 #if SDL_AUDIO_DRIVER_BAUDIO | |
152 extern AudioBootStrap BAUDIO_bootstrap; | |
153 #endif | |
154 #if SDL_AUDIO_DRIVER_COREAUDIO | |
155 extern AudioBootStrap COREAUDIO_bootstrap; | |
156 #endif | |
157 #if SDL_AUDIO_DRIVER_SNDMGR | |
158 extern AudioBootStrap SNDMGR_bootstrap; | |
159 #endif | |
160 #if SDL_AUDIO_DRIVER_AHI | |
161 extern AudioBootStrap AHI_bootstrap; | |
162 #endif | |
163 #if SDL_AUDIO_DRIVER_MINT | |
164 extern AudioBootStrap MINTAUDIO_GSXB_bootstrap; | |
165 extern AudioBootStrap MINTAUDIO_MCSN_bootstrap; | |
166 extern AudioBootStrap MINTAUDIO_STFA_bootstrap; | |
167 extern AudioBootStrap MINTAUDIO_XBIOS_bootstrap; | |
168 extern AudioBootStrap MINTAUDIO_DMA8_bootstrap; | |
169 #endif | |
170 #if SDL_AUDIO_DRIVER_DISK | |
171 extern AudioBootStrap DISKAUD_bootstrap; | |
172 #endif | |
173 #if SDL_AUDIO_DRIVER_DUMMY | |
174 extern AudioBootStrap DUMMYAUD_bootstrap; | |
175 #endif | |
176 #if SDL_AUDIO_DRIVER_DC | |
177 extern AudioBootStrap DCAUD_bootstrap; | |
178 #endif | |
179 #if SDL_AUDIO_DRIVER_MMEAUDIO | |
180 extern AudioBootStrap MMEAUDIO_bootstrap; | |
181 #endif | |
182 #if SDL_AUDIO_DRIVER_DART | |
183 extern AudioBootStrap DART_bootstrap; | |
184 #endif | |
185 | |
186 #endif /* _SDL_sysaudio_h */ | 114 #endif /* _SDL_sysaudio_h */ |
187 /* vi: set ts=4 sw=4 expandtab: */ | 115 /* vi: set ts=4 sw=4 expandtab: */ |