setupapi: Add pSetupFree|Malloc|Realloc to spec file and forward them.
[wine.git] / dlls / openal32 / openal.c
blob9e0a8f22b5573ca3d2f254928c4d262684ce79eb
1 /*
2 * OpenAL32.dll thunk. Wraps Win32 OpenAL function calls around a native
3 * implementation.
5 * Copyright 2007 Nick Burns (adger44@hotmail.com)
6 * Copyright 2007,2009 Chris Robinson
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #include "config.h"
25 #include <stdarg.h>
26 #include <string.h>
28 #include "windef.h"
29 #include "winbase.h"
30 #include "wine/debug.h"
32 #ifdef HAVE_AL_AL_H
33 #include <AL/al.h>
34 #include <AL/alc.h>
35 #elif defined(HAVE_OPENAL_AL_H)
36 #include <OpenAL/al.h>
37 #include <OpenAL/alc.h>
38 #endif
40 WINE_DEFAULT_DEBUG_CHANNEL(openal32);
42 static ALCboolean (ALC_APIENTRY*alcSetThreadContext)(ALCcontext *context);
43 static ALCcontext* (ALC_APIENTRY*alcGetThreadContext)(ALCvoid);
45 static ALboolean loaded_procs;
47 static ALvoid (AL_APIENTRY*alBufferDataStatic)(const ALuint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq);
48 static ALvoid (AL_APIENTRY*alGenFilters)(ALsizei n, ALuint* filters);
49 static ALvoid (AL_APIENTRY*alDeleteFilters)(ALsizei n, const ALuint* filters);
50 static ALboolean (AL_APIENTRY*alIsFilter)(ALuint fid);
51 static ALvoid (AL_APIENTRY*alFilterf)(ALuint fid, ALenum param, ALfloat value);
52 static ALvoid (AL_APIENTRY*alFilterfv)(ALuint fid, ALenum param, const ALfloat* values);
53 static ALvoid (AL_APIENTRY*alFilteri)(ALuint fid, ALenum param, ALint value);
54 static ALvoid (AL_APIENTRY*alFilteriv)(ALuint fid, ALenum param, const ALint* values);
55 static ALvoid (AL_APIENTRY*alGetFilterf)(ALuint fid, ALenum param, ALfloat* value);
56 static ALvoid (AL_APIENTRY*alGetFilterfv)(ALuint fid, ALenum param, ALfloat* values);
57 static ALvoid (AL_APIENTRY*alGetFilteri)(ALuint fid, ALenum param, ALint* value);
58 static ALvoid (AL_APIENTRY*alGetFilteriv)(ALuint fid, ALenum param, ALint* values);
59 static ALvoid (AL_APIENTRY*alGenEffects)(ALsizei n, ALuint* effects);
60 static ALvoid (AL_APIENTRY*alDeleteEffects)(ALsizei n, const ALuint* effects);
61 static ALboolean (AL_APIENTRY*alIsEffect)(ALuint eid);
62 static ALvoid (AL_APIENTRY*alEffectf)(ALuint eid, ALenum param, ALfloat value);
63 static ALvoid (AL_APIENTRY*alEffectfv)(ALuint eid, ALenum param, const ALfloat* values);
64 static ALvoid (AL_APIENTRY*alEffecti)(ALuint eid, ALenum param, ALint value);
65 static ALvoid (AL_APIENTRY*alEffectiv)(ALuint eid, ALenum param, const ALint* values);
66 static ALvoid (AL_APIENTRY*alGetEffectf)(ALuint eid, ALenum param, ALfloat* value);
67 static ALvoid (AL_APIENTRY*alGetEffectfv)(ALuint eid, ALenum param, ALfloat* values);
68 static ALvoid (AL_APIENTRY*alGetEffecti)(ALuint eid, ALenum param, ALint* value);
69 static ALvoid (AL_APIENTRY*alGetEffectiv)(ALuint eid, ALenum param, ALint* values);
70 static ALvoid (AL_APIENTRY*alGenAuxiliaryEffectSlots)(ALsizei n, ALuint* slots);
71 static ALvoid (AL_APIENTRY*alDeleteAuxiliaryEffectSlots)(ALsizei n, const ALuint* slots);
72 static ALboolean (AL_APIENTRY*alIsAuxiliaryEffectSlot)(ALuint sid);
73 static ALvoid (AL_APIENTRY*alAuxiliaryEffectSlotf)(ALuint sid, ALenum param, ALfloat value);
74 static ALvoid (AL_APIENTRY*alAuxiliaryEffectSlotfv)(ALuint sid, ALenum param, const ALfloat* values);
75 static ALvoid (AL_APIENTRY*alAuxiliaryEffectSloti)(ALuint sid, ALenum param, ALint value);
76 static ALvoid (AL_APIENTRY*alAuxiliaryEffectSlotiv)(ALuint sid, ALenum param, const ALint* values);
77 static ALvoid (AL_APIENTRY*alGetAuxiliaryEffectSlotf)(ALuint sid, ALenum param, ALfloat* value);
78 static ALvoid (AL_APIENTRY*alGetAuxiliaryEffectSlotfv)(ALuint sid, ALenum param, ALfloat* values);
79 static ALvoid (AL_APIENTRY*alGetAuxiliaryEffectSloti)(ALuint sid, ALenum param, ALint* value);
80 static ALvoid (AL_APIENTRY*alGetAuxiliaryEffectSlotiv)(ALuint sid, ALenum param, ALint* values);
82 struct FuncList {
83 const char *name;
84 void *proc;
87 static const struct FuncList ALCFuncs[];
88 static const struct FuncList ALFuncs[];
90 static CRITICAL_SECTION openal_cs;
91 static CRITICAL_SECTION_DEBUG openal_cs_debug =
93 0, 0, &openal_cs,
94 {&openal_cs_debug.ProcessLocksList,
95 &openal_cs_debug.ProcessLocksList},
96 0, 0, {(DWORD_PTR)(__FILE__ ": openal_cs")}
98 static CRITICAL_SECTION openal_cs = {&openal_cs_debug, -1, 0, 0, 0, 0};
100 /***********************************************************************
101 * OpenAL initialisation routine
103 BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
105 switch(reason)
107 case DLL_PROCESS_ATTACH:
108 DisableThreadLibraryCalls(hinst);
109 #define LOADFUNC(x) x = alcGetProcAddress(NULL, #x)
110 LOADFUNC(alcSetThreadContext);
111 LOADFUNC(alcGetThreadContext);
112 #undef LOADFUNC
113 break;
116 return TRUE;
120 static void LoadProcs(void)
122 #define LOADFUNC(x) x = alGetProcAddress(#x)
123 LOADFUNC(alBufferDataStatic);
124 LOADFUNC(alGenFilters);
125 LOADFUNC(alDeleteFilters);
126 LOADFUNC(alIsFilter);
127 LOADFUNC(alFilterf);
128 LOADFUNC(alFilterfv);
129 LOADFUNC(alFilteri);
130 LOADFUNC(alFilteriv);
131 LOADFUNC(alGetFilterf);
132 LOADFUNC(alGetFilterfv);
133 LOADFUNC(alGetFilteri);
134 LOADFUNC(alGetFilteriv);
135 LOADFUNC(alGenEffects);
136 LOADFUNC(alDeleteEffects);
137 LOADFUNC(alIsEffect);
138 LOADFUNC(alEffectf);
139 LOADFUNC(alEffectfv);
140 LOADFUNC(alEffecti);
141 LOADFUNC(alEffectiv);
142 LOADFUNC(alGetEffectf);
143 LOADFUNC(alGetEffectfv);
144 LOADFUNC(alGetEffecti);
145 LOADFUNC(alGetEffectiv);
146 LOADFUNC(alGenAuxiliaryEffectSlots);
147 LOADFUNC(alDeleteAuxiliaryEffectSlots);
148 LOADFUNC(alIsAuxiliaryEffectSlot);
149 LOADFUNC(alAuxiliaryEffectSlotf);
150 LOADFUNC(alAuxiliaryEffectSlotfv);
151 LOADFUNC(alAuxiliaryEffectSloti);
152 LOADFUNC(alAuxiliaryEffectSlotiv);
153 LOADFUNC(alGetAuxiliaryEffectSlotf);
154 LOADFUNC(alGetAuxiliaryEffectSlotfv);
155 LOADFUNC(alGetAuxiliaryEffectSloti);
156 LOADFUNC(alGetAuxiliaryEffectSlotiv);
157 #undef LOADFUNC
160 /***********************************************************************
161 * OpenAL thunk routines
164 /* OpenAL ALC 1.0 functions */
165 ALCcontext* CDECL wine_alcCreateContext(ALCdevice *device, const ALCint* attrlist)
167 return alcCreateContext(device, attrlist);
170 ALCboolean CDECL wine_alcMakeContextCurrent(ALCcontext *context)
172 EnterCriticalSection(&openal_cs);
173 if(alcMakeContextCurrent(context) == ALC_FALSE)
175 WARN("Failed to make context %p current\n", context);
176 LeaveCriticalSection(&openal_cs);
177 return ALC_FALSE;
180 if(context && !loaded_procs)
182 loaded_procs = AL_TRUE;
183 LoadProcs();
185 LeaveCriticalSection(&openal_cs);
187 return ALC_TRUE;
190 ALvoid CDECL wine_alcProcessContext(ALCcontext *context)
192 alcProcessContext(context);
195 ALvoid CDECL wine_alcSuspendContext(ALCcontext *context)
197 alcSuspendContext(context);
200 ALvoid CDECL wine_alcDestroyContext(ALCcontext *context)
202 alcDestroyContext(context);
205 ALCcontext* CDECL wine_alcGetCurrentContext(ALCvoid)
207 return alcGetCurrentContext();
210 ALCdevice* CDECL wine_alcGetContextsDevice(ALCcontext *context)
212 return alcGetContextsDevice(context);
215 ALCdevice* CDECL wine_alcOpenDevice(const ALCchar *devicename)
217 if(devicename != NULL && (strcmp(devicename, "DirectSound3D") == 0 ||
218 strcmp(devicename, "DirectSound") == 0 ||
219 strcmp(devicename, "Generic Hardware") == 0 ||
220 strcmp(devicename, "Generic Software") == 0)) {
221 devicename = NULL;
223 return alcOpenDevice(devicename);
226 ALCboolean CDECL wine_alcCloseDevice(ALCdevice *device)
228 return alcCloseDevice(device);
231 ALCenum CDECL wine_alcGetError(ALCdevice *device)
233 return alcGetError(device);
236 ALCboolean CDECL wine_alcIsExtensionPresent(ALCdevice *device, const ALCchar *extname)
238 return alcIsExtensionPresent(device, extname);
241 ALCvoid* CDECL wine_alcGetProcAddress(ALCdevice *device, const ALCchar *funcname)
243 void *proc;
244 int i;
246 /* Make sure the host implementation has the requested function */
247 proc = alcGetProcAddress(device, funcname);
248 if(!proc)
249 return NULL;
251 for(i = 0;ALCFuncs[i].name;i++)
253 if(strcmp(funcname, ALCFuncs[i].name) == 0)
254 return ALCFuncs[i].proc;
256 FIXME("Could not find function in list: %s\n", funcname);
257 return NULL;
260 ALCenum CDECL wine_alcGetEnumValue(ALCdevice *device, const ALCchar *enumname)
262 return alcGetEnumValue(device, enumname);
265 const ALCchar* CDECL wine_alcGetString(ALCdevice *device, ALCenum param)
267 return alcGetString(device, param);
270 ALvoid CDECL wine_alcGetIntegerv(ALCdevice *device, ALCenum param, ALCsizei size, ALCint *dest)
272 alcGetIntegerv(device, param, size, dest);
276 /* OpenAL 1.0 functions */
277 ALvoid CDECL wine_alEnable(ALenum capability)
279 alEnable(capability);
282 ALvoid CDECL wine_alDisable(ALenum capability)
284 alDisable(capability);
287 ALboolean CDECL wine_alIsEnabled(ALenum capability)
289 return alIsEnabled(capability);
292 const ALchar* CDECL wine_alGetString(ALenum param)
294 return alGetString(param);
297 ALvoid CDECL wine_alGetBooleanv(ALenum param, ALboolean* data)
299 alGetBooleanv(param, data);
302 ALvoid CDECL wine_alGetIntegerv(ALenum param, ALint* data)
304 alGetIntegerv(param, data);
307 ALvoid CDECL wine_alGetFloatv(ALenum param, ALfloat* data)
309 alGetFloatv(param, data);
312 ALvoid CDECL wine_alGetDoublev(ALenum param, ALdouble* data)
314 alGetDoublev(param, data);
317 ALboolean CDECL wine_alGetBoolean(ALenum param)
319 return alGetBoolean(param);
322 ALint CDECL wine_alGetInteger(ALenum param)
324 return alGetInteger(param);
327 ALfloat CDECL wine_alGetFloat(ALenum param)
329 return alGetFloat(param);
332 ALdouble CDECL wine_alGetDouble(ALenum param)
334 return alGetDouble(param);
337 ALenum CDECL wine_alGetError(ALvoid)
339 return alGetError();
342 ALboolean CDECL wine_alIsExtensionPresent(const ALchar* extname)
344 return alIsExtensionPresent(extname);
347 ALvoid* CDECL wine_alGetProcAddress(const ALchar* funcname)
349 void *proc;
350 int i;
352 /* Make sure the host implementation has the requested function. This will
353 * also set the last AL error properly if the function should not be
354 * returned (eg. no current context). */
355 proc = alGetProcAddress(funcname);
356 if(!proc)
357 return NULL;
359 for(i = 0;ALFuncs[i].name;i++)
361 if(strcmp(funcname, ALFuncs[i].name) == 0)
362 return ALFuncs[i].proc;
364 FIXME("Could not find function in list: %s\n", funcname);
365 return NULL;
368 ALenum CDECL wine_alGetEnumValue(const ALchar* ename)
370 return alGetEnumValue(ename);
373 ALvoid CDECL wine_alListenerf(ALenum param, ALfloat value)
375 alListenerf(param, value);
378 ALvoid CDECL wine_alListener3f(ALenum param, ALfloat value1, ALfloat value2, ALfloat value3)
380 alListener3f(param, value1, value2, value3);
383 ALvoid CDECL wine_alListenerfv(ALenum param, const ALfloat* values)
385 alListenerfv(param, values);
388 ALvoid CDECL wine_alListeneri(ALenum param, ALint value)
390 alListeneri(param, value);
393 ALvoid CDECL wine_alGetListenerf(ALenum param, ALfloat* value)
395 alGetListenerf(param, value);
398 ALvoid CDECL wine_alGetListener3f(ALenum param, ALfloat *value1, ALfloat *value2, ALfloat *value3)
400 alGetListener3f(param, value1, value2, value3);
403 ALvoid CDECL wine_alGetListenerfv(ALenum param, ALfloat* values)
405 alGetListenerfv(param, values);
408 ALvoid CDECL wine_alGetListeneri(ALenum param, ALint* value)
410 alGetListeneri(param, value);
413 ALvoid CDECL wine_alGetListeneriv(ALenum param, ALint* values)
415 alGetListeneriv(param, values);
418 ALvoid CDECL wine_alGenSources(ALsizei n, ALuint* sources)
420 alGenSources(n, sources);
423 ALvoid CDECL wine_alDeleteSources(ALsizei n, const ALuint* sources)
425 alDeleteSources(n, sources);
428 ALboolean CDECL wine_alIsSource(ALuint sid)
430 return alIsSource(sid);
433 ALvoid CDECL wine_alSourcef(ALuint sid, ALenum param, ALfloat value)
435 alSourcef(sid, param, value);
438 ALvoid CDECL wine_alSource3f(ALuint sid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3)
440 alSource3f(sid, param, value1, value2, value3);
443 ALvoid CDECL wine_alSourcefv(ALuint sid, ALenum param, const ALfloat* values)
445 alSourcefv(sid, param, values);
448 ALvoid CDECL wine_alSourcei(ALuint sid, ALenum param, ALint value)
450 alSourcei(sid, param, value);
453 ALvoid CDECL wine_alGetSourcef(ALuint sid, ALenum param, ALfloat* value)
455 alGetSourcef(sid, param, value);
458 ALvoid CDECL wine_alGetSource3f(ALuint sid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3)
460 alGetSource3f(sid, param, value1, value2, value3);
463 ALvoid CDECL wine_alGetSourcefv(ALuint sid, ALenum param, ALfloat* values)
465 alGetSourcefv(sid, param, values);
468 ALvoid CDECL wine_alGetSourcei(ALuint sid, ALenum param, ALint* value)
470 alGetSourcei(sid, param, value);
473 ALvoid CDECL wine_alGetSourceiv(ALuint sid, ALenum param, ALint* values)
475 alGetSourceiv(sid, param, values);
478 ALvoid CDECL wine_alSourcePlayv(ALsizei ns, const ALuint *sids)
480 alSourcePlayv(ns, sids);
483 ALvoid CDECL wine_alSourceStopv(ALsizei ns, const ALuint *sids)
485 alSourceStopv(ns, sids);
488 ALvoid CDECL wine_alSourceRewindv(ALsizei ns, const ALuint *sids)
490 alSourceRewindv(ns, sids);
493 ALvoid CDECL wine_alSourcePausev(ALsizei ns, const ALuint *sids)
495 alSourcePausev(ns, sids);
498 ALvoid CDECL wine_alSourcePlay(ALuint sid)
500 alSourcePlay(sid);
503 ALvoid CDECL wine_alSourceStop(ALuint sid)
505 alSourceStop(sid);
508 ALvoid CDECL wine_alSourceRewind(ALuint sid)
510 alSourceRewind(sid);
513 ALvoid CDECL wine_alSourcePause(ALuint sid)
515 alSourcePause(sid);
518 ALvoid CDECL wine_alSourceQueueBuffers(ALuint sid, ALsizei numEntries, const ALuint *bids)
520 alSourceQueueBuffers(sid, numEntries, bids);
523 ALvoid CDECL wine_alSourceUnqueueBuffers(ALuint sid, ALsizei numEntries, ALuint *bids)
525 alSourceUnqueueBuffers(sid, numEntries, bids);
528 ALvoid CDECL wine_alGenBuffers(ALsizei n, ALuint* buffers)
530 alGenBuffers(n, buffers);
533 ALvoid CDECL wine_alDeleteBuffers(ALsizei n, const ALuint* buffers)
535 alDeleteBuffers(n, buffers);
538 ALboolean CDECL wine_alIsBuffer(ALuint bid)
540 return alIsBuffer(bid);
543 ALvoid CDECL wine_alBufferData(ALuint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq)
545 alBufferData(bid, format, data, size, freq);
548 static ALvoid CDECL wine_alBufferDataStatic(const ALuint bid, ALenum format, const ALvoid* data, ALsizei size, ALsizei freq)
550 alBufferDataStatic(bid, format, data, size, freq);
553 ALvoid CDECL wine_alGetBufferf(ALuint bid, ALenum param, ALfloat* value)
555 alGetBufferf(bid, param, value);
558 ALvoid CDECL wine_alGetBufferfv(ALuint bid, ALenum param, ALfloat* values)
560 alGetBufferfv(bid, param, values);
563 ALvoid CDECL wine_alGetBufferi(ALuint bid, ALenum param, ALint* value)
565 alGetBufferi(bid, param, value);
568 ALvoid CDECL wine_alGetBufferiv(ALuint bid, ALenum param, ALint* values)
570 alGetBufferiv(bid, param, values);
573 ALvoid CDECL wine_alDopplerFactor(ALfloat value)
575 alDopplerFactor(value);
578 ALvoid CDECL wine_alDopplerVelocity(ALfloat value)
580 alDopplerVelocity(value);
583 ALvoid CDECL wine_alDistanceModel(ALenum distanceModel)
585 alDistanceModel(distanceModel);
589 /* OpenAL ALC 1.1 functions */
590 ALCdevice* CDECL wine_alcCaptureOpenDevice(const ALCchar *devicename, ALCuint frequency, ALCenum format, ALCsizei buffersize)
592 return alcCaptureOpenDevice(devicename, frequency, format, buffersize);
595 ALCboolean CDECL wine_alcCaptureCloseDevice(ALCdevice *device)
597 return alcCaptureCloseDevice(device);
600 ALCvoid CDECL wine_alcCaptureStart(ALCdevice *device)
602 alcCaptureStart(device);
605 ALCvoid CDECL wine_alcCaptureStop(ALCdevice *device)
607 alcCaptureStop(device);
610 ALCvoid CDECL wine_alcCaptureSamples(ALCdevice *device, ALCvoid *buffer, ALCsizei samples)
612 alcCaptureSamples(device, buffer, samples);
615 /* OpenAL 1.1 functions */
616 ALvoid CDECL wine_alListener3i(ALenum param, ALint value1, ALint value2, ALint value3)
618 alListener3i(param, value1, value2, value3);
621 ALvoid CDECL wine_alListeneriv(ALenum param, const ALint* values)
623 alListeneriv(param, values);
626 ALvoid CDECL wine_alGetListener3i(ALenum param, ALint *value1, ALint *value2, ALint *value3)
628 alGetListener3i(param, value1, value2, value3);
631 ALvoid CDECL wine_alSource3i(ALuint sid, ALenum param, ALint value1, ALint value2, ALint value3)
633 alSource3i(sid, param, value1, value2, value3);
636 ALvoid CDECL wine_alSourceiv(ALuint sid, ALenum param, const ALint* values)
638 alSourceiv(sid, param, values);
641 ALvoid CDECL wine_alGetSource3i(ALuint sid, ALenum param, ALint* value1, ALint* value2, ALint* value3)
643 alGetSource3i(sid, param, value1, value2, value3);
646 ALvoid CDECL wine_alBufferf(ALuint bid, ALenum param, ALfloat value)
648 alBufferf(bid, param, value);
651 ALvoid CDECL wine_alBuffer3f(ALuint bid, ALenum param, ALfloat value1, ALfloat value2, ALfloat value3)
653 alBuffer3f(bid, param, value1, value2, value3);
656 ALvoid CDECL wine_alBufferfv(ALuint bid, ALenum param, const ALfloat* values)
658 alBufferfv(bid, param, values);
661 ALvoid CDECL wine_alBufferi(ALuint bid, ALenum param, ALint value)
663 alBufferi(bid, param, value);
666 ALvoid CDECL wine_alBuffer3i(ALuint bid, ALenum param, ALint value1, ALint value2, ALint value3)
668 alBuffer3i(bid, param, value1, value2, value3);
671 ALvoid CDECL wine_alBufferiv(ALuint bid, ALenum param, const ALint* values)
673 alBufferiv(bid, param, values);
676 ALvoid CDECL wine_alGetBuffer3f(ALuint bid, ALenum param, ALfloat* value1, ALfloat* value2, ALfloat* value3)
678 alGetBuffer3f(bid, param, value1, value2, value3);
681 ALvoid CDECL wine_alGetBuffer3i(ALuint bid, ALenum param, ALint* value1, ALint* value2, ALint* value3)
683 alGetBuffer3i(bid, param, value1, value2, value3);
686 ALvoid CDECL wine_alSpeedOfSound(ALfloat value)
688 alSpeedOfSound(value);
691 /* OpenAL EFX extension functions */
692 static ALvoid CDECL wine_alGenFilters(ALsizei n, ALuint* filters)
694 alGenFilters(n, filters);
697 static ALvoid CDECL wine_alDeleteFilters(ALsizei n, const ALuint* filters)
699 alDeleteFilters(n, filters);
702 static ALboolean CDECL wine_alIsFilter(ALuint fid)
704 return alIsFilter(fid);
707 static ALvoid CDECL wine_alFilterf(ALuint fid, ALenum param, ALfloat value)
709 alFilterf(fid, param, value);
712 static ALvoid CDECL wine_alFilterfv(ALuint fid, ALenum param, const ALfloat* values)
714 alFilterfv(fid, param, values);
717 static ALvoid CDECL wine_alFilteri(ALuint fid, ALenum param, ALint value)
719 alFilteri(fid, param, value);
722 static ALvoid CDECL wine_alFilteriv(ALuint fid, ALenum param, const ALint* values)
724 alFilteriv(fid, param, values);
727 static ALvoid CDECL wine_alGetFilterf(ALuint fid, ALenum param, ALfloat* value)
729 alGetFilterf(fid, param, value);
732 static ALvoid CDECL wine_alGetFilterfv(ALuint fid, ALenum param, ALfloat* values)
734 alGetFilterfv(fid, param, values);
737 static ALvoid CDECL wine_alGetFilteri(ALuint fid, ALenum param, ALint* value)
739 alGetFilteri(fid, param, value);
742 static ALvoid CDECL wine_alGetFilteriv(ALuint fid, ALenum param, ALint* values)
744 alGetFilteriv(fid, param, values);
748 static ALvoid CDECL wine_alGenEffects(ALsizei n, ALuint* effects)
750 alGenEffects(n, effects);
753 static ALvoid CDECL wine_alDeleteEffects(ALsizei n, const ALuint* effects)
755 alDeleteEffects(n, effects);
758 static ALboolean CDECL wine_alIsEffect(ALuint eid)
760 return alIsEffect(eid);
763 static ALvoid CDECL wine_alEffectf(ALuint eid, ALenum param, ALfloat value)
765 alEffectf(eid, param, value);
768 static ALvoid CDECL wine_alEffectfv(ALuint eid, ALenum param, const ALfloat* values)
770 alEffectfv(eid, param, values);
773 static ALvoid CDECL wine_alEffecti(ALuint eid, ALenum param, ALint value)
775 alEffecti(eid, param, value);
778 static ALvoid CDECL wine_alEffectiv(ALuint eid, ALenum param, const ALint* values)
780 alEffectiv(eid, param, values);
783 static ALvoid CDECL wine_alGetEffectf(ALuint eid, ALenum param, ALfloat* value)
785 alGetEffectf(eid, param, value);
788 static ALvoid CDECL wine_alGetEffectfv(ALuint eid, ALenum param, ALfloat* values)
790 alGetEffectfv(eid, param, values);
793 static ALvoid CDECL wine_alGetEffecti(ALuint eid, ALenum param, ALint* value)
795 alGetEffecti(eid, param, value);
798 static ALvoid CDECL wine_alGetEffectiv(ALuint eid, ALenum param, ALint* values)
800 alGetEffectiv(eid, param, values);
804 static ALvoid CDECL wine_alGenAuxiliaryEffectSlots(ALsizei n, ALuint* slots)
806 alGenAuxiliaryEffectSlots(n, slots);
809 static ALvoid CDECL wine_alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint* slots)
811 alDeleteAuxiliaryEffectSlots(n, slots);
814 static ALboolean CDECL wine_alIsAuxiliaryEffectSlot(ALuint sid)
816 return alIsAuxiliaryEffectSlot(sid);
819 static ALvoid CDECL wine_alAuxiliaryEffectSlotf(ALuint sid, ALenum param, ALfloat value)
821 alAuxiliaryEffectSlotf(sid, param, value);
824 static ALvoid CDECL wine_alAuxiliaryEffectSlotfv(ALuint sid, ALenum param, const ALfloat* values)
826 alAuxiliaryEffectSlotfv(sid, param, values);
829 static ALvoid CDECL wine_alAuxiliaryEffectSloti(ALuint sid, ALenum param, ALint value)
831 alAuxiliaryEffectSloti(sid, param, value);
834 static ALvoid CDECL wine_alAuxiliaryEffectSlotiv(ALuint sid, ALenum param, const ALint* values)
836 alAuxiliaryEffectSlotiv(sid, param, values);
839 static ALvoid CDECL wine_alGetAuxiliaryEffectSlotf(ALuint sid, ALenum param, ALfloat* value)
841 alGetAuxiliaryEffectSlotf(sid, param, value);
844 static ALvoid CDECL wine_alGetAuxiliaryEffectSlotfv(ALuint sid, ALenum param, ALfloat* values)
846 alGetAuxiliaryEffectSlotfv(sid, param, values);
849 static ALvoid CDECL wine_alGetAuxiliaryEffectSloti(ALuint sid, ALenum param, ALint* value)
851 alGetAuxiliaryEffectSloti(sid, param, value);
854 static ALvoid CDECL wine_alGetAuxiliaryEffectSlotiv(ALuint sid, ALenum param, ALint* values)
856 alGetAuxiliaryEffectSlotiv(sid, param, values);
860 /* Thread-local context functions */
861 static ALCboolean CDECL wine_alcSetThreadContext(ALCcontext *context)
863 EnterCriticalSection(&openal_cs);
864 if(alcSetThreadContext(context) == ALC_FALSE)
866 WARN("Failed to make context %p current\n", context);
867 LeaveCriticalSection(&openal_cs);
868 return ALC_FALSE;
871 if(context && !loaded_procs)
873 loaded_procs = AL_TRUE;
874 LoadProcs();
876 LeaveCriticalSection(&openal_cs);
878 return ALC_TRUE;
881 static ALCcontext* CDECL wine_alcGetThreadContext(ALCvoid)
883 return alcGetThreadContext();
887 static const struct FuncList ALCFuncs[] = {
888 { "alcCreateContext", wine_alcCreateContext },
889 { "alcMakeContextCurrent", wine_alcMakeContextCurrent },
890 { "alcProcessContext", wine_alcProcessContext },
891 { "alcSuspendContext", wine_alcSuspendContext },
892 { "alcDestroyContext", wine_alcDestroyContext },
893 { "alcGetCurrentContext", wine_alcGetCurrentContext },
894 { "alcGetContextsDevice", wine_alcGetContextsDevice },
895 { "alcOpenDevice", wine_alcOpenDevice },
896 { "alcCloseDevice", wine_alcCloseDevice },
897 { "alcGetError", wine_alcGetError },
898 { "alcIsExtensionPresent", wine_alcIsExtensionPresent },
899 { "alcGetProcAddress", wine_alcGetProcAddress },
900 { "alcGetEnumValue", wine_alcGetEnumValue },
901 { "alcGetString", wine_alcGetString },
902 { "alcGetIntegerv", wine_alcGetIntegerv },
903 { "alcCaptureOpenDevice", wine_alcCaptureOpenDevice },
904 { "alcCaptureCloseDevice", wine_alcCaptureCloseDevice },
905 { "alcCaptureStart", wine_alcCaptureStart },
906 { "alcCaptureStop", wine_alcCaptureStop },
907 { "alcCaptureSamples", wine_alcCaptureSamples },
908 { "alcSetThreadContext", wine_alcSetThreadContext },
909 { "alcGetThreadContext", wine_alcGetThreadContext },
910 { NULL, NULL }
912 static const struct FuncList ALFuncs[] = {
913 { "alEnable", wine_alEnable },
914 { "alDisable", wine_alDisable },
915 { "alIsEnabled", wine_alIsEnabled },
916 { "alGetString", wine_alGetString },
917 { "alGetBooleanv", wine_alGetBooleanv },
918 { "alGetIntegerv", wine_alGetIntegerv },
919 { "alGetFloatv", wine_alGetFloatv },
920 { "alGetDoublev", wine_alGetDoublev },
921 { "alGetBoolean", wine_alGetBoolean },
922 { "alGetInteger", wine_alGetInteger },
923 { "alGetFloat", wine_alGetFloat },
924 { "alGetDouble", wine_alGetDouble },
925 { "alGetError", wine_alGetError },
926 { "alIsExtensionPresent", wine_alIsExtensionPresent },
927 { "alGetProcAddress", wine_alGetProcAddress },
928 { "alGetEnumValue", wine_alGetEnumValue },
929 { "alListenerf", wine_alListenerf },
930 { "alListener3f", wine_alListener3f },
931 { "alListenerfv", wine_alListenerfv },
932 { "alListeneri", wine_alListeneri },
933 { "alListener3i", wine_alListener3i },
934 { "alListeneriv", wine_alListeneriv },
935 { "alGetListenerf", wine_alGetListenerf },
936 { "alGetListener3f", wine_alGetListener3f },
937 { "alGetListenerfv", wine_alGetListenerfv },
938 { "alGetListeneri", wine_alGetListeneri },
939 { "alGetListener3i", wine_alGetListener3i },
940 { "alGetListeneriv", wine_alGetListeneriv },
941 { "alGenSources", wine_alGenSources },
942 { "alDeleteSources", wine_alDeleteSources },
943 { "alIsSource", wine_alIsSource },
944 { "alSourcef", wine_alSourcef },
945 { "alSource3f", wine_alSource3f },
946 { "alSourcefv", wine_alSourcefv },
947 { "alSourcei", wine_alSourcei },
948 { "alSource3i", wine_alSource3i },
949 { "alSourceiv", wine_alSourceiv },
950 { "alGetSourcef", wine_alGetSourcef },
951 { "alGetSource3f", wine_alGetSource3f },
952 { "alGetSourcefv", wine_alGetSourcefv },
953 { "alGetSourcei", wine_alGetSourcei },
954 { "alGetSource3i", wine_alGetSource3i },
955 { "alGetSourceiv", wine_alGetSourceiv },
956 { "alSourcePlayv", wine_alSourcePlayv },
957 { "alSourceStopv", wine_alSourceStopv },
958 { "alSourceRewindv", wine_alSourceRewindv },
959 { "alSourcePausev", wine_alSourcePausev },
960 { "alSourcePlay", wine_alSourcePlay },
961 { "alSourceStop", wine_alSourceStop },
962 { "alSourceRewind", wine_alSourceRewind },
963 { "alSourcePause", wine_alSourcePause },
964 { "alSourceQueueBuffers", wine_alSourceQueueBuffers },
965 { "alSourceUnqueueBuffers", wine_alSourceUnqueueBuffers },
966 { "alGenBuffers", wine_alGenBuffers },
967 { "alDeleteBuffers", wine_alDeleteBuffers },
968 { "alIsBuffer", wine_alIsBuffer },
969 { "alBufferData", wine_alBufferData },
970 { "alBufferDataStatic", wine_alBufferDataStatic },
971 { "alBufferf", wine_alBufferf },
972 { "alBuffer3f", wine_alBuffer3f },
973 { "alBufferfv", wine_alBufferfv },
974 { "alBufferi", wine_alBufferi },
975 { "alBuffer3i", wine_alBuffer3i },
976 { "alBufferiv", wine_alBufferiv },
977 { "alGetBufferf", wine_alGetBufferf },
978 { "alGetBuffer3f", wine_alGetBuffer3f },
979 { "alGetBufferfv", wine_alGetBufferfv },
980 { "alGetBufferi", wine_alGetBufferi },
981 { "alGetBuffer3i", wine_alGetBuffer3i },
982 { "alGetBufferiv", wine_alGetBufferiv },
983 { "alDopplerFactor", wine_alDopplerFactor },
984 { "alDopplerVelocity", wine_alDopplerVelocity },
985 { "alSpeedOfSound", wine_alSpeedOfSound },
986 { "alDistanceModel", wine_alDistanceModel },
988 { "alGenFilters", wine_alGenFilters },
989 { "alDeleteFilters", wine_alDeleteFilters },
990 { "alIsFilter", wine_alIsFilter },
991 { "alFilterf", wine_alFilterf },
992 { "alFilterfv", wine_alFilterfv },
993 { "alFilteri", wine_alFilteri },
994 { "alFilteriv", wine_alFilteriv },
995 { "alGetFilterf", wine_alGetFilterf },
996 { "alGetFilterfv", wine_alGetFilterfv },
997 { "alGetFilteri", wine_alGetFilteri },
998 { "alGetFilteriv", wine_alGetFilteriv },
1000 { "alGenEffects", wine_alGenEffects },
1001 { "alDeleteEffects", wine_alDeleteEffects },
1002 { "alIsEffect", wine_alIsEffect },
1003 { "alEffectf", wine_alEffectf },
1004 { "alEffectfv", wine_alEffectfv },
1005 { "alEffecti", wine_alEffecti },
1006 { "alEffectiv", wine_alEffectiv },
1007 { "alGetEffectf", wine_alGetEffectf },
1008 { "alGetEffectfv", wine_alGetEffectfv },
1009 { "alGetEffecti", wine_alGetEffecti },
1010 { "alGetEffectiv", wine_alGetEffectiv },
1012 { "alGenAuxiliaryEffectSlots", wine_alGenAuxiliaryEffectSlots},
1013 { "alDeleteAuxiliaryEffectSlots",wine_alDeleteAuxiliaryEffectSlots},
1014 { "alIsAuxiliaryEffectSlot", wine_alIsAuxiliaryEffectSlot },
1015 { "alAuxiliaryEffectSlotf", wine_alAuxiliaryEffectSlotf },
1016 { "alAuxiliaryEffectSlotfv", wine_alAuxiliaryEffectSlotfv },
1017 { "alAuxiliaryEffectSloti", wine_alAuxiliaryEffectSloti },
1018 { "alAuxiliaryEffectSlotiv", wine_alAuxiliaryEffectSlotiv },
1019 { "alGetAuxiliaryEffectSlotf", wine_alGetAuxiliaryEffectSlotf},
1020 { "alGetAuxiliaryEffectSlotfv", wine_alGetAuxiliaryEffectSlotfv},
1021 { "alGetAuxiliaryEffectSloti", wine_alGetAuxiliaryEffectSloti},
1022 { "alGetAuxiliaryEffectSlotiv", wine_alGetAuxiliaryEffectSlotiv},
1024 { NULL, NULL }