Don't run the release CI step for pull requests
[openal-soft.git] / include / AL / alc.h
blob3311b57fbbc665d7f89a3d24e61eabc275f0d454
1 #ifndef AL_ALC_H
2 #define AL_ALC_H
4 /* NOLINTBEGIN */
5 #ifdef __cplusplus
6 extern "C" {
8 #ifndef AL_DISABLE_NOEXCEPT
9 #define ALC_API_NOEXCEPT noexcept
10 #if __cplusplus >= 201703L
11 #define ALC_API_NOEXCEPT17 noexcept
12 #else
13 #define ALC_API_NOEXCEPT17
14 #endif
16 #else /* AL_DISABLE_NOEXCEPT */
18 #define ALC_API_NOEXCEPT
19 #define ALC_API_NOEXCEPT17
20 #endif
22 #else /* __cplusplus */
24 #define ALC_API_NOEXCEPT
25 #define ALC_API_NOEXCEPT17
26 #endif
28 #ifndef ALC_API
29 #if defined(AL_LIBTYPE_STATIC)
30 #define ALC_API
31 #elif defined(_WIN32)
32 #define ALC_API __declspec(dllimport)
33 #else
34 #define ALC_API extern
35 #endif
36 #endif
38 #ifdef _WIN32
39 #define ALC_APIENTRY __cdecl
40 #else
41 #define ALC_APIENTRY
42 #endif
45 /* Deprecated macros. */
46 #define ALCAPI ALC_API
47 #define ALCAPIENTRY ALC_APIENTRY
48 #define ALC_INVALID 0
50 /** Supported ALC version? */
51 #define ALC_VERSION_0_1 1
53 /** Opaque device handle */
54 typedef struct ALCdevice ALCdevice;
55 /** Opaque context handle */
56 typedef struct ALCcontext ALCcontext;
58 /** 8-bit boolean */
59 typedef char ALCboolean;
61 /** character */
62 typedef char ALCchar;
64 /** signed 8-bit integer */
65 typedef signed char ALCbyte;
67 /** unsigned 8-bit integer */
68 typedef unsigned char ALCubyte;
70 /** signed 16-bit integer */
71 typedef short ALCshort;
73 /** unsigned 16-bit integer */
74 typedef unsigned short ALCushort;
76 /** signed 32-bit integer */
77 typedef int ALCint;
79 /** unsigned 32-bit integer */
80 typedef unsigned int ALCuint;
82 /** non-negative 32-bit integer size */
83 typedef int ALCsizei;
85 /** 32-bit enumeration value */
86 typedef int ALCenum;
88 /** 32-bit IEEE-754 floating-point */
89 typedef float ALCfloat;
91 /** 64-bit IEEE-754 floating-point */
92 typedef double ALCdouble;
94 /** void type (for opaque pointers only) */
95 typedef void ALCvoid;
98 /* Enumeration values begin at column 50. Do not use tabs. */
100 /** Boolean False. */
101 #define ALC_FALSE 0
103 /** Boolean True. */
104 #define ALC_TRUE 1
106 /** Context attribute: <int> Hz. */
107 #define ALC_FREQUENCY 0x1007
109 /** Context attribute: <int> Hz. */
110 #define ALC_REFRESH 0x1008
112 /** Context attribute: AL_TRUE or AL_FALSE synchronous context? */
113 #define ALC_SYNC 0x1009
115 /** Context attribute: <int> requested Mono (3D) Sources. */
116 #define ALC_MONO_SOURCES 0x1010
118 /** Context attribute: <int> requested Stereo Sources. */
119 #define ALC_STEREO_SOURCES 0x1011
121 /** No error. */
122 #define ALC_NO_ERROR 0
124 /** Invalid device handle. */
125 #define ALC_INVALID_DEVICE 0xA001
127 /** Invalid context handle. */
128 #define ALC_INVALID_CONTEXT 0xA002
130 /** Invalid enumeration passed to an ALC call. */
131 #define ALC_INVALID_ENUM 0xA003
133 /** Invalid value passed to an ALC call. */
134 #define ALC_INVALID_VALUE 0xA004
136 /** Out of memory. */
137 #define ALC_OUT_OF_MEMORY 0xA005
140 /** Runtime ALC major version. */
141 #define ALC_MAJOR_VERSION 0x1000
142 /** Runtime ALC minor version. */
143 #define ALC_MINOR_VERSION 0x1001
145 /** Context attribute list size. */
146 #define ALC_ATTRIBUTES_SIZE 0x1002
147 /** Context attribute list properties. */
148 #define ALC_ALL_ATTRIBUTES 0x1003
150 /** String for the default device specifier. */
151 #define ALC_DEFAULT_DEVICE_SPECIFIER 0x1004
153 * Device specifier string.
155 * If device handle is NULL, it is instead a null-character separated list of
156 * strings of known device specifiers (list ends with an empty string).
158 #define ALC_DEVICE_SPECIFIER 0x1005
159 /** String for space-separated list of ALC extensions. */
160 #define ALC_EXTENSIONS 0x1006
163 /** Capture extension */
164 #define ALC_EXT_CAPTURE 1
166 * Capture device specifier string.
168 * If device handle is NULL, it is instead a null-character separated list of
169 * strings of known capture device specifiers (list ends with an empty string).
171 #define ALC_CAPTURE_DEVICE_SPECIFIER 0x310
172 /** String for the default capture device specifier. */
173 #define ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER 0x311
174 /** Number of sample frames available for capture. */
175 #define ALC_CAPTURE_SAMPLES 0x312
178 /** Enumerate All extension */
179 #define ALC_ENUMERATE_ALL_EXT 1
180 /** String for the default extended device specifier. */
181 #define ALC_DEFAULT_ALL_DEVICES_SPECIFIER 0x1012
183 * Device's extended specifier string.
185 * If device handle is NULL, it is instead a null-character separated list of
186 * strings of known extended device specifiers (list ends with an empty string).
188 #define ALC_ALL_DEVICES_SPECIFIER 0x1013
191 #ifndef ALC_NO_PROTOTYPES
192 /* Context management. */
194 /** Create and attach a context to the given device. */
195 ALC_API ALCcontext* ALC_APIENTRY alcCreateContext(ALCdevice *device, const ALCint *attrlist) ALC_API_NOEXCEPT;
197 * Makes the given context the active process-wide context. Passing NULL clears
198 * the active context.
200 ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent(ALCcontext *context) ALC_API_NOEXCEPT;
201 /** Resumes processing updates for the given context. */
202 ALC_API void ALC_APIENTRY alcProcessContext(ALCcontext *context) ALC_API_NOEXCEPT;
203 /** Suspends updates for the given context. */
204 ALC_API void ALC_APIENTRY alcSuspendContext(ALCcontext *context) ALC_API_NOEXCEPT;
205 /** Remove a context from its device and destroys it. */
206 ALC_API void ALC_APIENTRY alcDestroyContext(ALCcontext *context) ALC_API_NOEXCEPT;
207 /** Returns the currently active context. */
208 ALC_API ALCcontext* ALC_APIENTRY alcGetCurrentContext(void) ALC_API_NOEXCEPT;
209 /** Returns the device that a particular context is attached to. */
210 ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice(ALCcontext *context) ALC_API_NOEXCEPT;
212 /* Device management. */
214 /** Opens the named playback device. */
215 ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename) ALC_API_NOEXCEPT;
216 /** Closes the given playback device. */
217 ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device) ALC_API_NOEXCEPT;
219 /* Error support. */
221 /** Obtain the most recent Device error. */
222 ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device) ALC_API_NOEXCEPT;
224 /* Extension support. */
227 * Query for the presence of an extension on the device. Pass a NULL device to
228 * query a device-inspecific extension.
230 ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname) ALC_API_NOEXCEPT;
232 * Retrieve the address of a function. Given a non-NULL device, the returned
233 * function may be device-specific.
235 ALC_API ALCvoid* ALC_APIENTRY alcGetProcAddress(ALCdevice *device, const ALCchar *funcname) ALC_API_NOEXCEPT;
237 * Retrieve the value of an enum. Given a non-NULL device, the returned value
238 * may be device-specific.
240 ALC_API ALCenum ALC_APIENTRY alcGetEnumValue(ALCdevice *device, const ALCchar *enumname) ALC_API_NOEXCEPT;
242 /* Query functions. */
244 /** Returns information about the device, and error strings. */
245 ALC_API const ALCchar* ALC_APIENTRY alcGetString(ALCdevice *device, ALCenum param) ALC_API_NOEXCEPT;
246 /** Returns information about the device and the version of OpenAL. */
247 ALC_API void ALC_APIENTRY alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values) ALC_API_NOEXCEPT;
249 /* Capture functions. */
252 * Opens the named capture device with the given frequency, format, and buffer
253 * size.
255 ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize) ALC_API_NOEXCEPT;
256 /** Closes the given capture device. */
257 ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice(ALCdevice *device) ALC_API_NOEXCEPT;
258 /** Starts capturing samples into the device buffer. */
259 ALC_API void ALC_APIENTRY alcCaptureStart(ALCdevice *device) ALC_API_NOEXCEPT;
260 /** Stops capturing samples. Samples in the device buffer remain available. */
261 ALC_API void ALC_APIENTRY alcCaptureStop(ALCdevice *device) ALC_API_NOEXCEPT;
262 /** Reads samples from the device buffer. */
263 ALC_API void ALC_APIENTRY alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples) ALC_API_NOEXCEPT;
264 #endif /* ALC_NO_PROTOTYPES */
266 /* Pointer-to-function types, useful for storing dynamically loaded ALC entry
267 * points.
269 typedef ALCcontext* (ALC_APIENTRY *LPALCCREATECONTEXT)(ALCdevice *device, const ALCint *attrlist) ALC_API_NOEXCEPT17;
270 typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)(ALCcontext *context) ALC_API_NOEXCEPT17;
271 typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)(ALCcontext *context) ALC_API_NOEXCEPT17;
272 typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)(ALCcontext *context) ALC_API_NOEXCEPT17;
273 typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)(ALCcontext *context) ALC_API_NOEXCEPT17;
274 typedef ALCcontext* (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)(void) ALC_API_NOEXCEPT17;
275 typedef ALCdevice* (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)(ALCcontext *context) ALC_API_NOEXCEPT17;
276 typedef ALCdevice* (ALC_APIENTRY *LPALCOPENDEVICE)(const ALCchar *devicename) ALC_API_NOEXCEPT17;
277 typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)(ALCdevice *device) ALC_API_NOEXCEPT17;
278 typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)(ALCdevice *device) ALC_API_NOEXCEPT17;
279 typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)(ALCdevice *device, const ALCchar *extname) ALC_API_NOEXCEPT17;
280 typedef ALCvoid* (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname) ALC_API_NOEXCEPT17;
281 typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname) ALC_API_NOEXCEPT17;
282 typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)(ALCdevice *device, ALCenum param) ALC_API_NOEXCEPT17;
283 typedef void (ALC_APIENTRY *LPALCGETINTEGERV)(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *values) ALC_API_NOEXCEPT17;
284 typedef ALCdevice* (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize) ALC_API_NOEXCEPT17;
285 typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)(ALCdevice *device) ALC_API_NOEXCEPT17;
286 typedef void (ALC_APIENTRY *LPALCCAPTURESTART)(ALCdevice *device) ALC_API_NOEXCEPT17;
287 typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)(ALCdevice *device) ALC_API_NOEXCEPT17;
288 typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)(ALCdevice *device, ALCvoid *buffer, ALCsizei samples) ALC_API_NOEXCEPT17;
290 #ifdef __cplusplus
291 } /* extern "C" */
292 #endif
293 /* NOLINTEND */
295 #endif /* AL_ALC_H */