view include/AL/alc.h @ 0:f9476ff7637e

initial forking of open-al to create multiple listeners
author Robert McIntyre <rlm@mit.edu>
date Tue, 25 Oct 2011 13:02:31 -0700
parents
children
line wrap: on
line source
1 #ifndef AL_ALC_H
2 #define AL_ALC_H
4 #if defined(__cplusplus)
5 extern "C" {
6 #endif
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
18 #if defined(_WIN32)
19 #define ALC_APIENTRY __cdecl
20 #else
21 #define ALC_APIENTRY
22 #endif
24 #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
25 #pragma export on
26 #endif
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
37 #define ALC_VERSION_0_1 1
39 typedef struct ALCdevice_struct ALCdevice;
40 typedef struct ALCcontext_struct ALCcontext;
43 /** 8-bit boolean */
44 typedef char ALCboolean;
46 /** character */
47 typedef char ALCchar;
49 /** signed 8-bit 2's complement integer */
50 typedef signed char ALCbyte;
52 /** unsigned 8-bit integer */
53 typedef unsigned char ALCubyte;
55 /** signed 16-bit 2's complement integer */
56 typedef short ALCshort;
58 /** unsigned 16-bit integer */
59 typedef unsigned short ALCushort;
61 /** signed 32-bit 2's complement integer */
62 typedef int ALCint;
64 /** unsigned 32-bit integer */
65 typedef unsigned int ALCuint;
67 /** non-negative 32-bit binary integer size */
68 typedef int ALCsizei;
70 /** enumerated 32-bit value */
71 typedef int ALCenum;
73 /** 32-bit IEEE754 floating-point */
74 typedef float ALCfloat;
76 /** 64-bit IEEE754 floating-point */
77 typedef double ALCdouble;
79 /** void type (for opaque pointers only) */
80 typedef void ALCvoid;
83 /* Enumerant values begin at column 50. No tabs. */
85 /* Boolean False. */
86 #define ALC_FALSE 0
88 /* Boolean True. */
89 #define ALC_TRUE 1
91 /**
92 * followed by <int> Hz
93 */
94 #define ALC_FREQUENCY 0x1007
96 /**
97 * followed by <int> Hz
98 */
99 #define ALC_REFRESH 0x1008
101 /**
102 * followed by AL_TRUE, AL_FALSE
103 */
104 #define ALC_SYNC 0x1009
106 /**
107 * followed by <int> Num of requested Mono (3D) Sources
108 */
109 #define ALC_MONO_SOURCES 0x1010
111 /**
112 * followed by <int> Num of requested Stereo Sources
113 */
114 #define ALC_STEREO_SOURCES 0x1011
116 /**
117 * errors
118 */
120 /**
121 * No error
122 */
123 #define ALC_NO_ERROR ALC_FALSE
125 /**
126 * No device
127 */
128 #define ALC_INVALID_DEVICE 0xA001
130 /**
131 * invalid context ID
132 */
133 #define ALC_INVALID_CONTEXT 0xA002
135 /**
136 * bad enum
137 */
138 #define ALC_INVALID_ENUM 0xA003
140 /**
141 * bad value
142 */
143 #define ALC_INVALID_VALUE 0xA004
145 /**
146 * Out of memory.
147 */
148 #define ALC_OUT_OF_MEMORY 0xA005
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
158 #define ALC_MAJOR_VERSION 0x1000
159 #define ALC_MINOR_VERSION 0x1001
161 #define ALC_ATTRIBUTES_SIZE 0x1002
162 #define ALC_ALL_ATTRIBUTES 0x1003
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
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
182 /*
183 * Context Management
184 */
185 ALC_API ALCcontext * ALC_APIENTRY alcCreateContext( ALCdevice *device, const ALCint* attrlist );
187 ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context );
189 ALC_API void ALC_APIENTRY alcProcessContext( ALCcontext *context );
191 ALC_API void ALC_APIENTRY alcSuspendContext( ALCcontext *context );
193 ALC_API void ALC_APIENTRY alcDestroyContext( ALCcontext *context );
195 ALC_API ALCcontext * ALC_APIENTRY alcGetCurrentContext( void );
197 ALC_API ALCdevice* ALC_APIENTRY alcGetContextsDevice( ALCcontext *context );
200 /*
201 * Device Management
202 */
203 ALC_API ALCdevice * ALC_APIENTRY alcOpenDevice( const ALCchar *devicename );
205 ALC_API ALCboolean ALC_APIENTRY alcCloseDevice( ALCdevice *device );
208 /*
209 * Error support.
210 * Obtain the most recent Context error
211 */
212 ALC_API ALCenum ALC_APIENTRY alcGetError( ALCdevice *device );
215 /*
216 * Extension support.
217 * Query for the presence of an extension, and obtain any appropriate
218 * function pointers and enum values.
219 */
220 ALC_API ALCboolean ALC_APIENTRY alcIsExtensionPresent( ALCdevice *device, const ALCchar *extname );
222 ALC_API void * ALC_APIENTRY alcGetProcAddress( ALCdevice *device, const ALCchar *funcname );
224 ALC_API ALCenum ALC_APIENTRY alcGetEnumValue( ALCdevice *device, const ALCchar *enumname );
227 /*
228 * Query functions
229 */
230 ALC_API const ALCchar * ALC_APIENTRY alcGetString( ALCdevice *device, ALCenum param );
232 ALC_API void ALC_APIENTRY alcGetIntegerv( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *data );
235 /*
236 * Capture functions
237 */
238 ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
240 ALC_API ALCboolean ALC_APIENTRY alcCaptureCloseDevice( ALCdevice *device );
242 ALC_API void ALC_APIENTRY alcCaptureStart( ALCdevice *device );
244 ALC_API void ALC_APIENTRY alcCaptureStop( ALCdevice *device );
246 ALC_API void ALC_APIENTRY alcCaptureSamples( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
248 /*
249 * Pointer-to-function types, useful for dynamically getting ALC entry points.
250 */
251 typedef ALCcontext * (ALC_APIENTRY *LPALCCREATECONTEXT) (ALCdevice *device, const ALCint *attrlist);
252 typedef ALCboolean (ALC_APIENTRY *LPALCMAKECONTEXTCURRENT)( ALCcontext *context );
253 typedef void (ALC_APIENTRY *LPALCPROCESSCONTEXT)( ALCcontext *context );
254 typedef void (ALC_APIENTRY *LPALCSUSPENDCONTEXT)( ALCcontext *context );
255 typedef void (ALC_APIENTRY *LPALCDESTROYCONTEXT)( ALCcontext *context );
256 typedef ALCcontext * (ALC_APIENTRY *LPALCGETCURRENTCONTEXT)( void );
257 typedef ALCdevice * (ALC_APIENTRY *LPALCGETCONTEXTSDEVICE)( ALCcontext *context );
258 typedef ALCdevice * (ALC_APIENTRY *LPALCOPENDEVICE)( const ALCchar *devicename );
259 typedef ALCboolean (ALC_APIENTRY *LPALCCLOSEDEVICE)( ALCdevice *device );
260 typedef ALCenum (ALC_APIENTRY *LPALCGETERROR)( ALCdevice *device );
261 typedef ALCboolean (ALC_APIENTRY *LPALCISEXTENSIONPRESENT)( ALCdevice *device, const ALCchar *extname );
262 typedef void * (ALC_APIENTRY *LPALCGETPROCADDRESS)(ALCdevice *device, const ALCchar *funcname );
263 typedef ALCenum (ALC_APIENTRY *LPALCGETENUMVALUE)(ALCdevice *device, const ALCchar *enumname );
264 typedef const ALCchar* (ALC_APIENTRY *LPALCGETSTRING)( ALCdevice *device, ALCenum param );
265 typedef void (ALC_APIENTRY *LPALCGETINTEGERV)( ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest );
266 typedef ALCdevice * (ALC_APIENTRY *LPALCCAPTUREOPENDEVICE)( const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize );
267 typedef ALCboolean (ALC_APIENTRY *LPALCCAPTURECLOSEDEVICE)( ALCdevice *device );
268 typedef void (ALC_APIENTRY *LPALCCAPTURESTART)( ALCdevice *device );
269 typedef void (ALC_APIENTRY *LPALCCAPTURESTOP)( ALCdevice *device );
270 typedef void (ALC_APIENTRY *LPALCCAPTURESAMPLES)( ALCdevice *device, ALCvoid *buffer, ALCsizei samples );
272 #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
273 #pragma export off
274 #endif
276 #if defined(__cplusplus)
277 }
278 #endif
280 #endif /* AL_ALC_H */