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
25/** Deprecated macro. */
26#define ALCAPI ALC_API
27#define ALCAPIENTRY ALC_APIENTRY
28#define ALC_INVALID 0
29
30/** Supported ALC version? */
31#define ALC_VERSION_0_1 1
32
33/** Opaque device handle */
34typedef struct ALCdevice_struct ALCdevice;
35/** Opaque context handle */
36typedef struct ALCcontext_struct ALCcontext;
37
38/** 8-bit boolean */
39typedef char ALCboolean;
40
41/** character */
42typedef char ALCchar;
43
44/** signed 8-bit 2's complement integer */
45typedef signed char ALCbyte;
46
47/** unsigned 8-bit integer */
48typedef unsigned char ALCubyte;
49
50/** signed 16-bit 2's complement integer */
51typedef short ALCshort;
52
53/** unsigned 16-bit integer */
54typedef unsigned short ALCushort;
55
56/** signed 32-bit 2's complement integer */
57typedef int ALCint;
58
59/** unsigned 32-bit integer */
60typedef unsigned int ALCuint;
61
62/** non-negative 32-bit binary integer size */
63typedef int ALCsizei;
64
65/** enumerated 32-bit value */
66typedef int ALCenum;
67
68/** 32-bit IEEE754 floating-point */
69typedef float ALCfloat;
70
71/** 64-bit IEEE754 floating-point */
72typedef double ALCdouble;
73
74/** void type (for opaque pointers only) */
75typedef void ALCvoid;
76
77
78/* Enumerant values begin at column 50. No tabs. */
79
80/** Boolean False. */
81#define ALC_FALSE 0
82
83/** Boolean True. */
84#define ALC_TRUE 1
85
86/** Context attribute: <int> Hz. */
87#define ALC_FREQUENCY 0x1007
88
89/** Context attribute: <int> Hz. */
90#define ALC_REFRESH 0x1008
91
92/** Context attribute: AL_TRUE or AL_FALSE. */
93#define ALC_SYNC 0x1009
94
95/** Context attribute: <int> requested Mono (3D) Sources. */
96#define ALC_MONO_SOURCES 0x1010
97
98/** Context attribute: <int> requested Stereo Sources. */
99#define ALC_STEREO_SOURCES 0x1011
100
101/** No error. */
102#define ALC_NO_ERROR 0
103
104/** Invalid device handle. */
105#define ALC_INVALID_DEVICE 0xA001
106
107/** Invalid context handle. */
108#define ALC_INVALID_CONTEXT 0xA002
109
110/** Invalid enum parameter passed to an ALC call. */
111#define ALC_INVALID_ENUM 0xA003
112
113/** Invalid value parameter passed to an ALC call. */
114#define ALC_INVALID_VALUE 0xA004
115
116/** Out of memory. */
117#define ALC_OUT_OF_MEMORY 0xA005
118
119
120/** Runtime ALC version. */
121#define ALC_MAJOR_VERSION 0x1000
122#define ALC_MINOR_VERSION 0x1001
123
124/** Context attribute list properties. */
125#define ALC_ATTRIBUTES_SIZE 0x1002
126#define ALC_ALL_ATTRIBUTES 0x1003
127
128/** String for the default device specifier. */
129#define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004
130/**
131 * String for the given device's specifier.
132 *
133 * If device handle is NULL, it is instead a null-char separated list of
134 * strings of known device specifiers (list ends with an empty string).
135 */
136#define ALC_DEVICE_SPECIFIER 0x1005
137/** String for space-separated list of ALC extensions. */
138#define ALC_EXTENSIONS 0x1006
139
140
141/** Capture extension */
142#define ALC_EXT_CAPTURE 1
143/**
144 * String for the given capture device's specifier.
145 *
146 * If device handle is NULL, it is instead a null-char separated list of
147 * strings of known capture device specifiers (list ends with an empty string).
148 */
149#define ALC_CAPTURE_DEVICE_SPECIFIER 0x310
150/** String for the default capture device specifier. */
151#define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311
152/** Number of sample frames available for capture. */
153#define ALC_CAPTURE_SAMPLES 0x312
154
155
156/** Enumerate All extension */
157#define ALC_ENUMERATE_ALL_EXT 1
158/** String for the default extended device specifier. */
159#define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012
160/**
161 * String for the given extended device's specifier.
162 *
163 * If device handle is NULL, it is instead a null-char separated list of
164 * strings of known extended device specifiers (list ends with an empty string).
165 */
166#define ALC_ALL_DEVICES_SPECIFIER 0x1013
167
168
169/** Context management. */
170ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint* attrlist);
171ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context);
172ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context);
173ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context);
174ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context);
175ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void);
176ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context);
177
178/** Device management. */
179ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename);
180ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device);
181
182
183/**
184 * Error support.
185 *
186 * Obtain the most recent Device error.
187 */
188ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device);
189
190/**
191 * Extension support.
192 *
193 * Query for the presence of an extension, and obtain any appropriate
194 * function pointers and enum values.
195 */
196ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname);
197ALC_API void* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname);
198ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname);
199
200/** Query function. */
201ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param);
202ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
203
204/** Capture function. */
205ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
206ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device);
207ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device);
208ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device);
209ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
210
211/** Pointer-to-function type, useful for dynamically getting ALC entry points. */
212typedef ALCcontext* (ALC_APIENTRY *LPALCCREATECONTEXT)(ALCdevice *device, const ALCint *attrlist);
213typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)(ALCcontext *context);
214typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)(ALCcontext *context);
215typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)(ALCcontext *context);
216typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)(ALCcontext *context);
217typedef ALCcontext* (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)(void);
218typedef ALCdevice* (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)(ALCcontext *context);
219typedef ALCdevice* (ALC_APIENTRY *LPALCOPENDEVICE)(const ALCchar *devicename);
220typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)(ALCdevice *device);
221typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)(ALCdevice *device);
222typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)(ALCdevice *device, const ALCchar *extname);
223typedef void* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname);
224typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname);
225typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)(ALCdevice *device, ALCenum param);
226typedef void (ALC_APIENTRY *LPALCGETINTEGERV)(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
227typedef ALCdevice* (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
228typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)(ALCdevice *device);
229typedef void (ALC_APIENTRY *LPALCCAPTURESTART)(ALCdevice *device);
230typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)(ALCdevice *device);
231typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
232
233#if defined(__cplusplus)
234}
235#endif
236
237#endif /* AL_ALC_H */
238