]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/openal/include/altypes.h
Use the same OpenAL headers on all platforms.
[icculus/iodoom3.git] / neo / openal / include / altypes.h
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 //@IODOOM3: "typedef void" doesn't work on gcc.
61 //typedef void ALvoid;
62 #define ALvoid void
63
64 /** OpenAL enumerations. */
65 typedef int ALenum;
66
67 /* Bad value. */
68 #define AL_INVALID                               (-1)
69
70 /* Disable value. */
71 #define AL_NONE                                                                  0
72
73 /* Boolean False. */
74 #define AL_FALSE                                 0
75
76 /* Boolean True. */
77 #define AL_TRUE                                  1
78
79 /**
80   * Indicate the type of AL_SOURCE.
81   * Sources can be spatialized 
82   */
83 #define AL_SOURCE_TYPE                           0x200
84
85 /** Indicate source has absolute coordinates. */
86 #define AL_SOURCE_ABSOLUTE                       0x201
87
88 /** Indicate Source has listener relative coordinates. */
89 #define AL_SOURCE_RELATIVE                       0x202
90
91 /**
92  * Directional source, inner cone angle, in degrees.
93  * Range:    [0-360] 
94  * Default:  360
95  */
96 #define AL_CONE_INNER_ANGLE                      0x1001
97
98 /**
99  * Directional source, outer cone angle, in degrees.
100  * Range:    [0-360] 
101  * Default:  360
102  */
103 #define AL_CONE_OUTER_ANGLE                      0x1002
104
105 /**
106  * Specify the pitch to be applied, either at source,
107  *  or on mixer results, at listener.
108  * Range:        [0.5-2.0]
109  * Default:  1.0
110  */
111 #define AL_PITCH                                 0x1003
112
113 /** 
114  * Specify the current location in three dimensional space.
115  * OpenAL, like OpenGL, uses a right handed coordinate system,
116  *  where in a frontal default view X (thumb) points right, 
117  *  Y points up (index finger), and Z points towards the
118  *  viewer/camera (middle finger). 
119  * To switch from a left handed coordinate system, flip the
120  *  sign on the Z coordinate.
121  * Listener position is always in the world coordinate system.
122  */ 
123 #define AL_POSITION                              0x1004
124   
125 /** Specify the current direction as forward vector. */
126 #define AL_DIRECTION                             0x1005
127   
128 /** Specify the current velocity in three dimensional space. */
129 #define AL_VELOCITY                              0x1006
130
131 /**
132  * Indicate whether source has to loop infinite.
133  * Type: ALboolean
134  * Range:    [AL_TRUE, AL_FALSE]
135  * Default:  AL_FALSE
136  */
137 #define AL_LOOPING                               0x1007
138
139 /**
140  * Indicate the buffer to provide sound samples. 
141  * Type: ALuint.
142  * Range: any valid Buffer id.
143  */
144 #define AL_BUFFER                                0x1009
145
146 /**
147  * Indicate the gain (volume amplification) applied. 
148  * Type:     ALfloat.
149  * Range:    ]0.0-  ]
150  * A value of 1.0 means un-attenuated/unchanged.
151  * Each division by 2 equals an attenuation of -6dB.
152  * Each multiplicaton with 2 equals an amplification of +6dB.
153  * A value of 0.0 is meaningless with respect to a logarithmic
154  *  scale; it is interpreted as zero volume - the channel
155  *  is effectively disabled.
156  */
157 #define AL_GAIN                                  0x100A
158
159 /**
160  * Indicate minimum source attenuation.
161  * Type:     ALfloat
162  * Range:        [0.0 - 1.0]
163  */
164 #define AL_MIN_GAIN                              0x100D
165
166 /**
167  * Indicate maximum source attenuation.
168  * Type:         ALfloat
169  * Range:        [0.0 - 1.0]
170  */
171 #define AL_MAX_GAIN                              0x100E
172
173 /** 
174  * Specify the current orientation.
175  * Type:         ALfv6 (at/up)
176  * Range:        N/A
177  */
178 #define AL_ORIENTATION                           0x100F
179
180 /* byte offset into source (in canon format).  -1 if source
181  * is not playing.  Don't set this, get this.
182  *
183  * Type:     ALfloat
184  * Range:    [0.0 - ]
185  * Default:  1.0
186  */
187 #define AL_REFERENCE_DISTANCE                    0x1020
188
189  /**
190  * Indicate the rolloff factor for the source.
191  * Type: ALfloat
192  * Range:    [0.0 - ]
193  * Default:  1.0
194  */
195 #define AL_ROLLOFF_FACTOR                        0x1021
196
197 /**
198  * Indicate the gain (volume amplification) applied. 
199  * Type:     ALfloat.
200  * Range:    ]0.0-  ]
201  * A value of 1.0 means un-attenuated/unchanged.
202  * Each division by 2 equals an attenuation of -6dB.
203  * Each multiplicaton with 2 equals an amplification of +6dB.
204  * A value of 0.0 is meaningless with respect to a logarithmic
205  *  scale; it is interpreted as zero volume - the channel
206  *  is effectively disabled.
207  */
208 #define AL_CONE_OUTER_GAIN                       0x1022
209
210 /** 
211  * Specify the maximum distance.
212  * Type:         ALfloat
213  * Range:        [0.0 - ]
214  */
215 #define AL_MAX_DISTANCE                          0x1023
216
217 /**
218  * Specify the channel mask. (Creative)
219  * Type:         ALuint
220  * Range:        [0 - 255]
221  */
222 #define AL_CHANNEL_MASK                                                  0x3000
223
224 /**
225  * Source state information
226  */
227 #define AL_SOURCE_STATE                          0x1010
228 #define AL_INITIAL                               0x1011
229 #define AL_PLAYING                               0x1012
230 #define AL_PAUSED                                0x1013
231 #define AL_STOPPED                               0x1014
232
233 /**
234  * Buffer Queue params
235  */
236 #define AL_BUFFERS_QUEUED                        0x1015
237 #define AL_BUFFERS_PROCESSED                     0x1016
238
239 /** Sound buffers: format specifier. */
240 #define AL_FORMAT_MONO8                          0x1100
241 #define AL_FORMAT_MONO16                         0x1101
242 #define AL_FORMAT_STEREO8                        0x1102
243 #define AL_FORMAT_STEREO16                       0x1103
244
245 /** 
246  * Sound buffers: frequency, in units of Hertz [Hz].
247  * This is the number of samples per second. Half of the
248  *  sample frequency marks the maximum significant
249  *  frequency component.
250  */
251 #define AL_FREQUENCY                             0x2001
252 #define AL_BITS                                  0x2002
253 #define AL_CHANNELS                              0x2003
254 #define AL_SIZE                                  0x2004
255 #define AL_DATA                                  0x2005
256
257 /**
258  * Buffer state.
259  *
260  * Not supported for public use (yet).
261  */
262 #define AL_UNUSED                                0x2010
263 #define AL_PENDING                               0x2011
264 #define AL_PROCESSED                             0x2012
265
266 /** Errors: No Error. */
267 #define AL_NO_ERROR                              AL_FALSE
268
269 /** 
270  * Illegal name passed as an argument to an AL call.
271  */
272 #define AL_INVALID_NAME                          0xA001
273
274 /** 
275  * Illegal enum passed as an argument to an AL call.
276  */
277 #define AL_INVALID_ENUM                          0xA002  
278 /** 
279  * Illegal value passed as an argument to an AL call.
280  * Applies to parameter values, but not to enumerations.
281  */
282 #define AL_INVALID_VALUE                         0xA003
283   
284 /**
285  * A function was called at inappropriate time,
286  *  or in an inappropriate way, causing an illegal state.
287  * This can be an incompatible ALenum, object ID,
288  *  and/or function.
289  */
290 #define AL_INVALID_OPERATION                     0xA004
291
292 /**
293  * A function could not be completed,
294  * because there is not enough memory available.
295  */
296 #define AL_OUT_OF_MEMORY                         0xA005
297
298 /** Context strings: Vendor Name. */
299 #define AL_VENDOR                                0xB001
300 #define AL_VERSION                               0xB002
301 #define AL_RENDERER                              0xB003
302 #define AL_EXTENSIONS                            0xB004
303
304 /** Global tweakage. */
305
306 /**
307  * Doppler scale.  Default 1.0
308  */
309 #define AL_DOPPLER_FACTOR                        0xC000
310  
311 /**
312  * Doppler velocity.  Default 1.0
313  */
314 #define AL_DOPPLER_VELOCITY                      0xC001
315
316 /**
317  * Distance model.  Default AL_INVERSE_DISTANCE_CLAMPED
318  */
319 #define AL_DISTANCE_MODEL                        0xD000
320
321 /** Distance models. */
322
323 #define AL_INVERSE_DISTANCE                      0xD001
324 #define AL_INVERSE_DISTANCE_CLAMPED              0xD002
325  
326  /**
327  * enables
328  */
329
330 #ifdef __cplusplus
331 }
332 #endif
333
334 #endif
335