]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/openal/include/altypes.h
hello world
[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 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 channel mask. (Creative)
217  * Type:         ALuint
218  * Range:        [0 - 255]
219  */
220 #define AL_CHANNEL_MASK                                                  0x3000
221
222 /**
223  * Source state information
224  */
225 #define AL_SOURCE_STATE                          0x1010
226 #define AL_INITIAL                               0x1011
227 #define AL_PLAYING                               0x1012
228 #define AL_PAUSED                                0x1013
229 #define AL_STOPPED                               0x1014
230
231 /**
232  * Buffer Queue params
233  */
234 #define AL_BUFFERS_QUEUED                        0x1015
235 #define AL_BUFFERS_PROCESSED                     0x1016
236
237 /** Sound buffers: format specifier. */
238 #define AL_FORMAT_MONO8                          0x1100
239 #define AL_FORMAT_MONO16                         0x1101
240 #define AL_FORMAT_STEREO8                        0x1102
241 #define AL_FORMAT_STEREO16                       0x1103
242
243 /** 
244  * Sound buffers: frequency, in units of Hertz [Hz].
245  * This is the number of samples per second. Half of the
246  *  sample frequency marks the maximum significant
247  *  frequency component.
248  */
249 #define AL_FREQUENCY                             0x2001
250 #define AL_BITS                                  0x2002
251 #define AL_CHANNELS                              0x2003
252 #define AL_SIZE                                  0x2004
253 #define AL_DATA                                  0x2005
254
255 /**
256  * Buffer state.
257  *
258  * Not supported for public use (yet).
259  */
260 #define AL_UNUSED                                0x2010
261 #define AL_PENDING                               0x2011
262 #define AL_PROCESSED                             0x2012
263
264 /** Errors: No Error. */
265 #define AL_NO_ERROR                              AL_FALSE
266
267 /** 
268  * Illegal name passed as an argument to an AL call.
269  */
270 #define AL_INVALID_NAME                          0xA001
271
272 /** 
273  * Illegal enum passed as an argument to an AL call.
274  */
275 #define AL_INVALID_ENUM                          0xA002  
276 /** 
277  * Illegal value passed as an argument to an AL call.
278  * Applies to parameter values, but not to enumerations.
279  */
280 #define AL_INVALID_VALUE                         0xA003
281   
282 /**
283  * A function was called at inappropriate time,
284  *  or in an inappropriate way, causing an illegal state.
285  * This can be an incompatible ALenum, object ID,
286  *  and/or function.
287  */
288 #define AL_INVALID_OPERATION                     0xA004
289
290 /**
291  * A function could not be completed,
292  * because there is not enough memory available.
293  */
294 #define AL_OUT_OF_MEMORY                         0xA005
295
296 /** Context strings: Vendor Name. */
297 #define AL_VENDOR                                0xB001
298 #define AL_VERSION                               0xB002
299 #define AL_RENDERER                              0xB003
300 #define AL_EXTENSIONS                            0xB004
301
302 /** Global tweakage. */
303
304 /**
305  * Doppler scale.  Default 1.0
306  */
307 #define AL_DOPPLER_FACTOR                        0xC000
308  
309 /**
310  * Doppler velocity.  Default 1.0
311  */
312 #define AL_DOPPLER_VELOCITY                      0xC001
313
314 /**
315  * Distance model.  Default AL_INVERSE_DISTANCE_CLAMPED
316  */
317 #define AL_DISTANCE_MODEL                        0xD000
318
319 /** Distance models. */
320
321 #define AL_INVERSE_DISTANCE                      0xD001
322 #define AL_INVERSE_DISTANCE_CLAMPED              0xD002
323  
324  /**
325  * enables
326  */
327
328 #ifdef __cplusplus
329 }
330 #endif
331
332 #endif
333