1 /**
2 Boost Software License - Version 1.0 - August 17th, 2003
3 
4 Copyright (c) 2018 Clipsey
5 
6 Permission is hereby granted, free of charge, to any person or organization
7 obtaining a copy of the software and accompanying documentation covered by
8 this license (the "Software") to use, reproduce, display, distribute,
9 execute, and transmit the Software, and to prepare derivative works of the
10 Software, and to permit third-parties to whom the Software is furnished to
11 do so, all subject to the following:
12 
13 The copyright notices in the Software and this entire statement, including
14 the above license grant, this restriction and the following disclaimer,
15 must be included in all copies of the Software, in whole or in part, and
16 all derivative works of the Software, unless such copies or derivative
17 works are solely in the form of machine-executable object code generated by
18 a source language processor.
19 
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
23 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
24 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
25 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 DEALINGS IN THE SOFTWARE.
27 */
28 module openal.binding;
29 import openal.types;
30 import bindbc.loader;
31 import std.string;
32 
33 extern(C) @nogc nothrow {
34     alias alEnableFunc                  = void function(ALenum);
35     alias alDisableFunc                 = void function(ALenum);
36     alias alIsEnabledFunc               = ALboolean function(ALenum);
37     alias alGetStringFunc               = const(ALchar)* function(ALenum);
38     alias alGetBooleanvFunc             = void function(ALenum, ALboolean*);
39     alias alGetIntegervFunc             = void function(ALenum, ALint*);
40     alias alGetFloatvFunc               = void function(ALenum, ALfloat*);
41     alias alGetDoublevFunc              = void function(ALenum, ALdouble*);
42     alias alGetBooleanFunc              = ALboolean function(ALenum);
43     alias alGetIntegerFunc              = ALint function(ALenum);
44     alias alGetFloatFunc                = ALfloat function(ALenum);
45     alias alGetDoubleFunc               = ALdouble function(ALenum);
46     alias alGetErrorFunc                = ALenum function();
47     alias alIsExtensionPresentFunc      = ALboolean function(const(char)*);
48     alias alGetProcAddressFunc          = ALvoid* function(const(char)*);
49     alias alGetEnumValueFunc            = ALenum function(const(char)*);
50     alias alListenerfFunc               = void function(ALenum, ALfloat);
51     alias alListener3fFunc              = void function(ALenum, ALfloat, ALfloat, ALfloat);
52     alias alListenerfvFunc              = void function(ALenum, const(ALfloat)*);
53     alias alListeneriFunc               = void function(ALenum, ALint);
54     alias alListener3iFunc              = void function(ALenum, ALint, ALint, ALint);
55     alias alListenerivFunc              = void function(ALenum, const(ALint)*);
56     alias alGetListenerfFunc            = void function(ALenum, ALfloat*);
57     alias alGetListener3fFunc           = void function(ALenum, ALfloat*, ALfloat*, ALfloat*);
58     alias alGetListenerfvFunc           = void function(ALenum, ALfloat*);
59     alias alGetListeneriFunc            = void function(ALenum, ALint*);
60     alias alGetListener3iFunc           = void function(ALenum, ALint*, ALint*, ALint*);
61     alias alGetListenerivFunc           = void function(ALenum, ALint*);
62     alias alGenSourcesFunc              = void function(ALsizei, ALuint*);
63     alias alDeleteSourcesFunc           = void function(ALsizei, const(ALuint)*);
64     alias alIsSourceFunc                = ALboolean function(ALuint);
65     alias alSourcefFunc                 = void function(ALuint, ALenum, ALfloat);
66     alias alSource3fFunc                = void function(ALuint, ALenum, ALfloat, ALfloat, ALfloat);
67     alias alSourcefvFunc                = void function(ALuint, ALenum, const(ALfloat)*);
68     alias alSourceiFunc                 = void function(ALuint, ALenum, ALint);
69     alias alSource3iFunc                = void function(ALuint, ALenum, ALint, ALint, ALint);
70     alias alSourceivFunc                = void function(ALuint, ALenum, const(ALint)*);
71     alias alGetSourcefFunc              = void function(ALuint, ALenum, ALfloat*);
72     alias alGetSource3fFunc             = void function(ALuint, ALenum, ALfloat*, ALfloat*, ALfloat*);
73     alias alGetSourcefvFunc             = void function(ALuint, ALenum, ALfloat*);
74     alias alGetSourceiFunc              = void function(ALuint, ALenum, ALint*);
75     alias alGetSource3iFunc             = void function(ALuint, ALenum, ALint*, ALint*, ALint*);
76     alias alGetSourceivFunc             = void function(ALuint, ALenum, ALint*);
77     alias alSourcePlayvFunc             = void function(ALsizei, const(ALuint)*);
78     alias alSourceStopvFunc             = void function(ALsizei, const(ALuint)*);
79     alias alSourceRewindvFunc           = void function(ALsizei, const(ALuint)*);
80     alias alSourcePausevFunc            = void function(ALsizei, const(ALuint)*);
81     alias alSourcePlayFunc              = void function(ALuint);
82     alias alSourcePauseFunc             = void function(ALuint);
83     alias alSourceRewindFunc            = void function(ALuint);
84     alias alSourceStopFunc              = void function(ALuint);
85     alias alSourceQueueBuffersFunc      = void function(ALuint, ALsizei, ALuint*);
86     alias alSourceUnqueueBuffersFunc    = void function(ALuint, ALsizei, ALuint*);
87     alias alGenBuffersFunc              = void function(ALsizei, ALuint*);
88     alias alDeleteBuffersFunc           = void function(ALsizei, const(ALuint)*);
89     alias alIsBufferFunc                = ALboolean function(ALuint);
90     alias alBufferDataFunc              = void function(ALuint, ALenum, const(ALvoid)*, ALsizei, ALsizei);
91     alias alBufferfFunc                 = void function(ALuint, ALenum, ALfloat);
92     alias alBuffer3fFunc                = void function(ALuint, ALenum, ALfloat, ALfloat, ALfloat);
93     alias alBufferfvFunc                = void function(ALuint, ALenum, const(ALfloat)*);
94     alias alBufferiFunc                 = void function(ALuint, ALenum, ALint);
95     alias alBuffer3iFunc                = void function(ALuint, ALenum, ALint, ALint, ALint);
96     alias alBufferivFunc                = void function(ALuint, ALenum, const(ALint)*);
97     alias alGetBufferfFunc              = void function(ALuint, ALenum, ALfloat*);
98     alias alGetBuffer3fFunc             = void function(ALuint, ALenum, ALfloat*, ALfloat*, ALfloat*);
99     alias alGetBufferfvFunc             = void function(ALuint, ALenum, ALfloat*);
100     alias alGetBufferiFunc              = void function(ALuint, ALenum, ALint*);
101     alias alGetBuffer3iFunc             = void function(ALuint, ALenum, ALint*, ALint*, ALint*);
102     alias alGetBufferivFunc             = void function(ALuint, ALenum, ALint*);
103     alias alDopplerFactorFunc           = void function(ALfloat);
104     alias alDopplerVelocityFunc         = void function(ALfloat);
105     alias alSpeedOfSoundFunc            = void function(ALfloat);
106     alias alDistanceModelFunc           = void function(ALenum);
107     alias alcCreateContextFunc          = ALCcontext* function(ALCdevice*, const(ALCint)*);
108     alias alcMakeContextCurrentFunc     = ALCboolean function(ALCcontext*);
109     alias alcProcessContextFunc         = void function(ALCcontext*);
110     alias alcSuspendContextFunc         = void function(ALCcontext*);
111     alias alcDestroyContextFunc         = void function(ALCcontext*);
112     alias alcGetCurrentContextFunc      = ALCcontext* function();
113     alias alcGetContextsDeviceFunc      = ALCdevice* function(ALCcontext*);
114     alias alcOpenDeviceFunc             = ALCdevice* function(const(char)*);
115     alias alcCloseDeviceFunc            = ALCboolean function(ALCdevice*);
116     alias alcGetErrorFunc               = ALCenum function(ALCdevice*);
117     alias alcIsExtensionPresentFunc     = ALCboolean function(ALCdevice*, const(char)*);
118     alias alcGetProcAddressFunc         = void* function(ALCdevice*, const(char)*);
119     alias alcGetEnumValueFunc           = ALCenum function(ALCdevice*, const(char)*);
120     alias alcGetStringFunc              = const(char)* function(ALCdevice*, ALCenum);
121     alias alcGetIntegervFunc            = void function(ALCdevice*, ALCenum, ALCsizei, ALCint*);
122     alias alcCaptureOpenDeviceFunc      = ALCdevice* function(const(char)*, ALCuint, ALCenum, ALCsizei);
123     alias alcCaptureCloseDeviceFunc     = ALCboolean function(ALCdevice*);
124     alias alcCaptureStartFunc           = void function(ALCdevice*);
125     alias alcCaptureStopFunc            = void function(ALCdevice*);
126     alias alcCaptureSamplesFunc         = void function(ALCdevice*, ALCvoid*, ALCsizei);
127 
128     //EFX
129 
130     // Effects
131     alias alGenEffectsFunc              = void function(ALsizei, ALuint*);
132     alias alDeleteEffectsFunc           = void function(ALsizei, const(ALuint)*);
133     alias alIsEffectFunc                = ALboolean function(ALuint);
134     alias alEffectiFunc                 = void function(ALuint, ALenum, ALint);
135     alias alEffectivFunc                = void function(ALuint, ALenum, const(ALint)*);
136     alias alEffectfFunc                 = void function(ALuint, ALenum, ALfloat);
137     alias alEffectfvFunc                = void function(ALuint, ALenum, const(ALfloat)*);
138     alias alGetEffectiFunc              = void function(ALuint, ALenum, ALint*);
139     alias alGetEffectivFunc             = void function(ALuint, ALenum, ALint*);
140     alias alGetEffectfFunc              = void function(ALuint, ALenum, ALfloat*);
141     alias alGetEffectfvFunc             = void function(ALuint, ALenum, ALfloat*);
142 
143     // Filters
144     alias alGenFiltersFunc              = void function(ALsizei, ALuint*);
145     alias alDeleteFiltersFunc           = void function(ALsizei, const(ALuint)*);
146     alias alIsFilterFunc                = ALboolean function(ALuint);
147     alias alFilteriFunc                 = void function(ALuint, ALenum, ALint);
148     alias alFilterivFunc                = void function(ALuint, ALenum, const(ALint)*);
149     alias alFilterfFunc                 = void function(ALuint, ALenum, ALfloat);
150     alias alFilterfvFunc                = void function(ALuint, ALenum, const(ALfloat)*);
151     alias alGetFilteriFunc              = void function(ALuint, ALenum, ALint*);
152     alias alGetFilterivFunc             = void function(ALuint, ALenum, ALint*);
153     alias alGetFilterfFunc              = void function(ALuint, ALenum, ALfloat*);
154     alias alGetFilterfvFunc             = void function(ALuint, ALenum, ALfloat*);
155 
156     // Filters
157     alias alGenAuxiliaryEffectSlotsFunc                 = void function(ALsizei, ALuint*);
158     alias alDeleteAuxiliaryEffectSlotFunc               = void function(ALsizei, const(ALuint)*);
159     alias alIsAuxiliaryEffectSlotFunc                   = ALboolean function(ALuint);
160     alias alAuxiliaryEffectSlotiFunc                    = void function(ALuint, ALenum, ALint);
161     alias alAuxiliaryEffectSlotivFunc                   = void function(ALuint, ALenum, const(ALint)*);
162     alias alAuxiliaryEffectSlotfFunc                    = void function(ALuint, ALenum, ALfloat);
163     alias alAuxiliaryEffectSlotfvFunc                   = void function(ALuint, ALenum, const(ALfloat)*);
164     alias alGetAuxiliaryEffectSlotiFunc                 = void function(ALuint, ALenum, ALint*);
165     alias alGetAuxiliaryEffectSlotivFunc                = void function(ALuint, ALenum, ALint*);
166     alias alGetAuxiliaryEffectSlotfFunc                 = void function(ALuint, ALenum, ALfloat*);
167     alias alGetAuxiliaryEffectSlotfvFunc                = void function(ALuint, ALenum, ALfloat*);
168 }
169 
170 __gshared {
171     alEnableFunc				        alEnable;
172     alDisableFunc				        alDisable;
173     alIsEnabledFunc				        alIsEnabled;
174     alGetStringFunc				        alGetString;
175     alGetBooleanvFunc				    alGetBooleanv;
176     alGetIntegervFunc				    alGetIntegerv;
177     alGetFloatvFunc				        alGetFloatv;
178     alGetDoublevFunc				    alGetDoublev;
179     alGetBooleanFunc				    alGetBoolean;
180     alGetIntegerFunc				    alGetInteger;
181     alGetFloatFunc				        alGetFloat;
182     alGetDoubleFunc				        alGetDouble;
183     alGetErrorFunc				        alGetError;
184     alIsExtensionPresentFunc		    alIsExtensionPresent;
185     alGetProcAddressFunc			    alGetProcAddress;
186     alGetEnumValueFunc				    alGetEnumValue;
187     alListenerfFunc				        alListenerf;
188     alListener3fFunc				    alListener3f;
189     alListenerfvFunc				    alListenerfv;
190     alListeneriFunc				        alListeneri;
191     alListener3iFunc				    alListener3i;
192     alListenerivFunc				    alListeneriv;
193     alGetListenerfFunc				    alGetListenerf;
194     alGetListener3fFunc				    alGetListener3f;
195     alGetListenerfvFunc				    alGetListenerfv;
196     alGetListeneriFunc				    alGetListeneri;
197     alGetListener3iFunc				    alGetListener3i;
198     alGetListenerivFunc				    alGetListeneriv;
199 
200     alGenSourcesFunc				    alGenSources;
201     alDeleteSourcesFunc				    alDeleteSources;
202     alIsSourceFunc				        alIsSource;
203     alSourcefFunc				        alSourcef;
204     alSource3fFunc				        alSource3f;
205     alSourcefvFunc			    	    alSourcefv;
206     alSourceiFunc				        alSourcei;
207     alSource3iFunc				        alSource3i;
208     alSourceivFunc				        alSourceiv;
209     alGetSourcefFunc				    alGetSourcef;
210     alGetSource3fFunc				    alGetSource3f;
211     alGetSourcefvFunc				    alGetSourcefv;
212     alGetSourceiFunc				    alGetSourcei;
213     alGetSource3iFunc				    alGetSource3i;
214     alGetSourceivFunc				    alGetSourceiv;
215     alSourcePlayvFunc				    alSourcePlayv;
216     alSourceStopvFunc				    alSourceStopv;
217     alSourceRewindvFunc				    alSourceRewindv;
218     alSourcePausevFunc				    alSourcePausev;
219     alSourcePlayFunc				    alSourcePlay;
220     alSourcePauseFunc				    alSourcePause;
221     alSourceRewindFunc				    alSourceRewind;
222     alSourceStopFunc				    alSourceStop;
223     alSourceQueueBuffersFunc		    alSourceQueueBuffers;
224     alSourceUnqueueBuffersFunc		    alSourceUnqueueBuffers;
225 
226     alGenBuffersFunc				    alGenBuffers;
227     alDeleteBuffersFunc				    alDeleteBuffers;
228     alIsBufferFunc				        alIsBuffer;
229     alBufferDataFunc				    alBufferData;
230     alBufferfFunc				        alBufferf;
231     alBuffer3fFunc				        alBuffer3f;
232     alBufferfvFunc				        alBufferfv;
233     alBufferiFunc				        alBufferi;
234     alBuffer3iFunc				        alBuffer3i;
235     alBufferivFunc				        alBufferiv;
236     alGetBufferfFunc				    alGetBufferf;
237     alGetBuffer3fFunc				    alGetBuffer3f;
238     alGetBufferfvFunc				    alGetBufferfv;
239     alGetBufferiFunc				    alGetBufferi;
240     alGetBuffer3iFunc				    alGetBuffer3i;
241     alGetBufferivFunc				    alGetBufferiv;
242     alDopplerFactorFunc				    alDopplerFactor;
243     alDopplerVelocityFunc			    alDopplerVelocity;
244     alSpeedOfSoundFunc				    alSpeedOfSound;
245     alDistanceModelFunc				    alDistanceModel;
246     alcCreateContextFunc			    alcCreateContext;
247     alcMakeContextCurrentFunc		    alcMakeContextCurrent;
248     alcProcessContextFunc			    alcProcessContext;
249     alcSuspendContextFunc			    alcSuspendContext;
250     alcDestroyContextFunc			    alcDestroyContext;
251     alcGetCurrentContextFunc		    alcGetCurrentContext;
252     alcGetContextsDeviceFunc		    alcGetContextsDevice;
253     alcOpenDeviceFunc				    alcOpenDevice;
254     alcCloseDeviceFunc				    alcCloseDevice;
255     alcGetErrorFunc				        alcGetError;
256     alcIsExtensionPresentFunc		    alcIsExtensionPresent;
257     alcGetProcAddressFunc			    alcGetProcAddress;
258     alcGetEnumValueFunc				    alcGetEnumValue;
259     alcGetStringFunc				    alcGetString;
260     alcGetIntegervFunc				    alcGetIntegerv;
261     alcCaptureOpenDeviceFunc		    alcCaptureOpenDevice;
262     alcCaptureCloseDeviceFunc		    alcCaptureCloseDevice;
263     alcCaptureStartFunc				    alcCaptureStart;
264     alcCaptureStopFunc				    alcCaptureStop;
265     alcCaptureSamplesFunc               alcCaptureSamples;
266 
267     // EFX
268 
269     // Effects
270     alGenEffectsFunc                    alGenEffects;
271     alDeleteEffectsFunc                 alDeleteEffects;
272     alIsEffectFunc                      alIsEffect;
273     alEffectiFunc                       alEffecti;
274     alEffectivFunc                      alEffectiv;
275     alEffectfFunc                       alEffectf;
276     alEffectfvFunc                      alEffectfv;
277     alGetEffectiFunc                    alGetEffecti;
278     alGetEffectivFunc                   alGetEffectiv;
279     alGetEffectfFunc                    alGetEffectf;
280     alGetEffectfvFunc                   alGetEffectfv;
281 
282     // Filters
283     alGenFiltersFunc                    alGenFilters;
284     alDeleteFiltersFunc                 alDeleteFilters;
285     alIsFilterFunc                      alIsFilter;
286     alFilteriFunc                       alFilteri;
287     alFilterivFunc                      alFilteriv;
288     alFilterfFunc                       alFilterf;
289     alFilterfvFunc                      alFilterfv;
290     alGetFilteriFunc                    alGetFilteri;
291     alGetFilterivFunc                   alGetFilteriv;
292     alGetFilterfFunc                    alGetFilterf;
293     alGetFilterfvFunc                   alGetFilterfv;
294 
295     // Auxiliary Effect Slots
296     alGenAuxiliaryEffectSlotsFunc       alGenAuxiliaryEffectSlots;
297     alDeleteAuxiliaryEffectSlotFunc     alDeleteAuxiliaryEffectSlots;
298     alIsAuxiliaryEffectSlotFunc         alIsAuxiliaryEffectSlot;
299     alAuxiliaryEffectSlotiFunc          alAuxiliaryEffectSloti;
300     alAuxiliaryEffectSlotivFunc         alAuxiliaryEffectSlotiv;
301     alAuxiliaryEffectSlotfFunc          alAuxiliaryEffectSlotf;
302     alAuxiliaryEffectSlotfvFunc         alAuxiliaryEffectSlotfv;
303     alGetAuxiliaryEffectSlotiFunc       alGetAuxiliaryEffectSloti;
304     alGetAuxiliaryEffectSlotivFunc      alGetAuxiliaryEffectSlotiv;
305     alGetAuxiliaryEffectSlotfFunc       alGetAuxiliaryEffectSlotf;
306     alGetAuxiliaryEffectSlotfvFunc      alGetAuxiliaryEffectSlotfv;            
307 }
308 
309 private {
310     SharedLib lib;
311 }
312 
313 version(Windows) {
314     enum libNames = "OpenAl32.dll,oal_soft.dll";
315 } else version(OSX) {
316     enum libNames = "../Frameworks/OpenAL.framework/OpenAL, /Library/Frameworks/OpenAL.framework/OpenAL, /System/Library/Frameworks/OpenAL.framework/OpenAL";
317 } else version(Posix) {
318     enum libNames = "libopenal.so,libopenal.so.1,libopenal.so.0,liboalsoft.so,libal.so,libAL.so,";
319 } else {
320     enum libNames = "NOT_SUPPORTED";
321 }
322 
323 void unloadOAL() {
324     if (lib != invalidHandle) {
325         lib.unload();
326     }
327 }
328 
329 bool loadOAL() {
330     if (libNames == "NOT_SUPPORTED") throw new Exception("OpenAL not supported on your platform currently.");
331     foreach (lib; libNames.split(',')) {
332         if (loadOAL(lib.dup.ptr)) return true;
333     }
334     return false;
335 }
336 
337 bool loadOAL(const(char)* libName) {
338     if (lib == invalidHandle) {
339         lib = load(libName);
340         if (lib == invalidHandle) {
341             return false;
342         }
343     }
344 
345     auto errCount = errorCount();
346     lib.bindSymbol(cast(void**)&alEnable, "alEnable");
347     lib.bindSymbol(cast(void**)&alDisable, "alDisable");
348     lib.bindSymbol(cast(void**)&alIsEnabled, "alIsEnabled");
349     lib.bindSymbol(cast(void**)&alGetString, "alGetString");
350     lib.bindSymbol(cast(void**)&alGetBooleanv, "alGetBooleanv");
351     lib.bindSymbol(cast(void**)&alGetIntegerv, "alGetIntegerv");
352     lib.bindSymbol(cast(void**)&alGetFloatv, "alGetFloatv");
353     lib.bindSymbol(cast(void**)&alGetDoublev, "alGetDoublev");
354     lib.bindSymbol(cast(void**)&alGetInteger, "alGetInteger");
355     lib.bindSymbol(cast(void**)&alGetFloat, "alGetFloat");
356     lib.bindSymbol(cast(void**)&alGetDouble, "alGetDouble");
357     lib.bindSymbol(cast(void**)&alGetError, "alGetError");
358     lib.bindSymbol(cast(void**)&alIsExtensionPresent, "alIsExtensionPresent");
359     lib.bindSymbol(cast(void**)&alGetProcAddress, "alGetProcAddress");
360     lib.bindSymbol(cast(void**)&alGetEnumValue, "alGetEnumValue");
361     lib.bindSymbol(cast(void**)&alListenerf, "alListenerf");
362     lib.bindSymbol(cast(void**)&alListener3f, "alListener3f");
363     lib.bindSymbol(cast(void**)&alListenerfv, "alListenerfv");
364     lib.bindSymbol(cast(void**)&alListeneri, "alListeneri");
365     lib.bindSymbol(cast(void**)&alListener3i, "alListener3i");
366     lib.bindSymbol(cast(void**)&alListeneriv, "alListeneriv");
367     lib.bindSymbol(cast(void**)&alGetListenerf, "alGetListenerf");
368     lib.bindSymbol(cast(void**)&alGetListener3f, "alGetListener3f");
369     lib.bindSymbol(cast(void**)&alGetListenerfv, "alGetListenerfv");
370     lib.bindSymbol(cast(void**)&alGetListeneri, "alGetListeneri");
371     lib.bindSymbol(cast(void**)&alGetListener3i, "alGetListener3i");
372     lib.bindSymbol(cast(void**)&alGetListeneriv, "alGetListeneriv");
373     lib.bindSymbol(cast(void**)&alGenSources, "alGenSources");
374     lib.bindSymbol(cast(void**)&alDeleteSources, "alDeleteSources");
375     lib.bindSymbol(cast(void**)&alIsSource, "alIsSource");
376     lib.bindSymbol(cast(void**)&alSourcef, "alSourcef");
377     lib.bindSymbol(cast(void**)&alSource3f, "alSource3f");
378     lib.bindSymbol(cast(void**)&alSourcefv, "alSourcefv");
379     lib.bindSymbol(cast(void**)&alSourcei, "alSourcei");
380     lib.bindSymbol(cast(void**)&alSource3i, "alSource3i");
381     lib.bindSymbol(cast(void**)&alSourceiv, "alSourceiv");
382     lib.bindSymbol(cast(void**)&alGetSourcef, "alGetSourcef");
383     lib.bindSymbol(cast(void**)&alGetSource3f, "alGetSource3f");
384     lib.bindSymbol(cast(void**)&alGetSourcefv, "alGetSourcefv");
385     lib.bindSymbol(cast(void**)&alGetSourcei, "alGetSourcei");
386     lib.bindSymbol(cast(void**)&alGetSource3i, "alGetSource3i");
387     lib.bindSymbol(cast(void**)&alGetSourceiv, "alGetSourceiv");
388     lib.bindSymbol(cast(void**)&alSourcePlayv, "alSourcePlayv");
389     lib.bindSymbol(cast(void**)&alSourceStopv, "alSourceStopv");
390     lib.bindSymbol(cast(void**)&alSourceRewindv, "alSourceRewindv");
391     lib.bindSymbol(cast(void**)&alSourcePausev, "alSourcePausev");
392     lib.bindSymbol(cast(void**)&alSourcePlay, "alSourcePlay");
393     lib.bindSymbol(cast(void**)&alSourcePause, "alSourcePause");
394     lib.bindSymbol(cast(void**)&alSourceRewind, "alSourceRewind");
395     lib.bindSymbol(cast(void**)&alSourceStop, "alSourceStop");
396     lib.bindSymbol(cast(void**)&alSourceQueueBuffers, "alSourceQueueBuffers");
397     lib.bindSymbol(cast(void**)&alSourceUnqueueBuffers, "alSourceUnqueueBuffers");
398     lib.bindSymbol(cast(void**)&alGenBuffers, "alGenBuffers");
399     lib.bindSymbol(cast(void**)&alDeleteBuffers, "alDeleteBuffers");
400     lib.bindSymbol(cast(void**)&alIsBuffer, "alIsBuffer");
401     lib.bindSymbol(cast(void**)&alBufferData, "alBufferData");
402     lib.bindSymbol(cast(void**)&alBufferf, "alBufferf");
403     lib.bindSymbol(cast(void**)&alBuffer3f, "alBuffer3f");
404     lib.bindSymbol(cast(void**)&alBufferfv, "alBufferfv");
405     lib.bindSymbol(cast(void**)&alBufferi, "alBufferi");
406     lib.bindSymbol(cast(void**)&alBuffer3i, "alBuffer3i");
407     lib.bindSymbol(cast(void**)&alBufferiv, "alBufferiv");
408     lib.bindSymbol(cast(void**)&alGetBufferf, "alGetBufferf");
409     lib.bindSymbol(cast(void**)&alGetBuffer3f, "alGetBuffer3f");
410     lib.bindSymbol(cast(void**)&alGetBufferfv, "alGetBufferfv");
411     lib.bindSymbol(cast(void**)&alGetBufferi, "alGetBufferi");
412     lib.bindSymbol(cast(void**)&alGetBuffer3i, "alGetBuffer3i");
413     lib.bindSymbol(cast(void**)&alGetBufferiv, "alGetBufferiv");
414     lib.bindSymbol(cast(void**)&alDopplerFactor, "alDopplerFactor");
415     lib.bindSymbol(cast(void**)&alDopplerVelocity, "alDopplerVelocity");
416     lib.bindSymbol(cast(void**)&alSpeedOfSound, "alSpeedOfSound");
417     lib.bindSymbol(cast(void**)&alDistanceModel, "alDistanceModel");
418     lib.bindSymbol(cast(void**)&alcCreateContext, "alcCreateContext");
419     lib.bindSymbol(cast(void**)&alcMakeContextCurrent, "alcMakeContextCurrent");
420     lib.bindSymbol(cast(void**)&alcProcessContext, "alcProcessContext");
421     lib.bindSymbol(cast(void**)&alcGetCurrentContext, "alcGetCurrentContext");
422     lib.bindSymbol(cast(void**)&alcGetContextsDevice, "alcGetContextsDevice");
423     lib.bindSymbol(cast(void**)&alcSuspendContext, "alcSuspendContext");
424     lib.bindSymbol(cast(void**)&alcDestroyContext, "alcDestroyContext");
425     lib.bindSymbol(cast(void**)&alcOpenDevice, "alcOpenDevice");
426     lib.bindSymbol(cast(void**)&alcCloseDevice, "alcCloseDevice");
427     lib.bindSymbol(cast(void**)&alcGetError, "alcGetError");
428     lib.bindSymbol(cast(void**)&alcIsExtensionPresent, "alcIsExtensionPresent");
429     lib.bindSymbol(cast(void**)&alcGetProcAddress, "alcGetProcAddress");
430     lib.bindSymbol(cast(void**)&alcGetEnumValue, "alcGetEnumValue");
431     lib.bindSymbol(cast(void**)&alcGetString, "alcGetString");
432     lib.bindSymbol(cast(void**)&alcGetIntegerv, "alcGetIntegerv");
433     lib.bindSymbol(cast(void**)&alcCaptureOpenDevice, "alcCaptureOpenDevice");
434     lib.bindSymbol(cast(void**)&alcCaptureCloseDevice, "alcCaptureCloseDevice");
435     lib.bindSymbol(cast(void**)&alcCaptureStart, "alcCaptureStart");
436     lib.bindSymbol(cast(void**)&alcCaptureStop, "alcCaptureStop");
437     lib.bindSymbol(cast(void**)&alcCaptureSamples, "alcCaptureSamples");
438 
439     // EFX
440 
441     // Effects
442     lib.bindSymbol(cast(void**)&alGenEffects,       "alGenEffects");
443     lib.bindSymbol(cast(void**)&alDeleteEffects,    "alDeleteEffects");
444     lib.bindSymbol(cast(void**)&alIsEffect,         "alIsEffect");
445     lib.bindSymbol(cast(void**)&alEffecti,          "alEffecti");
446     lib.bindSymbol(cast(void**)&alEffectiv,         "alEffectiv");
447     lib.bindSymbol(cast(void**)&alEffectf,          "alEffectf");
448     lib.bindSymbol(cast(void**)&alEffectfv,         "alEffectfv");
449     lib.bindSymbol(cast(void**)&alGetEffecti,       "alGetEffecti");
450     lib.bindSymbol(cast(void**)&alGetEffectiv,      "alGetEffectiv");
451     lib.bindSymbol(cast(void**)&alGetEffectf,       "alGetEffectf");
452     lib.bindSymbol(cast(void**)&alGetEffectfv,      "alGetEffectfv");
453 
454     // Filters
455     lib.bindSymbol(cast(void**)&alGenFilters,       "alGenFilters");
456     lib.bindSymbol(cast(void**)&alDeleteFilters,    "alDeleteFilters");
457     lib.bindSymbol(cast(void**)&alIsFilter,         "alIsFilter");
458     lib.bindSymbol(cast(void**)&alFilteri,          "alFilteri");
459     lib.bindSymbol(cast(void**)&alFilteriv,         "alFilteriv");
460     lib.bindSymbol(cast(void**)&alFilterf,          "alFilterf");
461     lib.bindSymbol(cast(void**)&alFilterfv,         "alFilterfv");
462     lib.bindSymbol(cast(void**)&alGetFilteri,       "alGetFilteri");
463     lib.bindSymbol(cast(void**)&alGetFilteriv,      "alGetFilteriv");
464     lib.bindSymbol(cast(void**)&alGetFilterf,       "alGetFilterf");
465     lib.bindSymbol(cast(void**)&alGetFilterfv,      "alGetFilterfv");
466 
467     // Filters
468     lib.bindSymbol(cast(void**)&alGenAuxiliaryEffectSlots,      "alGenAuxiliaryEffectSlots");
469     lib.bindSymbol(cast(void**)&alDeleteAuxiliaryEffectSlots,   "alDeleteAuxiliaryEffectSlots");
470     lib.bindSymbol(cast(void**)&alIsAuxiliaryEffectSlot,        "alIsAuxiliaryEffectSlot");
471     lib.bindSymbol(cast(void**)&alAuxiliaryEffectSloti,         "alAuxiliaryEffectSloti");
472     lib.bindSymbol(cast(void**)&alAuxiliaryEffectSlotiv,        "alAuxiliaryEffectSlotiv");
473     lib.bindSymbol(cast(void**)&alAuxiliaryEffectSlotf,         "alAuxiliaryEffectSlotf");
474     lib.bindSymbol(cast(void**)&alAuxiliaryEffectSlotfv,        "alAuxiliaryEffectSlotfv");
475     lib.bindSymbol(cast(void**)&alGetAuxiliaryEffectSloti,      "alGetAuxiliaryEffectSloti");
476     lib.bindSymbol(cast(void**)&alGetAuxiliaryEffectSlotiv,     "alGetAuxiliaryEffectSlotiv");
477     lib.bindSymbol(cast(void**)&alGetAuxiliaryEffectSlotf,      "alGetAuxiliaryEffectSlotf");
478     lib.bindSymbol(cast(void**)&alGetAuxiliaryEffectSlotfv,     "alGetAuxiliaryEffectSlotfv");
479 
480 
481     return errCount == errorCount();
482 }