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