Mercurial > mm7
comparison lib/OpenAL/alc.h @ 2134:992d2e6f907d
preparation for libavcodec
author | zipi |
---|---|
date | Tue, 31 Dec 2013 14:52:14 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
2133:e378232bfd36 | 2134:992d2e6f907d |
---|---|
1 #ifndef AL_ALC_H | |
2 #define AL_ALC_H | |
3 | |
4 #if defined(__cplusplus) | |
5 extern "C" { | |
6 #endif | |
7 | |
8 #if defined(_WIN32) && !defined(_XBOX) | |
9 /* _OPENAL32LIB is deprecated */ | |
10 #if defined(AL_BUILD_LIBRARY) || defined (_OPENAL32LIB) | |
11 #define ALC_API __declspec(dllexport) | |
12 #else | |
13 #define ALC_API __declspec(dllimport) | |
14 #endif | |
15 #else | |
16 #if defined(AL_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY) | |
17 #define ALC_API __attribute__((visibility("default"))) | |
18 #else | |
19 #define ALC_API extern | |
20 #endif | |
21 #endif | |
22 | |
23 #if defined(_WIN32) | |
24 #define ALC_APIENTRY __cdecl | |
25 #else | |
26 #define ALC_APIENTRY | |
27 #endif | |
28 | |
29 #if defined(TARGET_OS_MAC) && TARGET_OS_MAC | |
30 #pragma export on | |
31 #endif | |
32 | |
33 /* | |
34 * The ALCAPI, ALCAPIENTRY, and ALC_INVALID macros are deprecated, but are | |
35 * included for applications porting code from AL 1.0 | |
36 */ | |
37 #define ALCAPI ALC_API | |
38 #define ALCAPIENTRY ALC_APIENTRY | |
39 #define ALC_INVALID 0 | |
40 | |
41 | |
42 #define ALC_VERSION_0_1 1 | |
43 | |
44 typedef struct ALCdevice_struct ALCdevice; | |
45 typedef struct ALCcontext_struct ALCcontext; | |
46 | |
47 | |
48 /** 8-bit boolean */ | |
49 typedef char ALCboolean; | |
50 | |
51 /** character */ | |
52 typedef char ALCchar; | |
53 | |
54 /** signed 8-bit 2's complement integer */ | |
55 typedef char ALCbyte; | |
56 | |
57 /** unsigned 8-bit integer */ | |
58 typedef unsigned char ALCubyte; | |
59 | |
60 /** signed 16-bit 2's complement integer */ | |
61 typedef short ALCshort; | |
62 | |
63 /** unsigned 16-bit integer */ | |
64 typedef unsigned short ALCushort; | |
65 | |
66 /** signed 32-bit 2's complement integer */ | |
67 typedef int ALCint; | |
68 | |
69 /** unsigned 32-bit integer */ | |
70 typedef unsigned int ALCuint; | |
71 | |
72 /** non-negative 32-bit binary integer size */ | |
73 typedef int ALCsizei; | |
74 | |
75 /** enumerated 32-bit value */ | |
76 typedef int ALCenum; | |
77 | |
78 /** 32-bit IEEE754 floating-point */ | |
79 typedef float ALCfloat; | |
80 | |
81 /** 64-bit IEEE754 floating-point */ | |
82 typedef double ALCdouble; | |
83 | |
84 /** void type (for opaque pointers only) */ | |
85 typedef void ALCvoid; | |
86 | |
87 | |
88 /* Enumerant values begin at column 50. No tabs. */ | |
89 | |
90 /* Boolean False. */ | |
91 #define ALC_FALSE 0 | |
92 | |
93 /* Boolean True. */ | |
94 #define ALC_TRUE 1 | |
95 | |
96 /** | |
97 * followed by <int> Hz | |
98 */ | |
99 #define ALC_FREQUENCY 0x1007 | |
100 | |
101 /** | |
102 * followed by <int> Hz | |
103 */ | |
104 #define ALC_REFRESH 0x1008 | |
105 | |
106 /** | |
107 * followed by AL_TRUE, AL_FALSE | |
108 */ | |
109 #define ALC_SYNC 0x1009 | |
110 | |
111 /** | |
112 * followed by <int> Num of requested Mono (3D) Sources | |
113 */ | |
114 #define ALC_MONO_SOURCES 0x1010 | |
115 | |
116 /** | |
117 * followed by <int> Num of requested Stereo Sources | |
118 */ | |
119 #define ALC_STEREO_SOURCES 0x1011 | |
120 | |
121 /** | |
122 * errors | |
123 */ | |
124 | |
125 /** | |
126 * No error | |
127 */ | |
128 #define ALC_NO_ERROR ALC_FALSE | |
129 | |
130 /** | |
131 * No device | |
132 */ | |
133 #define ALC_INVALID_DEVICE 0xA001 | |
134 | |
135 /** | |
136 * invalid context ID | |
137 */ | |
138 #define ALC_INVALID_CONTEXT 0xA002 | |
139 | |
140 /** | |
141 * bad enum | |
142 */ | |
143 #define ALC_INVALID_ENUM 0xA003 | |
144 | |
145 /** | |
146 * bad value | |
147 */ | |
148 #define ALC_INVALID_VALUE 0xA004 | |
149 | |
150 /** | |
151 * Out of memory. | |
152 */ | |
153 #define ALC_OUT_OF_MEMORY 0xA005 | |
154 | |
155 | |
156 /** | |
157 * The Specifier string for default device | |
158 */ | |
159 #define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004 | |
160 #define ALC_DEVICE_SPECIFIER 0x1005 | |
161 #define ALC_EXTENSIONS 0x1006 | |
162 | |
163 #define ALC_MAJOR_VERSION 0x1000 | |
164 #define ALC_MINOR_VERSION 0x1001 | |
165 | |
166 #define ALC_ATTRIBUTES_SIZE 0x1002 | |
167 #define ALC_ALL_ATTRIBUTES 0x1003 | |
168 | |
169 /** | |
170 * ALC_ENUMERATE_ALL_EXT enums | |
171 */ | |
172 #define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012 | |
173 #define ALC_ALL_DEVICES_SPECIFIER 0x1013 | |
174 | |
175 /** | |
176 * Capture extension | |
177 */ | |
178 #define ALC_CAPTURE_DEVICE_SPECIFIER 0x310 | |
179 #define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311 | |
180 #define ALC_CAPTURE_SAMPLES 0x312 | |
181 | |
182 | |
183 /* | |
184 * Context Management | |
185 */ | |
186 ALC_API ALCcontext * ALC_APIENTRY alcCreateContext( ALCdevice *device, const ALCint* attrlist ); | |
187 | |
188 ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context ); | |
189 | |
190 ALC_API void ALC_APIENTRY alcProcessContext( ALCcontext *context ); | |
191 | |
192 ALC_API void ALC_APIENTRY alcSuspendContext( ALCcontext *context ); | |
193 | |
194 ALC_API void ALC_APIENTRY alcDestroyContext( ALCcontext *context ); | |
195 | |
196 ALC_API ALCcontext * ALC_APIENTRY alcGetCurrentContext( void ); | |
197 | |
198 ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice( ALCcontext *context ); | |
199 | |
200 | |
201 /* | |
202 * Device Management | |
203 */ | |
204 ALC_API ALCdevice * ALC_APIENTRY alcOpenDevice( const ALCchar *devicename ); | |
205 | |
206 ALC_API ALCboolean ALC_APIENTRY alcCloseDevice( ALCdevice *device ); | |
207 | |
208 | |
209 /* | |
210 * Error support. | |
211 * Obtain the most recent Context error | |
212 */ | |
213 ALC_API ALCenum ALC_APIENTRY alcGetError( ALCdevice *device ); | |
214 | |
215 | |
216 /* | |
217 * Extension support. | |
218 * Query for the presence of an extension, and obtain any appropriate | |
219 * function pointers and enum values. | |
220 */ | |
221 ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname ); | |
222 | |
223 ALC_API void * ALC_APIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname ); | |
224 | |
225 ALC_API ALCenum ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname ); | |
226 | |
227 | |
228 /* | |
229 * Query functions | |
230 */ | |
231 ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param ); | |
232 | |
233 ALC_API void ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *data ); | |
234 | |
235 | |
236 /* | |
237 * Capture functions | |
238 */ | |
239 ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize ); | |
240 | |
241 ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device ); | |
242 | |
243 ALC_API void ALC_APIENTRY alcCaptureStart( ALCdevice *device ); | |
244 | |
245 ALC_API void ALC_APIENTRY alcCaptureStop( ALCdevice *device ); | |
246 | |
247 ALC_API void ALC_APIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples ); | |
248 | |
249 /* | |
250 * Pointer-to-function types, useful for dynamically getting ALC entry points. | |
251 */ | |
252 typedef ALCcontext * (ALC_APIENTRY *LPALCCREATECONTEXT) (ALCdevice *device, const ALCint *attrlist); | |
253 typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)( ALCcontext *context ); | |
254 typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)( ALCcontext *context ); | |
255 typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)( ALCcontext *context ); | |
256 typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)( ALCcontext *context ); | |
257 typedef ALCcontext * (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)( void ); | |
258 typedef ALCdevice * (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)( ALCcontext *context ); | |
259 typedef ALCdevice * (ALC_APIENTRY *LPALCOPENDEVICE)( const ALCchar *devicename ); | |
260 typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)( ALCdevice *device ); | |
261 typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)( ALCdevice *device ); | |
262 typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)( ALCdevice *device, const ALCchar *extname ); | |
263 typedef void * (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname ); | |
264 typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname ); | |
265 typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)( ALCdevice *device, ALCenum param ); | |
266 typedef void (ALC_APIENTRY *LPALCGETINTEGERV)( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest ); | |
267 typedef ALCdevice * (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize ); | |
268 typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)( ALCdevice *device ); | |
269 typedef void (ALC_APIENTRY *LPALCCAPTURESTART)( ALCdevice *device ); | |
270 typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)( ALCdevice *device ); | |
271 typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples ); | |
272 | |
273 #if defined(TARGET_OS_MAC) && TARGET_OS_MAC | |
274 #pragma export off | |
275 #endif | |
276 | |
277 #if defined(__cplusplus) | |
278 } | |
279 #endif | |
280 | |
281 #endif /* AL_ALC_H */ |