9 #if defined(AL_LIBTYPE_STATIC)
12 #define ALC_API __declspec(dllimport)
14 #define ALC_API extern
19 #define ALC_APIENTRY __cdecl
25 /* Deprecated macros. */
26 #define ALCAPI ALC_API
27 #define ALCAPIENTRY ALC_APIENTRY
30 /** Supported ALC version? */
31 #define ALC_VERSION_0_1 1
33 /** Opaque device handle */
34 typedef struct ALCdevice ALCdevice;
35 /** Opaque context handle */
36 typedef struct ALCcontext ALCcontext;
39 typedef char ALCboolean;
44 /** signed 8-bit integer */
45 typedef signed char ALCbyte;
47 /** unsigned 8-bit integer */
48 typedef unsigned char ALCubyte;
50 /** signed 16-bit integer */
51 typedef short ALCshort;
53 /** unsigned 16-bit integer */
54 typedef unsigned short ALCushort;
56 /** signed 32-bit integer */
59 /** unsigned 32-bit integer */
60 typedef unsigned int ALCuint;
62 /** non-negative 32-bit integer size */
65 /** 32-bit enumeration value */
68 /** 32-bit IEEE-754 floating-point */
69 typedef float ALCfloat;
71 /** 64-bit IEEE-754 floating-point */
72 typedef double ALCdouble;
74 /** void type (for opaque pointers only) */
78 /* Enumeration values begin at column 50. Do not use tabs. */
86 /** Context attribute: <int> Hz. */
87 #define ALC_FREQUENCY 0x1007
89 /** Context attribute: <int> Hz. */
90 #define ALC_REFRESH 0x1008
92 /** Context attribute: AL_TRUE or AL_FALSE synchronous context? */
93 #define ALC_SYNC 0x1009
95 /** Context attribute: <int> requested Mono (3D) Sources. */
96 #define ALC_MONO_SOURCES 0x1010
98 /** Context attribute: <int> requested Stereo Sources. */
99 #define ALC_STEREO_SOURCES 0x1011
102 #define ALC_NO_ERROR 0
104 /** Invalid device handle. */
105 #define ALC_INVALID_DEVICE 0xA001
107 /** Invalid context handle. */
108 #define ALC_INVALID_CONTEXT 0xA002
110 /** Invalid enumeration passed to an ALC call. */
111 #define ALC_INVALID_ENUM 0xA003
113 /** Invalid value passed to an ALC call. */
114 #define ALC_INVALID_VALUE 0xA004
116 /** Out of memory. */
117 #define ALC_OUT_OF_MEMORY 0xA005
120 /** Runtime ALC major version. */
121 #define ALC_MAJOR_VERSION 0x1000
122 /** Runtime ALC minor version. */
123 #define ALC_MINOR_VERSION 0x1001
125 /** Context attribute list size. */
126 #define ALC_ATTRIBUTES_SIZE 0x1002
127 /** Context attribute list properties. */
128 #define ALC_ALL_ATTRIBUTES 0x1003
130 /** String for the default device specifier. */
131 #define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004
133 * Device specifier string.
135 * If device handle is NULL, it is instead a null-character separated list of
136 * strings of known device specifiers (list ends with an empty string).
138 #define ALC_DEVICE_SPECIFIER 0x1005
139 /** String for space-separated list of ALC extensions. */
140 #define ALC_EXTENSIONS 0x1006
143 /** Capture extension */
144 #define ALC_EXT_CAPTURE 1
146 * Capture device specifier string.
148 * If device handle is NULL, it is instead a null-character separated list of
149 * strings of known capture device specifiers (list ends with an empty string).
151 #define ALC_CAPTURE_DEVICE_SPECIFIER 0x310
152 /** String for the default capture device specifier. */
153 #define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311
154 /** Number of sample frames available for capture. */
155 #define ALC_CAPTURE_SAMPLES 0x312
158 /** Enumerate All extension */
159 #define ALC_ENUMERATE_ALL_EXT 1
160 /** String for the default extended device specifier. */
161 #define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012
163 * Device's extended specifier string.
165 * If device handle is NULL, it is instead a null-character separated list of
166 * strings of known extended device specifiers (list ends with an empty string).
168 #define ALC_ALL_DEVICES_SPECIFIER 0x1013
171 #ifndef ALC_NO_PROTOTYPES
172 /* Context management. */
174 /** Create and attach a context to the given device. */
175 ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint *attrlist);
177 * Makes the given context the active process-wide context. Passing NULL clears
178 * the active context.
180 ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context);
181 /** Resumes processing updates for the given context. */
182 ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context);
183 /** Suspends updates for the given context. */
184 ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context);
185 /** Remove a context from its device and destroys it. */
186 ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context);
187 /** Returns the currently active context. */
188 ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void);
189 /** Returns the device that a particular context is attached to. */
190 ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context);
192 /* Device management. */
194 /** Opens the named playback device. */
195 ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename);
196 /** Closes the given playback device. */
197 ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device);
201 /** Obtain the most recent Device error. */
202 ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device);
204 /* Extension support. */
207 * Query for the presence of an extension on the device. Pass a NULL device to
208 * query a device-inspecific extension.
210 ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname);
212 * Retrieve the address of a function. Given a non-NULL device, the returned
213 * function may be device-specific.
215 ALC_API ALCvoid* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname);
217 * Retrieve the value of an enum. Given a non-NULL device, the returned value
218 * may be device-specific.
220 ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname);
222 /* Query functions. */
224 /** Returns information about the device, and error strings. */
225 ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param);
226 /** Returns information about the device and the version of OpenAL. */
227 ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
229 /* Capture functions. */
232 * Opens the named capture device with the given frequency, format, and buffer
235 ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
236 /** Closes the given capture device. */
237 ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device);
238 /** Starts capturing samples into the device buffer. */
239 ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device);
240 /** Stops capturing samples. Samples in the device buffer remain available. */
241 ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device);
242 /** Reads samples from the device buffer. */
243 ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
244 #endif /* ALC_NO_PROTOTYPES */
246 /* Pointer-to-function types, useful for storing dynamically loaded ALC entry
249 typedef ALCcontext* (ALC_APIENTRY *LPALCCREATECONTEXT)(ALCdevice *device, const ALCint *attrlist);
250 typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)(ALCcontext *context);
251 typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)(ALCcontext *context);
252 typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)(ALCcontext *context);
253 typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)(ALCcontext *context);
254 typedef ALCcontext* (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)(void);
255 typedef ALCdevice* (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)(ALCcontext *context);
256 typedef ALCdevice* (ALC_APIENTRY *LPALCOPENDEVICE)(const ALCchar *devicename);
257 typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)(ALCdevice *device);
258 typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)(ALCdevice *device);
259 typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)(ALCdevice *device, const ALCchar *extname);
260 typedef ALCvoid* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname);
261 typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname);
262 typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)(ALCdevice *device, ALCenum param);
263 typedef void (ALC_APIENTRY *LPALCGETINTEGERV)(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
264 typedef ALCdevice* (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
265 typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)(ALCdevice *device);
266 typedef void (ALC_APIENTRY *LPALCCAPTURESTART)(ALCdevice *device);
267 typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)(ALCdevice *device);
268 typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
274 #endif /* AL_ALC_H */