]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/openal/osx/OpenAL.framework/Versions/A/Headers/al.h
8759876a248c72fc0e18688227edfbe146530da1
[icculus/iodoom3.git] / neo / openal / osx / OpenAL.framework / Versions / A / Headers / al.h
1 #ifndef _AL_H_
2 #define _AL_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 #include "altypes.h"
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 #ifdef _WIN32
31  #ifdef _LIB
32   #define ALAPI __declspec(dllexport)
33  #else
34   #define ALAPI __declspec(dllimport)
35  #endif
36  #define ALAPIENTRY __cdecl
37  #define AL_CALLBACK
38 #else
39  #ifdef TARGET_OS_MAC
40   #if TARGET_OS_MAC
41    #pragma export on
42   #endif
43  #endif
44  #define ALAPI
45  #define ALAPIENTRY 
46  #define AL_CALLBACK
47 #endif
48
49 #define OPENAL
50
51 #ifndef AL_NO_PROTOTYPES
52
53 /**
54  * OpenAL Maintenance Functions
55  * Initialization and exiting.
56  * State Management and Query.
57  * Error Handling.
58  * Extension Support.
59  */
60
61 /** State management. */
62 ALAPI ALvoid    ALAPIENTRY alEnable( ALenum capability );
63 ALAPI ALvoid    ALAPIENTRY alDisable( ALenum capability ); 
64 ALAPI ALboolean ALAPIENTRY alIsEnabled( ALenum capability ); 
65
66 /** Application preferences for driver performance choices. */
67 ALAPI ALvoid    ALAPIENTRY alHint( ALenum target, ALenum mode );
68
69 /** State retrieval. */
70 ALAPI ALboolean ALAPIENTRY alGetBoolean( ALenum param );
71 ALAPI ALint             ALAPIENTRY alGetInteger( ALenum param );
72 ALAPI ALfloat   ALAPIENTRY alGetFloat( ALenum param );
73 ALAPI ALdouble  ALAPIENTRY alGetDouble( ALenum param );
74 ALAPI ALvoid    ALAPIENTRY alGetBooleanv( ALenum param, ALboolean* data );
75 ALAPI ALvoid    ALAPIENTRY alGetIntegerv( ALenum param, ALint* data );
76 ALAPI ALvoid    ALAPIENTRY alGetFloatv( ALenum param, ALfloat* data );
77 ALAPI ALvoid    ALAPIENTRY alGetDoublev( ALenum param, ALdouble* data );
78 ALAPI ALubyte*  ALAPIENTRY alGetString( ALenum param );
79
80 ALAPI ALvoid    ALAPIENTRY alSetInteger( ALenum pname, ALint value );
81 ALAPI ALvoid    ALAPIENTRY alSetDouble( ALenum pname, ALdouble value );
82
83 /**
84  * Error support.
85  * Obtain the most recent error generated in the AL state machine.
86  */
87 ALAPI ALenum    ALAPIENTRY alGetError();
88
89
90 /** 
91  * Extension support.
92  * Obtain the address of a function (usually an extension)
93  *  with the name fname. All addresses are context-independent. 
94  */
95 ALAPI ALboolean ALAPIENTRY alIsExtensionPresent( ALubyte* fname );
96
97
98 /** 
99  * Extension support.
100  * Obtain the address of a function (usually an extension)
101  *  with the name fname. All addresses are context-independent. 
102  */
103 ALAPI ALvoid*   ALAPIENTRY alGetProcAddress( ALubyte* fname );
104
105
106 /**
107  * Extension support.
108  * Obtain the integer value of an enumeration (usually an extension) with the name ename. 
109  */
110 ALAPI ALenum    ALAPIENTRY alGetEnumValue( ALubyte* ename );
111
112
113
114
115 /**
116  * LISTENER
117  * Listener is the sample position for a given context.
118  * The multi-channel (usually stereo) output stream generated
119  *  by the mixer is parametrized by this Listener object:
120  *  its position and velocity relative to Sources, within
121  *  occluder and reflector geometry.
122  */
123
124
125
126 /**
127  *
128  * Listener Environment:  default 0.
129  */
130 ALAPI ALvoid    ALAPIENTRY alListeneri( ALenum param, ALint value );
131
132
133 /**
134  *
135  * Listener Gain:  default 1.0f.
136  */
137 ALAPI ALvoid    ALAPIENTRY alListenerf( ALenum param, ALfloat value );
138
139
140 /**  
141  *
142  * Listener Position.
143  * Listener Velocity.
144  */
145 ALAPI ALvoid    ALAPIENTRY alListener3f( ALenum param, ALfloat v1, ALfloat v2, ALfloat v3 ); 
146
147
148 /**
149  *
150  * Listener Position:        ALfloat[3]
151  * Listener Velocity:        ALfloat[3]
152  * Listener Orientation:     ALfloat[6]  (forward and up vector).
153  */
154 ALAPI ALvoid    ALAPIENTRY alListenerfv( ALenum param, ALfloat* values ); 
155
156 ALAPI ALvoid    ALAPIENTRY alGetListeneri( ALenum param, ALint* value );
157 ALAPI ALvoid    ALAPIENTRY alGetListenerf( ALenum param, ALfloat* value );
158 ALAPI ALvoid    ALAPIENTRY alGetListener3f( ALenum param, ALfloat* v1, ALfloat* v2, ALfloat* v3 ); 
159 ALAPI ALvoid    ALAPIENTRY alGetListenerfv( ALenum param, ALfloat* values ); 
160
161
162 /**
163  * SOURCE
164  * Source objects are by default localized. Sources
165  *  take the PCM data provided in the specified Buffer,
166  *  apply Source-specific modifications, and then
167  *  submit them to be mixed according to spatial 
168  *  arrangement etc.
169  */
170
171
172
173 /** Create Source objects. */
174 ALAPI ALvoid    ALAPIENTRY alGenSources( ALsizei n, ALuint* sources ); 
175
176 /** Delete Source objects. */
177 ALAPI ALvoid    ALAPIENTRY alDeleteSources( ALsizei n, ALuint* sources );
178
179 /** Verify a handle is a valid Source. */ 
180 ALAPI ALboolean ALAPIENTRY alIsSource( ALuint id ); 
181
182 /** Set an integer parameter for a Source object. */
183 ALAPI ALvoid    ALAPIENTRY alSourcei( ALuint source, ALenum param, ALint value ); 
184 ALAPI ALvoid    ALAPIENTRY alSourcef( ALuint source, ALenum param, ALfloat value ); 
185 ALAPI ALvoid    ALAPIENTRY alSource3f( ALuint source, ALenum param, ALfloat v1, ALfloat v2, ALfloat v3 );
186 ALAPI ALvoid    ALAPIENTRY alSourcefv( ALuint source, ALenum param, ALfloat* values ); 
187
188 /** Get an integer parameter for a Source object. */
189 ALAPI ALvoid    ALAPIENTRY alGetSourcei( ALuint source,  ALenum param, ALint* value );
190 ALAPI ALvoid    ALAPIENTRY alGetSourcef( ALuint source,  ALenum param, ALfloat* value );
191 ALAPI ALvoid    ALAPIENTRY alGetSource3f( ALuint source,  ALenum param, ALfloat* v1, ALfloat* v2, ALfloat* v3 );
192 ALAPI ALvoid    ALAPIENTRY alGetSourcefv( ALuint source, ALenum param, ALfloat* values );
193
194 ALAPI ALvoid    ALAPIENTRY alSourcePlayv( ALsizei n, ALuint *sources );
195 ALAPI ALvoid    ALAPIENTRY alSourcePausev( ALsizei n, ALuint *sources );
196 ALAPI ALvoid    ALAPIENTRY alSourceStopv( ALsizei n, ALuint *sources );
197 ALAPI ALvoid    ALAPIENTRY alSourceRewindv(ALsizei n,ALuint *sources);
198
199 /** Activate a source, start replay. */
200 ALAPI ALvoid    ALAPIENTRY alSourcePlay( ALuint source );
201
202 /**
203  * Pause a source, 
204  *  temporarily remove it from the mixer list.
205  */
206 ALAPI ALvoid    ALAPIENTRY alSourcePause( ALuint source );
207
208 /**
209  * Stop a source,
210  *  temporarily remove it from the mixer list,
211  *  and reset its internal state to pre-Play.
212  * To remove a Source completely, it has to be
213  *  deleted following Stop, or before Play.
214  */
215 ALAPI ALvoid    ALAPIENTRY alSourceStop( ALuint source );
216
217 /**
218  * Rewinds a source, 
219  *  temporarily remove it from the mixer list,
220  *  and reset its internal state to pre-Play.
221  */
222 ALAPI ALvoid    ALAPIENTRY alSourceRewind( ALuint source );
223
224
225
226 /**
227  * BUFFER
228  * Buffer objects are storage space for sample data.
229  * Buffers are referred to by Sources. There can be more than
230  *  one Source using the same Buffer data. If Buffers have
231  *  to be duplicated on a per-Source basis, the driver has to
232  *  take care of allocation, copying, and deallocation as well
233  *  as propagating buffer data changes.
234  */
235
236
237
238
239 /** Buffer object generation. */
240 ALAPI ALvoid    ALAPIENTRY alGenBuffers( ALsizei n, ALuint* buffers );
241 ALAPI ALvoid    ALAPIENTRY alDeleteBuffers( ALsizei n, ALuint* buffers );
242 ALAPI ALboolean ALAPIENTRY alIsBuffer( ALuint buffer );
243
244 /**
245  * Specify the data to be filled into a buffer.
246  */
247 ALAPI ALvoid    ALAPIENTRY alBufferData( ALuint   buffer,
248                                                                                  ALenum   format,
249                                                                                  ALvoid*  data,
250                                                                                  ALsizei  size,
251                                                                                  ALsizei  freq );
252
253
254 ALAPI ALvoid    ALAPIENTRY alGetBufferi( ALuint buffer, ALenum param, ALint*   value );
255 ALAPI ALvoid    ALAPIENTRY alGetBufferf( ALuint buffer, ALenum param, ALfloat* value );
256
257
258
259
260 /**
261  * Queue stuff
262  */
263
264 ALAPI ALvoid    ALAPIENTRY alSourceQueueBuffers( ALuint source, ALsizei n, ALuint* buffers );
265 ALAPI ALvoid    ALAPIENTRY alSourceUnqueueBuffers( ALuint source, ALsizei n, ALuint* buffers );
266
267 /**
268  * Knobs and dials
269  */
270 ALAPI ALvoid    ALAPIENTRY alDistanceModel( ALenum value );
271 ALAPI ALvoid    ALAPIENTRY alDopplerFactor( ALfloat value );
272 ALAPI ALvoid    ALAPIENTRY alDopplerVelocity( ALfloat value );
273
274 #else /* AL_NO_PROTOTYPES */
275
276 /**
277  * OpenAL Maintenance Functions
278  * Initialization and exiting.
279  * State Management and Query.
280  * Error Handling.
281  * Extension Support.
282  */
283
284 /** State management. */
285 ALAPI ALvoid    ALAPIENTRY (*alEnable)( ALenum capability );
286 ALAPI ALvoid    ALAPIENTRY (*alDisable)( ALenum capability ); 
287 ALAPI ALboolean ALAPIENTRY (*alIsEnabled)( ALenum capability ); 
288
289 /** Application preferences for driver performance choices. */
290 ALAPI ALvoid    ALAPIENTRY (*alHint)( ALenum target, ALenum mode );
291
292 /** State retrieval. */
293 ALAPI ALboolean ALAPIENTRY (*alGetBoolean)( ALenum param );
294 ALAPI ALint             ALAPIENTRY (*alGetInteger)( ALenum param );
295 ALAPI ALfloat   ALAPIENTRY (*alGetFloat)( ALenum param );
296 ALAPI ALdouble  ALAPIENTRY (*alGetDouble)( ALenum param );
297 ALAPI ALvoid    ALAPIENTRY (*alGetBooleanv)( ALenum param, ALboolean* data );
298 ALAPI ALvoid    ALAPIENTRY (*alGetIntegerv)( ALenum param, ALint* data );
299 ALAPI ALvoid    ALAPIENTRY (*alGetFloatv)( ALenum param, ALfloat* data );
300 ALAPI ALvoid    ALAPIENTRY (*alGetDoublev)( ALenum param, ALdouble* data );
301 ALAPI ALubyte*  ALAPIENTRY (*alGetString)( ALenum param );
302
303 ALAPI ALvoid    ALAPIENTRY (*alSetInteger)( ALenum pname, ALint value );
304 ALAPI ALvoid    ALAPIENTRY (*alSetDouble)( ALenum pname, ALdouble value );
305
306 /**
307  * Error support.
308  * Obtain the most recent error generated in the AL state machine.
309  */
310 ALAPI ALenum    ALAPIENTRY (*alGetError)( ALvoid );
311
312
313 /** 
314  * Extension support.
315  * Obtain the address of a function (usually an extension)
316  *  with the name fname. All addresses are context-independent. 
317  */
318 ALAPI ALboolean ALAPIENTRY (*alIsExtensionPresent)( ALubyte* fname );
319
320
321 /** 
322  * Extension support.
323  * Obtain the address of a function (usually an extension)
324  *  with the name fname. All addresses are context-independent. 
325  */
326 ALAPI ALvoid*   ALAPIENTRY (*alGetProcAddress)( ALubyte* fname );
327
328
329 /**
330  * Extension support.
331  * Obtain the integer value of an enumeration (usually an extension) with the name ename. 
332  */
333 ALAPI ALenum    ALAPIENTRY (*alGetEnumValue)( ALubyte* ename );
334
335
336
337
338 /**
339  * LISTENER
340  * Listener is the sample position for a given context.
341  * The multi-channel (usually stereo) output stream generated
342  *  by the mixer is parametrized by this Listener object:
343  *  its position and velocity relative to Sources, within
344  *  occluder and reflector geometry.
345  */
346
347
348
349 /**
350  *
351  * Listener Environment:  default 0.
352  */
353 ALAPI ALvoid    ALAPIENTRY (*alListeneri)( ALenum param, ALint value );
354
355
356 /**
357  *
358  * Listener Gain:  default 1.0f.
359  */
360 ALAPI ALvoid    ALAPIENTRY (*alListenerf)( ALenum param, ALfloat value );
361
362
363 /**  
364  *
365  * Listener Position.
366  * Listener Velocity.
367  */
368 ALAPI ALvoid    ALAPIENTRY (*alListener3f)( ALenum param, ALfloat v1, ALfloat v2, ALfloat v3 ); 
369
370
371 /**
372  *
373  * Listener Position:        ALfloat[3]
374  * Listener Velocity:        ALfloat[3]
375  * Listener Orientation:     ALfloat[6]  (forward and up vector).
376  */
377 ALAPI ALvoid    ALAPIENTRY (*alListenerfv)( ALenum param, ALfloat* values ); 
378
379 ALAPI ALvoid    ALAPIENTRY (*alGetListeneri)( ALenum param, ALint* value );
380 ALAPI ALvoid    ALAPIENTRY (*alGetListenerf)( ALenum param, ALfloat* value );
381 ALAPI ALvoid    ALAPIENTRY (*alGetListener3f)( ALenum param, ALfloat* v1, ALfloat* v2, ALfloat* v3 ); 
382 ALAPI ALvoid    ALAPIENTRY (*alGetListenerfv)( ALenum param, ALfloat* values ); 
383
384
385 /**
386  * SOURCE
387  * Source objects are by default localized. Sources
388  *  take the PCM data provided in the specified Buffer,
389  *  apply Source-specific modifications, and then
390  *  submit them to be mixed according to spatial 
391  *  arrangement etc.
392  */
393
394
395
396 /** Create Source objects. */
397 ALAPI ALvoid    ALAPIENTRY (*alGenSources)( ALsizei n, ALuint* sources ); 
398
399 /** Delete Source objects. */
400 ALAPI ALvoid    ALAPIENTRY (*alDeleteSources)( ALsizei n, ALuint* sources );
401
402 /** Verify a handle is a valid Source. */ 
403 ALAPI ALboolean ALAPIENTRY (*alIsSource)( ALuint id ); 
404
405 /** Set an integer parameter for a Source object. */
406 ALAPI ALvoid    ALAPIENTRY (*alSourcei)( ALuint source, ALenum param, ALint value ); 
407 ALAPI ALvoid    ALAPIENTRY (*alSourcef)( ALuint source, ALenum param, ALfloat value ); 
408 ALAPI ALvoid    ALAPIENTRY (*alSource3f)( ALuint source, ALenum param, ALfloat v1, ALfloat v2, ALfloat v3 );
409 ALAPI ALvoid    ALAPIENTRY (*alSourcefv)( ALuint source, ALenum param, ALfloat* values ); 
410
411 /** Get an integer parameter for a Source object. */
412 ALAPI ALvoid    ALAPIENTRY (*alGetSourcei)( ALuint source,  ALenum param, ALint* value );
413 ALAPI ALvoid    ALAPIENTRY (*alGetSourcef)( ALuint source,  ALenum param, ALfloat* value );
414 ALAPI ALvoid    ALAPIENTRY (*alGetSourcefv)( ALuint source, ALenum param, ALfloat* values );
415
416 ALAPI ALvoid    ALAPIENTRY (*alSourcePlayv)( ALsizei n, ALuint *sources );
417 ALAPI ALvoid    ALAPIENTRY (*alSourceStopv)( ALsizei n, ALuint *sources );
418
419 /** Activate a source, start replay. */
420 ALAPI ALvoid    ALAPIENTRY (*alSourcePlay)( ALuint source );
421
422 /**
423  * Pause a source, 
424  *  temporarily remove it from the mixer list.
425  */
426 ALAPI ALvoid    ALAPIENTRY (*alSourcePause)( ALuint source );
427
428 /**
429  * Stop a source,
430  *  temporarily remove it from the mixer list,
431  *  and reset its internal state to pre-Play.
432  * To remove a Source completely, it has to be
433  *  deleted following Stop, or before Play.
434  */
435 ALAPI ALvoid    ALAPIENTRY (*alSourceStop)( ALuint source );
436
437
438
439 /**
440  * BUFFER
441  * Buffer objects are storage space for sample data.
442  * Buffers are referred to by Sources. There can be more than
443  *  one Source using the same Buffer data. If Buffers have
444  *  to be duplicated on a per-Source basis, the driver has to
445  *  take care of allocation, copying, and deallocation as well
446  *  as propagating buffer data changes.
447  */
448
449
450
451
452 /** Buffer object generation. */
453 ALAPI ALvoid    ALAPIENTRY (*alGenBuffers)( ALsizei n, ALuint* buffers );
454 ALAPI ALvoid    ALAPIENTRY (*alDeleteBuffers)( ALsizei n, ALuint* buffers );
455 ALAPI ALboolean ALAPIENTRY (*alIsBuffer)( ALuint buffer );
456
457 /**
458  * Specify the data to be filled into a buffer.
459  */
460 ALAPI ALvoid    ALAPIENTRY (*alBufferData)( ALuint   buffer,
461                                                                                         ALenum   format,
462                                                                                         ALvoid*  data,
463                                                                                         ALsizei  size,
464                                                                                         ALsizei  freq );
465
466 ALAPI ALvoid    ALAPIENTRY (*alGetBufferi)( ALuint buffer, ALenum param, ALint*   value );
467 ALAPI ALvoid    ALAPIENTRY (*alGetBufferf)( ALuint buffer, ALenum param, ALfloat* value );
468
469
470
471
472 /**
473  * Queue stuff
474  */
475 ALAPI ALvoid    ALAPIENTRY (*alSourceQueueBuffers)( ALuint source, ALsizei n, ALuint* buffers );
476 ALAPI ALvoid    ALAPIENTRY (*alSourceUnqueueBuffers)( ALuint source, ALsizei n, ALuint* buffers );
477
478 /**
479  * Knobs and dials
480  */
481 ALAPI ALvoid    ALAPIENTRY (*alDistanceModel)( ALenum value );
482 ALAPI ALvoid    ALAPIENTRY (*alDopplerFactor)( ALfloat value );
483 ALAPI ALvoid    ALAPIENTRY (*alDopplerVelocity)( ALfloat value );
484
485
486 #endif /* AL_NO_PROTOTYPES */
487
488 #ifdef TARGET_OS_MAC
489  #if TARGET_OS_MAC
490   #pragma export off
491  #endif
492 #endif
493
494 #ifdef __cplusplus
495 }
496 #endif
497
498 #endif