]> git.jsancho.org Git - lugaru.git/blob - OpenAL/include/AL/altypes.h
First shot at an OpenAL renderer. Sound effects work, no music.
[lugaru.git] / OpenAL / include / AL / altypes.h
1 #ifndef _AL_TYPES_H_
2 #define _AL_TYPES_H_
3
4 /** OpenAL bool type. */
5 typedef char ALboolean;
6
7 /** OpenAL 8bit signed byte. */
8 typedef signed char ALbyte;
9
10 /** OpenAL 8bit unsigned byte. */
11 typedef unsigned char ALubyte;
12
13 /** OpenAL 16bit signed short integer type. */
14 typedef short ALshort;
15
16 /** OpenAL 16bit unsigned short integer type. */
17 typedef unsigned short ALushort;
18
19 /** OpenAL 32bit unsigned integer type. */
20 typedef unsigned int ALuint;
21
22 /** OpenAL 32bit signed integer type. */
23 typedef int ALint;
24
25 /** OpenAL 32bit floating point type. */
26 typedef float ALfloat;
27
28 /** OpenAL 64bit double point type. */
29 typedef double ALdouble;
30
31 /** OpenAL 32bit type. */
32 typedef signed int ALsizei;
33
34 /** OpenAL void type (for params, not returns). */
35 #ifdef __GNUC__
36 typedef void ALvoid;
37 #else
38 #define ALvoid void
39 #endif /* __GNUC__ */
40
41 /** OpenAL enumerations. */
42 typedef int ALenum;
43
44 /** OpenAL bitfields. */
45 typedef unsigned int ALbitfield;
46
47 /** OpenAL clamped float. */
48 typedef ALfloat ALclampf;
49
50 /** Openal clamped double. */
51 typedef ALdouble ALclampd;
52
53 /* Enumerant values begin at column 50. No tabs. */
54
55 /* bad value */
56 #define AL_INVALID                                -1
57
58 #define AL_NONE                                   0
59
60 /* Boolean False. */
61 #define AL_FALSE                                  0
62
63 /** Boolean True. */
64 #define AL_TRUE                                   1
65
66 /**
67  * Indicate the type of AL_SOURCE.
68  * Sources can be spatialized 
69  */
70 #define AL_SOURCE_TYPE                            0x0200
71
72 /** Indicate Source has relative coordinates. */
73 #define AL_SOURCE_RELATIVE                        0x0202
74
75 /**
76  * Directional source, inner cone angle, in degrees.
77  * Range:    [0-360] 
78  * Default:  360
79  */
80 #define AL_CONE_INNER_ANGLE                       0x1001
81
82 /**
83  * Directional source, outer cone angle, in degrees.
84  * Range:    [0-360] 
85  * Default:  360
86  */
87 #define AL_CONE_OUTER_ANGLE                       0x1002
88
89 /**
90  * Specify the pitch to be applied, either at source,
91  *  or on mixer results, at listener.
92  * Range:   [0.5-2.0]
93  * Default: 1.0
94  */
95 #define AL_PITCH                                  0x1003
96   
97 /** 
98  * Specify the current location in three dimensional space.
99  * OpenAL, like OpenGL, uses a right handed coordinate system,
100  *  where in a frontal default view X (thumb) points right, 
101  *  Y points up (index finger), and Z points towards the
102  *  viewer/camera (middle finger). 
103  * To switch from a left handed coordinate system, flip the
104  *  sign on the Z coordinate.
105  * Listener position is always in the world coordinate system.
106  */ 
107 #define AL_POSITION                               0x1004
108   
109 /** Specify the current direction. */
110 #define AL_DIRECTION                              0x1005
111   
112 /** Specify the current velocity in three dimensional space. */
113 #define AL_VELOCITY                               0x1006
114
115 /**
116  * Indicate whether source is looping.
117  * Type: ALboolean?
118  * Range:   [AL_TRUE, AL_FALSE]
119  * Default: FALSE.
120  */
121 #define AL_LOOPING                                0x1007
122
123 /**
124  * Indicate whether source is meant to be streaming.
125  * Type: ALboolean?
126  * Range:   [AL_TRUE, AL_FALSE]
127  * Default: FALSE.
128  */
129 #define AL_STREAMING                              0x1008
130
131 /**
132  * Indicate the buffer to provide sound samples. 
133  * Type: ALuint.
134  * Range: any valid Buffer id.
135  */
136 #define AL_BUFFER                                 0x1009
137   
138 /**
139  * Indicate the gain (volume amplification) applied. 
140  * Type:   ALfloat.
141  * Range:  ]0.0-  ]
142  * A value of 1.0 means un-attenuated/unchanged.
143  * Each division by 2 equals an attenuation of -6dB.
144  * Each multiplicaton with 2 equals an amplification of +6dB.
145  * A value of 0.0 is meaningless with respect to a logarithmic
146  *  scale; it is interpreted as zero volume - the channel
147  *  is effectively disabled.
148  */
149 #define AL_GAIN                                   0x100A
150
151 /* byte offset into source (in canon format).  -1 if source
152  * is not playing.  Don't set this, get this.
153  *
154  * Type:  ALint
155  * Range: -1 - +inf
156  */
157 #define AL_BYTE_LOKI                              0x100C
158
159 /*
160  * Indicate minimum source attenuation
161  * Type: ALfloat
162  * Range:  [0.0 - 1.0]
163  *
164  * Logarthmic
165  */
166 #define AL_MIN_GAIN                               0x100D
167
168 /**
169  * Indicate maximum source attenuation
170  * Type: ALfloat
171  * Range:  [0.0 - 1.0]
172  *
173  * Logarthmic
174  */
175 #define AL_MAX_GAIN                               0x100E
176
177 /**
178  * Indicate listener orientation.
179  *
180  * at/up 
181  */
182 #define AL_ORIENTATION                            0x100F
183
184 /**
185  * Source state information.
186  */
187 #define AL_SOURCE_STATE                           0x1010
188 #define AL_INITIAL                                0x1011
189 #define AL_PLAYING                                0x1012
190 #define AL_PAUSED                                 0x1013
191 #define AL_STOPPED                                0x1014
192
193 /**
194  * Buffer Queue params
195  */
196 #define AL_BUFFERS_QUEUED                         0x1015
197 #define AL_BUFFERS_PROCESSED                      0x1016
198
199 /**
200  * Buffer states
201  */
202 #define AL_PENDING                                0x1017
203 #define AL_PROCESSED                              0x1018
204
205
206 /** Sound samples: format specifier. */
207 #define AL_FORMAT_MONO8                           0x1100
208 #define AL_FORMAT_MONO16                          0x1101
209 #define AL_FORMAT_STEREO8                         0x1102
210 #define AL_FORMAT_STEREO16                        0x1103
211
212 /**
213  * source specific reference distance
214  * Type: ALfloat
215  * Range:  0.0 - +inf
216  *
217  * At 0.0, no distance attenuation occurs.  Default is
218  * 1.0.
219  */
220 #define AL_REFERENCE_DISTANCE                     0x1020
221
222 /**
223  * source specific rolloff factor
224  * Type: ALfloat
225  * Range:  0.0 - +inf
226  *
227  */
228 #define AL_ROLLOFF_FACTOR                         0x1021
229
230 /**
231  * Directional source, outer cone gain.
232  *
233  * Default:  0.0
234  * Range:    [0.0 - 1.0]
235  * Logarithmic
236  */
237 #define AL_CONE_OUTER_GAIN                        0x1022
238
239 /**
240  * Indicate distance above which sources are not
241  * attenuated using the inverse clamped distance model.
242  *
243  * Default: +inf
244  * Type: ALfloat
245  * Range:  0.0 - +inf
246  */
247 #define AL_MAX_DISTANCE                           0x1023
248
249 /** 
250  * Sound samples: frequency, in units of Hertz [Hz].
251  * This is the number of samples per second. Half of the
252  *  sample frequency marks the maximum significant
253  *  frequency component.
254  */
255 #define AL_FREQUENCY                              0x2001
256 #define AL_BITS                                   0x2002
257 #define AL_CHANNELS                               0x2003
258 #define AL_SIZE                                   0x2004
259
260 /**
261  * Buffer state.
262  *
263  * Not supported for public use (yet).
264  */
265 #define AL_UNUSED                                 0x2010
266 #define AL_QUEUED                                 0x2011
267 #define AL_CURRENT                                0x2012
268
269 /** Errors: No Error. */
270 #define AL_NO_ERROR                               AL_FALSE
271
272 /** 
273  * Invalid Name paramater passed to AL call.
274  */
275 #define AL_INVALID_NAME                           0xA001
276
277 /** 
278  * Invalid parameter passed to AL call.
279  */
280 #define AL_ILLEGAL_ENUM                           0xA002
281
282 /** 
283  * Invalid enum parameter value.
284  */
285 #define AL_INVALID_VALUE                          0xA003
286
287 /** 
288  * Illegal call.
289  */
290 #define AL_ILLEGAL_COMMAND                        0xA004
291   
292 /**
293  * No mojo.
294  */
295 #define AL_OUT_OF_MEMORY                          0xA005
296
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  * Tweaks speed of propagation.
313  */
314 #define AL_DOPPLER_VELOCITY                       0xC001
315
316 /**
317  * Distance scaling
318  */
319 #define AL_DISTANCE_SCALE                         0xC002
320
321 /**
322  * Distance models
323  *
324  * used in conjunction with DistanceModel
325  *
326  * implicit: NONE, which disances distance attenuation.
327  */
328 #define AL_DISTANCE_MODEL                         0xD000
329 #define AL_INVERSE_DISTANCE                       0xD001
330 #define AL_INVERSE_DISTANCE_CLAMPED               0xD002
331
332
333 /**
334  * enables
335  */
336
337 /* #define AL_SOME_ENABLE                            0xE000 */
338
339 /** IASIG Level 2 Environment. */
340
341 /**  
342  * Parameter:  IASIG ROOM  blah
343  * Type:       intgeger
344  * Range:      [-10000, 0]
345  * Default:    -10000 
346  */
347 #define AL_ENV_ROOM_IASIG                         0x3001
348
349 /**
350  * Parameter:  IASIG ROOM_HIGH_FREQUENCY
351  * Type:       integer
352  * Range:      [-10000, 0]
353  * Default:    0 
354  */
355 #define AL_ENV_ROOM_HIGH_FREQUENCY_IASIG          0x3002
356
357 /**
358  * Parameter:  IASIG ROOM_ROLLOFF_FACTOR
359  * Type:       float
360  * Range:      [0.0, 10.0]
361  * Default:    0.0 
362  */
363 #define AL_ENV_ROOM_ROLLOFF_FACTOR_IASIG          0x3003
364
365 /** 
366  * Parameter:  IASIG  DECAY_TIME
367  * Type:       float
368  * Range:      [0.1, 20.0]
369  * Default:    1.0 
370  */
371 #define AL_ENV_DECAY_TIME_IASIG                   0x3004
372
373 /**
374  * Parameter:  IASIG DECAY_HIGH_FREQUENCY_RATIO
375  * Type:       float
376  * Range:      [0.1, 2.0]
377  * Default:    0.5
378  */
379 #define AL_ENV_DECAY_HIGH_FREQUENCY_RATIO_IASIG   0x3005
380
381 /**
382  * Parameter:  IASIG REFLECTIONS
383  * Type:       integer
384  * Range:      [-10000, 1000]
385  * Default:    -10000
386  */
387 #define AL_ENV_REFLECTIONS_IASIG                  0x3006
388
389 /**
390  * Parameter:  IASIG REFLECTIONS_DELAY
391  * Type:       float
392  * Range:      [0.0, 0.3]
393  * Default:    0.02
394  */
395 #define AL_ENV_REFLECTIONS_DELAY_IASIG            0x3006
396
397 /**
398  * Parameter:  IASIG REVERB
399  * Type:       integer
400  * Range:      [-10000,2000]
401  * Default:    -10000
402  */
403 #define AL_ENV_REVERB_IASIG                       0x3007
404
405 /**
406  * Parameter:  IASIG REVERB_DELAY
407  * Type:       float
408  * Range:      [0.0, 0.1]
409  * Default:    0.04
410  */
411 #define AL_ENV_REVERB_DELAY_IASIG                 0x3008
412
413 /**
414  * Parameter:  IASIG DIFFUSION
415  * Type:       float
416  * Range:      [0.0, 100.0]
417  * Default:    100.0
418  */
419 #define AL_ENV_DIFFUSION_IASIG                    0x3009
420
421 /**
422  * Parameter:  IASIG DENSITY
423  * Type:       float
424  * Range:      [0.0, 100.0]
425  * Default:    100.0
426  */
427 #define AL_ENV_DENSITY_IASIG                      0x300A
428   
429   /**
430  * Parameter:  IASIG HIGH_FREQUENCY_REFERENCE
431  * Type:       float
432  * Range:      [20.0, 20000.0]
433  * Default:    5000.0
434  */
435 #define AL_ENV_HIGH_FREQUENCY_REFERENCE_IASIG     0x300B
436
437
438 #define AL_INVALID_ENUM                          0xA002  
439 #define AL_INVALID_OPERATION                     0xA004
440
441 #endif