4 #if defined(__cplusplus)
9 #if defined(AL_LIBTYPE_STATIC)
12 #define ALC_API __declspec(dllimport)
14 #define ALC_API extern
19 #define ALC_APIENTRY __cdecl
26 #include <sound_manager.h>
29 /** Deprecated macro. */
30 #define ALCAPI ALC_API
31 #define ALCAPIENTRY ALC_APIENTRY
34 /** Supported ALC version? */
35 #define ALC_VERSION_0_1 1
37 /** Opaque device handle */
38 typedef struct ALCdevice_struct ALCdevice;
39 /** Opaque context handle */
40 typedef struct ALCcontext_struct ALCcontext;
43 typedef char ALCboolean;
48 /** signed 8-bit 2's complement integer */
49 typedef signed char ALCbyte;
51 /** unsigned 8-bit integer */
52 typedef unsigned char ALCubyte;
54 /** signed 16-bit 2's complement integer */
55 typedef short ALCshort;
57 /** unsigned 16-bit integer */
58 typedef unsigned short ALCushort;
60 /** signed 32-bit 2's complement integer */
63 /** unsigned 32-bit integer */
64 typedef unsigned int ALCuint;
66 /** non-negative 32-bit binary integer size */
69 /** enumerated 32-bit value */
72 /** 32-bit IEEE754 floating-point */
73 typedef float ALCfloat;
75 /** 64-bit IEEE754 floating-point */
76 typedef double ALCdouble;
78 /** void type (for opaque pointers only) */
82 /* Enumerant values begin at column 50. No tabs. */
90 /** Context attribute: <int> Hz. */
91 #define ALC_FREQUENCY 0x1007
93 /** Context attribute: <int> Hz. */
94 #define ALC_REFRESH 0x1008
96 /** Context attribute: AL_TRUE or AL_FALSE. */
97 #define ALC_SYNC 0x1009
99 /** Context attribute: <int> requested Mono (3D) Sources. */
100 #define ALC_MONO_SOURCES 0x1010
102 /** Context attribute: <int> requested Stereo Sources. */
103 #define ALC_STEREO_SOURCES 0x1011
106 #define ALC_NO_ERROR 0
108 /** Invalid device handle. */
109 #define ALC_INVALID_DEVICE 0xA001
111 /** Invalid context handle. */
112 #define ALC_INVALID_CONTEXT 0xA002
114 /** Invalid enum parameter passed to an ALC call. */
115 #define ALC_INVALID_ENUM 0xA003
117 /** Invalid value parameter passed to an ALC call. */
118 #define ALC_INVALID_VALUE 0xA004
120 /** Out of memory. */
121 #define ALC_OUT_OF_MEMORY 0xA005
124 /** Runtime ALC version. */
125 #define ALC_MAJOR_VERSION 0x1000
126 #define ALC_MINOR_VERSION 0x1001
128 /** Context attribute list properties. */
129 #define ALC_ATTRIBUTES_SIZE 0x1002
130 #define ALC_ALL_ATTRIBUTES 0x1003
132 /** String for the default device specifier. */
133 #define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004
135 * String for the given device's specifier.
137 * If device handle is NULL, it is instead a null-char separated list of
138 * strings of known device specifiers (list ends with an empty string).
140 #define ALC_DEVICE_SPECIFIER 0x1005
141 /** String for space-separated list of ALC extensions. */
142 #define ALC_EXTENSIONS 0x1006
145 /** Capture extension */
146 #define ALC_EXT_CAPTURE 1
148 * String for the given capture device's specifier.
150 * If device handle is NULL, it is instead a null-char separated list of
151 * strings of known capture device specifiers (list ends with an empty string).
153 #define ALC_CAPTURE_DEVICE_SPECIFIER 0x310
154 /** String for the default capture device specifier. */
155 #define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311
156 /** Number of sample frames available for capture. */
157 #define ALC_CAPTURE_SAMPLES 0x312
160 /** Enumerate All extension */
161 #define ALC_ENUMERATE_ALL_EXT 1
162 /** String for the default extended device specifier. */
163 #define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012
165 * String for the given extended device's specifier.
167 * If device handle is NULL, it is instead a null-char separated list of
168 * strings of known extended device specifiers (list ends with an empty string).
170 #define ALC_ALL_DEVICES_SPECIFIER 0x1013
173 /** Context management. */
174 ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint* attrlist);
175 ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context);
176 ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context);
177 ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context);
178 ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context);
179 ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void);
180 ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context);
182 /** Device management. */
183 ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename);
185 ALC_API ALCdevice* ALC_APIENTRY alcOpenDeviceNew(const ALCchar *devicename, sound_stream_info_h stream_info);
187 ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device);
193 * Obtain the most recent Device error.
195 ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device);
200 * Query for the presence of an extension, and obtain any appropriate
201 * function pointers and enum values.
203 ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname);
204 ALC_API void* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname);
205 ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname);
207 /** Query function. */
208 ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param);
209 ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
211 /** Capture function. */
212 ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
213 ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device);
214 ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device);
215 ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device);
216 ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
218 /** Pointer-to-function type, useful for dynamically getting ALC entry points. */
219 typedef ALCcontext* (ALC_APIENTRY *LPALCCREATECONTEXT)(ALCdevice *device, const ALCint *attrlist);
220 typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)(ALCcontext *context);
221 typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)(ALCcontext *context);
222 typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)(ALCcontext *context);
223 typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)(ALCcontext *context);
224 typedef ALCcontext* (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)(void);
225 typedef ALCdevice* (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)(ALCcontext *context);
226 typedef ALCdevice* (ALC_APIENTRY *LPALCOPENDEVICE)(const ALCchar *devicename);
227 typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)(ALCdevice *device);
228 typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)(ALCdevice *device);
229 typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)(ALCdevice *device, const ALCchar *extname);
230 typedef void* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname);
231 typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname);
232 typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)(ALCdevice *device, ALCenum param);
233 typedef void (ALC_APIENTRY *LPALCGETINTEGERV)(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values);
234 typedef ALCdevice* (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize);
235 typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)(ALCdevice *device);
236 typedef void (ALC_APIENTRY *LPALCCAPTURESTART)(ALCdevice *device);
237 typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)(ALCdevice *device);
238 typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples);
240 #if defined(__cplusplus)
244 #endif /* AL_ALC_H */