Revert "Set PKG_CONFIG_CFLAGS properly"
[platform/upstream/openal-soft.git] / include / AL / alc.h
1 #ifndef AL_ALC_H
2 #define AL_ALC_H
3
4 #if defined(__cplusplus)
5 extern "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 #define __TIZEN__
25 #ifdef __TIZEN__
26 #include <sound_manager.h>
27 #endif
28
29 /** Deprecated macro. */
30 #define ALCAPI                                   ALC_API
31 #define ALCAPIENTRY                              ALC_APIENTRY
32 #define ALC_INVALID                              0
33
34 /** Supported ALC version? */
35 #define ALC_VERSION_0_1                          1
36
37 /** Opaque device handle */
38 typedef struct ALCdevice_struct ALCdevice;
39 /** Opaque context handle */
40 typedef struct ALCcontext_struct ALCcontext;
41
42 /** 8-bit boolean */
43 typedef char ALCboolean;
44
45 /** character */
46 typedef char ALCchar;
47
48 /** signed 8-bit 2's complement integer */
49 typedef signed char ALCbyte;
50
51 /** unsigned 8-bit integer */
52 typedef unsigned char ALCubyte;
53
54 /** signed 16-bit 2's complement integer */
55 typedef short ALCshort;
56
57 /** unsigned 16-bit integer */
58 typedef unsigned short ALCushort;
59
60 /** signed 32-bit 2's complement integer */
61 typedef int ALCint;
62
63 /** unsigned 32-bit integer */
64 typedef unsigned int ALCuint;
65
66 /** non-negative 32-bit binary integer size */
67 typedef int ALCsizei;
68
69 /** enumerated 32-bit value */
70 typedef int ALCenum;
71
72 /** 32-bit IEEE754 floating-point */
73 typedef float ALCfloat;
74
75 /** 64-bit IEEE754 floating-point */
76 typedef double ALCdouble;
77
78 /** void type (for opaque pointers only) */
79 typedef void ALCvoid;
80
81
82 /* Enumerant values begin at column 50. No tabs. */
83
84 /** Boolean False. */
85 #define ALC_FALSE                                0
86
87 /** Boolean True. */
88 #define ALC_TRUE                                 1
89
90 /** Context attribute: <int> Hz. */
91 #define ALC_FREQUENCY                            0x1007
92
93 /** Context attribute: <int> Hz. */
94 #define ALC_REFRESH                              0x1008
95
96 /** Context attribute: AL_TRUE or AL_FALSE. */
97 #define ALC_SYNC                                 0x1009
98
99 /** Context attribute: <int> requested Mono (3D) Sources. */
100 #define ALC_MONO_SOURCES                         0x1010
101
102 /** Context attribute: <int> requested Stereo Sources. */
103 #define ALC_STEREO_SOURCES                       0x1011
104
105 /** No error. */
106 #define ALC_NO_ERROR                             0
107
108 /** Invalid device handle. */
109 #define ALC_INVALID_DEVICE                       0xA001
110
111 /** Invalid context handle. */
112 #define ALC_INVALID_CONTEXT                      0xA002
113
114 /** Invalid enum parameter passed to an ALC call. */
115 #define ALC_INVALID_ENUM                         0xA003
116
117 /** Invalid value parameter passed to an ALC call. */
118 #define ALC_INVALID_VALUE                        0xA004
119
120 /** Out of memory. */
121 #define ALC_OUT_OF_MEMORY                        0xA005
122
123
124 /** Runtime ALC version. */
125 #define ALC_MAJOR_VERSION                        0x1000
126 #define ALC_MINOR_VERSION                        0x1001
127
128 /** Context attribute list properties. */
129 #define ALC_ATTRIBUTES_SIZE                      0x1002
130 #define ALC_ALL_ATTRIBUTES                       0x1003
131
132 /** String for the default device specifier. */
133 #define ALC_DEFAULT_DEVICE_SPECIFIER             0x1004
134 /**
135  * String for the given device's specifier.
136  *
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).
139  */
140 #define ALC_DEVICE_SPECIFIER                     0x1005
141 /** String for space-separated list of ALC extensions. */
142 #define ALC_EXTENSIONS                           0x1006
143
144
145 /** Capture extension */
146 #define ALC_EXT_CAPTURE 1
147 /**
148  * String for the given capture device's specifier.
149  *
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).
152  */
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
158
159
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
164 /**
165  * String for the given extended device's specifier.
166  *
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).
169  */
170 #define ALC_ALL_DEVICES_SPECIFIER                0x1013
171
172
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);
181
182 /** Device management. */
183 ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename);
184 #ifdef __TIZEN__
185 ALC_API ALCdevice* ALC_APIENTRY alcOpenDeviceNew(const ALCchar *devicename, sound_stream_info_h stream_info);
186 #endif
187 ALC_API ALCboolean ALC_APIENTRY alcCloseDevice(ALCdevice *device);
188
189
190 /**
191  * Error support.
192  *
193  * Obtain the most recent Device error.
194  */
195 ALC_API ALCenum ALC_APIENTRY alcGetError(ALCdevice *device);
196
197 /**
198  * Extension support.
199  *
200  * Query for the presence of an extension, and obtain any appropriate
201  * function pointers and enum values.
202  */
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);
206
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);
210
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);
217
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);
239
240 #if defined(__cplusplus)
241 }
242 #endif
243
244 #endif /* AL_ALC_H */