1 #ifndef _ALTYPES_H_
2 #define _ALTYPES_H_
3 
4 /**
5  * OpenAL cross platform audio library
6  * Copyright (C) 1999-2000 by authors.
7  * This library is free software; you can redistribute it and/or
8  *  modify it under the terms of the GNU Library General Public
9  *  License as published by the Free Software Foundation; either
10  *  version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  *  Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  *  License along with this library; if not, write to the
19  *  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20  *  Boston, MA  02111-1307, USA.
21  * Or go to http://www.gnu.org/copyleft/lgpl.html
22  */
23 
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 /** OpenAL boolean type. */
30 typedef char ALboolean;
31 
32 /** OpenAL 8bit signed byte. */
33 typedef char ALbyte;
34 
35 /** OpenAL 8bit unsigned byte. */
36 typedef unsigned char ALubyte;
37 
38 /** OpenAL 16bit signed short integer type. */
39 typedef short ALshort;
40 
41 /** OpenAL 16bit unsigned short integer type. */
42 typedef unsigned short ALushort;
43 
44 /** OpenAL 32bit unsigned integer type. */
45 typedef unsigned ALuint;
46 
47 /** OpenAL 32bit signed integer type. */
48 typedef int ALint;
49 
50 /** OpenAL 32bit floating point type. */
51 typedef float ALfloat;
52 
53 /** OpenAL 64bit double point type. */
54 typedef double ALdouble;
55 
56 /** OpenAL 32bit type. */
57 typedef unsigned int ALsizei;
58 
59 /** OpenAL void type */
60 typedef void ALvoid;
61 
62 /** OpenAL enumerations. */
63 typedef int ALenum;
64 
65 /* Bad value. */
66 #define AL_INVALID                               (-1)
67 
68 /* Disable value. */
69 #define AL_NONE									 0
70 
71 /* Boolean False. */
72 #define AL_FALSE                                 0
73 
74 /* Boolean True. */
75 #define AL_TRUE                                  1
76 
77 /**
78   * Indicate the type of AL_SOURCE.
79   * Sources can be spatialized
80   */
81 #define AL_SOURCE_TYPE                           0x200
82 
83 /** Indicate source has absolute coordinates. */
84 #define AL_SOURCE_ABSOLUTE                       0x201
85 
86 /** Indicate Source has listener relative coordinates. */
87 #define AL_SOURCE_RELATIVE                       0x202
88 
89 /**
90  * Directional source, inner cone angle, in degrees.
91  * Range:    [0-360]
92  * Default:  360
93  */
94 #define AL_CONE_INNER_ANGLE                      0x1001
95 
96 /**
97  * Directional source, outer cone angle, in degrees.
98  * Range:    [0-360]
99  * Default:  360
100  */
101 #define AL_CONE_OUTER_ANGLE                      0x1002
102 
103 /**
104  * Specify the pitch to be applied, either at source,
105  *  or on mixer results, at listener.
106  * Range:	 [0.5-2.0]
107  * Default:  1.0
108  */
109 #define AL_PITCH                                 0x1003
110 
111 /**
112  * Specify the current location in three dimensional space.
113  * OpenAL, like OpenGL, uses a right handed coordinate system,
114  *  where in a frontal default view X (thumb) points right,
115  *  Y points up (index finger), and Z points towards the
116  *  viewer/camera (middle finger).
117  * To switch from a left handed coordinate system, flip the
118  *  sign on the Z coordinate.
119  * Listener position is always in the world coordinate system.
120  */
121 #define AL_POSITION                              0x1004
122 
123 /** Specify the current direction as forward vector. */
124 #define AL_DIRECTION                             0x1005
125 
126 /** Specify the current velocity in three dimensional space. */
127 #define AL_VELOCITY                              0x1006
128 
129 /**
130  * Indicate whether source has to loop infinite.
131  * Type: ALboolean
132  * Range:    [AL_TRUE, AL_FALSE]
133  * Default:  AL_FALSE
134  */
135 #define AL_LOOPING                               0x1007
136 
137 /**
138  * Indicate the buffer to provide sound samples.
139  * Type: ALuint.
140  * Range: any valid Buffer id.
141  */
142 #define AL_BUFFER                                0x1009
143 
144 /**
145  * Indicate the gain (volume amplification) applied.
146  * Type:     ALfloat.
147  * Range:    ]0.0-  ]
148  * A value of 1.0 means un-attenuated/unchanged.
149  * Each division by 2 equals an attenuation of -6dB.
150  * Each multiplicaton with 2 equals an amplification of +6dB.
151  * A value of 0.0 is meaningless with respect to a logarithmic
152  *  scale; it is interpreted as zero volume - the channel
153  *  is effectively disabled.
154  */
155 #define AL_GAIN                                  0x100A
156 
157 /**
158  * Indicate minimum source attenuation.
159  * Type:     ALfloat
160  * Range:	 [0.0 - 1.0]
161  */
162 #define AL_MIN_GAIN                              0x100D
163 
164 /**
165  * Indicate maximum source attenuation.
166  * Type:	 ALfloat
167  * Range:	 [0.0 - 1.0]
168  */
169 #define AL_MAX_GAIN                              0x100E
170 
171 /**
172  * Specify the current orientation.
173  * Type:	 ALfv6 (at/up)
174  * Range:	 N/A
175  */
176 #define AL_ORIENTATION                           0x100F
177 
178 /* byte offset into source (in canon format).  -1 if source
179  * is not playing.  Don't set this, get this.
180  *
181  * Type:     ALfloat
182  * Range:    [0.0 - ]
183  * Default:  1.0
184  */
185 #define AL_REFERENCE_DISTANCE                    0x1020
186 
187  /**
188  * Indicate the rolloff factor for the source.
189  * Type: ALfloat
190  * Range:    [0.0 - ]
191  * Default:  1.0
192  */
193 #define AL_ROLLOFF_FACTOR                        0x1021
194 
195 /**
196  * Indicate the gain (volume amplification) applied.
197  * Type:     ALfloat.
198  * Range:    ]0.0-  ]
199  * A value of 1.0 means un-attenuated/unchanged.
200  * Each division by 2 equals an attenuation of -6dB.
201  * Each multiplicaton with 2 equals an amplification of +6dB.
202  * A value of 0.0 is meaningless with respect to a logarithmic
203  *  scale; it is interpreted as zero volume - the channel
204  *  is effectively disabled.
205  */
206 #define AL_CONE_OUTER_GAIN                       0x1022
207 
208 /**
209  * Specify the maximum distance.
210  * Type:	 ALfloat
211  * Range:	 [0.0 - ]
212  */
213 #define AL_MAX_DISTANCE                          0x1023
214 
215 /**
216  * Specify the panning to be applied (2D only.)
217  * Range:	 [-1.0 - 1.0]
218  * Default:  0.0
219  */
220 #define AL_PAN                                   0x1024
221 
222 /**
223  * Get the playing time of a stream.
224  * Range:	 [0.0 - infinity]
225  */
226 #define AL_TIME                                   0x1025
227 
228 /**
229  * Specify the channel mask. (Creative)
230  * Type:	 ALuint
231  * Range:	 [0 - 255]
232  */
233 #define AL_CHANNEL_MASK							 0x3000
234 
235 /**
236  * Source state information
237  */
238 #define AL_SOURCE_STATE                          0x1010
239 #define AL_INITIAL                               0x1011
240 #define AL_PLAYING                               0x1012
241 #define AL_PAUSED                                0x1013
242 #define AL_STOPPED                               0x1014
243 
244 /**
245  * Buffer Queue params
246  */
247 #define AL_BUFFERS_QUEUED                        0x1015
248 #define AL_BUFFERS_PROCESSED                     0x1016
249 
250 /** Sound buffers: format specifier. */
251 #define AL_FORMAT_MONO8                          0x1100
252 #define AL_FORMAT_MONO16                         0x1101
253 #define AL_FORMAT_STEREO8                        0x1102
254 #define AL_FORMAT_STEREO16                       0x1103
255 #define AL_FORMAT_MONO4                          0x1104
256 #define AL_FORMAT_STEREO4                        0x1105
257 
258 /**
259  * Sound buffers: frequency, in units of Hertz [Hz].
260  * This is the number of samples per second. Half of the
261  *  sample frequency marks the maximum significant
262  *  frequency component.
263  */
264 #define AL_FREQUENCY                             0x2001
265 #define AL_BITS                                  0x2002
266 #define AL_CHANNELS                              0x2003
267 #define AL_SIZE                                  0x2004
268 #define AL_DATA                                  0x2005
269 
270 /**
271  * Buffer state.
272  *
273  * Not supported for public use (yet).
274  */
275 #define AL_UNUSED                                0x2010
276 #define AL_PENDING                               0x2011
277 #define AL_PROCESSED                             0x2012
278 
279 /** Errors: No Error. */
280 #define AL_NO_ERROR                              AL_FALSE
281 
282 /**
283  * Illegal name passed as an argument to an AL call.
284  */
285 #define AL_INVALID_NAME                          0xA001
286 
287 /**
288  * Illegal enum passed as an argument to an AL call.
289  */
290 #define AL_INVALID_ENUM                          0xA002
291 /**
292  * Illegal value passed as an argument to an AL call.
293  * Applies to parameter values, but not to enumerations.
294  */
295 #define AL_INVALID_VALUE                         0xA003
296 
297 /**
298  * A function was called at inappropriate time,
299  *  or in an inappropriate way, causing an illegal state.
300  * This can be an incompatible ALenum, object ID,
301  *  and/or function.
302  */
303 #define AL_INVALID_OPERATION                     0xA004
304 
305 /**
306  * A function could not be completed,
307  * because there is not enough memory available.
308  */
309 #define AL_OUT_OF_MEMORY                         0xA005
310 
311 /** Context strings: Vendor Name. */
312 #define AL_VENDOR                                0xB001
313 #define AL_VERSION                               0xB002
314 #define AL_RENDERER                              0xB003
315 #define AL_EXTENSIONS                            0xB004
316 #define AL_MEMORY_USED                           0xB005
317 #define AL_MEMORY_ALLOCATOR                      0xB006
318 #define AL_MEMORY_DEALLOCATOR                    0xB007
319 #define AL_STEREO                                0xB008
320 
321 /** Global tweakage. */
322 
323 /**
324  * Doppler scale.  Default 1.0
325  */
326 #define AL_DOPPLER_FACTOR                        0xC000
327 
328 /**
329  * Doppler velocity.  Default 1.0
330  */
331 #define AL_DOPPLER_VELOCITY                      0xC001
332 
333 /**
334  * Distance model.  Default AL_INVERSE_DISTANCE_CLAMPED
335  */
336 #define AL_DISTANCE_MODEL                        0xD000
337 
338 /** Distance models. */
339 
340 #define AL_INVERSE_DISTANCE                      0xD001
341 #define AL_INVERSE_DISTANCE_CLAMPED              0xD002
342 
343  /**
344  * enables
345  */
346 
347 #ifdef __cplusplus
348 }
349 #endif
350 
351 #endif
352