Mercurial > audio-send
diff OpenAL32/alExtension.c @ 0:f9476ff7637e
initial forking of open-al to create multiple listeners
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 25 Oct 2011 13:02:31 -0700 |
parents | |
children |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/OpenAL32/alExtension.c Tue Oct 25 13:02:31 2011 -0700 1.3 @@ -0,0 +1,399 @@ 1.4 +/** 1.5 + * OpenAL cross platform audio library 1.6 + * Copyright (C) 1999-2007 by authors. 1.7 + * This library is free software; you can redistribute it and/or 1.8 + * modify it under the terms of the GNU Library General Public 1.9 + * License as published by the Free Software Foundation; either 1.10 + * version 2 of the License, or (at your option) any later version. 1.11 + * 1.12 + * This library is distributed in the hope that it will be useful, 1.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 1.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1.15 + * Library General Public License for more details. 1.16 + * 1.17 + * You should have received a copy of the GNU Library General Public 1.18 + * License along with this library; if not, write to the 1.19 + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 1.20 + * Boston, MA 02111-1307, USA. 1.21 + * Or go to http://www.gnu.org/copyleft/lgpl.html 1.22 + */ 1.23 + 1.24 +#include "config.h" 1.25 + 1.26 +#include <stdlib.h> 1.27 +#include <string.h> 1.28 +#include <ctype.h> 1.29 + 1.30 +#include "alError.h" 1.31 +#include "alMain.h" 1.32 +#include "alFilter.h" 1.33 +#include "alEffect.h" 1.34 +#include "alAuxEffectSlot.h" 1.35 +#include "alSource.h" 1.36 +#include "alBuffer.h" 1.37 +#include "AL/al.h" 1.38 +#include "AL/alc.h" 1.39 + 1.40 +typedef struct ALenums { 1.41 + const ALchar *enumName; 1.42 + ALenum value; 1.43 +} ALenums; 1.44 + 1.45 + 1.46 +static const ALenums enumeration[] = { 1.47 + // Types 1.48 + { "AL_INVALID", AL_INVALID }, 1.49 + { "AL_NONE", AL_NONE }, 1.50 + { "AL_FALSE", AL_FALSE }, 1.51 + { "AL_TRUE", AL_TRUE }, 1.52 + 1.53 + // Source and Listener Properties 1.54 + { "AL_SOURCE_RELATIVE", AL_SOURCE_RELATIVE }, 1.55 + { "AL_CONE_INNER_ANGLE", AL_CONE_INNER_ANGLE }, 1.56 + { "AL_CONE_OUTER_ANGLE", AL_CONE_OUTER_ANGLE }, 1.57 + { "AL_PITCH", AL_PITCH }, 1.58 + { "AL_POSITION", AL_POSITION }, 1.59 + { "AL_DIRECTION", AL_DIRECTION }, 1.60 + { "AL_VELOCITY", AL_VELOCITY }, 1.61 + { "AL_LOOPING", AL_LOOPING }, 1.62 + { "AL_BUFFER", AL_BUFFER }, 1.63 + { "AL_GAIN", AL_GAIN }, 1.64 + { "AL_MIN_GAIN", AL_MIN_GAIN }, 1.65 + { "AL_MAX_GAIN", AL_MAX_GAIN }, 1.66 + { "AL_ORIENTATION", AL_ORIENTATION }, 1.67 + { "AL_REFERENCE_DISTANCE", AL_REFERENCE_DISTANCE }, 1.68 + { "AL_ROLLOFF_FACTOR", AL_ROLLOFF_FACTOR }, 1.69 + { "AL_CONE_OUTER_GAIN", AL_CONE_OUTER_GAIN }, 1.70 + { "AL_MAX_DISTANCE", AL_MAX_DISTANCE }, 1.71 + { "AL_SEC_OFFSET", AL_SEC_OFFSET }, 1.72 + { "AL_SAMPLE_OFFSET", AL_SAMPLE_OFFSET }, 1.73 + { "AL_SAMPLE_RW_OFFSETS_SOFT", AL_SAMPLE_RW_OFFSETS_SOFT }, 1.74 + { "AL_BYTE_OFFSET", AL_BYTE_OFFSET }, 1.75 + { "AL_BYTE_RW_OFFSETS_SOFT", AL_BYTE_RW_OFFSETS_SOFT }, 1.76 + { "AL_SOURCE_TYPE", AL_SOURCE_TYPE }, 1.77 + { "AL_STATIC", AL_STATIC }, 1.78 + { "AL_STREAMING", AL_STREAMING }, 1.79 + { "AL_UNDETERMINED", AL_UNDETERMINED }, 1.80 + { "AL_METERS_PER_UNIT", AL_METERS_PER_UNIT }, 1.81 + { "AL_VIRTUAL_CHANNELS_SOFT", AL_VIRTUAL_CHANNELS_SOFT }, 1.82 + 1.83 + // Source EFX Properties 1.84 + { "AL_DIRECT_FILTER", AL_DIRECT_FILTER }, 1.85 + { "AL_AUXILIARY_SEND_FILTER", AL_AUXILIARY_SEND_FILTER }, 1.86 + { "AL_AIR_ABSORPTION_FACTOR", AL_AIR_ABSORPTION_FACTOR }, 1.87 + { "AL_ROOM_ROLLOFF_FACTOR", AL_ROOM_ROLLOFF_FACTOR }, 1.88 + { "AL_CONE_OUTER_GAINHF", AL_CONE_OUTER_GAINHF }, 1.89 + { "AL_DIRECT_FILTER_GAINHF_AUTO", AL_DIRECT_FILTER_GAINHF_AUTO }, 1.90 + { "AL_AUXILIARY_SEND_FILTER_GAIN_AUTO", AL_AUXILIARY_SEND_FILTER_GAIN_AUTO }, 1.91 + { "AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO", AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO}, 1.92 + 1.93 + // Source State information 1.94 + { "AL_SOURCE_STATE", AL_SOURCE_STATE }, 1.95 + { "AL_INITIAL", AL_INITIAL }, 1.96 + { "AL_PLAYING", AL_PLAYING }, 1.97 + { "AL_PAUSED", AL_PAUSED }, 1.98 + { "AL_STOPPED", AL_STOPPED }, 1.99 + 1.100 + // Queue information 1.101 + { "AL_BUFFERS_QUEUED", AL_BUFFERS_QUEUED }, 1.102 + { "AL_BUFFERS_PROCESSED", AL_BUFFERS_PROCESSED }, 1.103 + 1.104 + // Buffer Formats 1.105 + { "AL_FORMAT_MONO8", AL_FORMAT_MONO8 }, 1.106 + { "AL_FORMAT_MONO16", AL_FORMAT_MONO16 }, 1.107 + { "AL_FORMAT_MONO_FLOAT32", AL_FORMAT_MONO_FLOAT32 }, 1.108 + { "AL_FORMAT_MONO_DOUBLE_EXT", AL_FORMAT_MONO_DOUBLE_EXT }, 1.109 + { "AL_FORMAT_STEREO8", AL_FORMAT_STEREO8 }, 1.110 + { "AL_FORMAT_STEREO16", AL_FORMAT_STEREO16 }, 1.111 + { "AL_FORMAT_STEREO_FLOAT32", AL_FORMAT_STEREO_FLOAT32 }, 1.112 + { "AL_FORMAT_STEREO_DOUBLE_EXT", AL_FORMAT_STEREO_DOUBLE_EXT }, 1.113 + { "AL_FORMAT_MONO_IMA4", AL_FORMAT_MONO_IMA4 }, 1.114 + { "AL_FORMAT_STEREO_IMA4", AL_FORMAT_STEREO_IMA4 }, 1.115 + { "AL_FORMAT_QUAD8_LOKI", AL_FORMAT_QUAD8_LOKI }, 1.116 + { "AL_FORMAT_QUAD16_LOKI", AL_FORMAT_QUAD16_LOKI }, 1.117 + { "AL_FORMAT_QUAD8", AL_FORMAT_QUAD8 }, 1.118 + { "AL_FORMAT_QUAD16", AL_FORMAT_QUAD16 }, 1.119 + { "AL_FORMAT_QUAD32", AL_FORMAT_QUAD32 }, 1.120 + { "AL_FORMAT_51CHN8", AL_FORMAT_51CHN8 }, 1.121 + { "AL_FORMAT_51CHN16", AL_FORMAT_51CHN16 }, 1.122 + { "AL_FORMAT_51CHN32", AL_FORMAT_51CHN32 }, 1.123 + { "AL_FORMAT_61CHN8", AL_FORMAT_61CHN8 }, 1.124 + { "AL_FORMAT_61CHN16", AL_FORMAT_61CHN16 }, 1.125 + { "AL_FORMAT_61CHN32", AL_FORMAT_61CHN32 }, 1.126 + { "AL_FORMAT_71CHN8", AL_FORMAT_71CHN8 }, 1.127 + { "AL_FORMAT_71CHN16", AL_FORMAT_71CHN16 }, 1.128 + { "AL_FORMAT_71CHN32", AL_FORMAT_71CHN32 }, 1.129 + { "AL_FORMAT_REAR8", AL_FORMAT_REAR8 }, 1.130 + { "AL_FORMAT_REAR16", AL_FORMAT_REAR16 }, 1.131 + { "AL_FORMAT_REAR32", AL_FORMAT_REAR32 }, 1.132 + { "AL_FORMAT_MONO_MULAW", AL_FORMAT_MONO_MULAW }, 1.133 + { "AL_FORMAT_MONO_MULAW_EXT", AL_FORMAT_MONO_MULAW }, 1.134 + { "AL_FORMAT_STEREO_MULAW", AL_FORMAT_STEREO_MULAW }, 1.135 + { "AL_FORMAT_STEREO_MULAW_EXT", AL_FORMAT_STEREO_MULAW }, 1.136 + { "AL_FORMAT_QUAD_MULAW", AL_FORMAT_QUAD_MULAW }, 1.137 + { "AL_FORMAT_51CHN_MULAW", AL_FORMAT_51CHN_MULAW }, 1.138 + { "AL_FORMAT_61CHN_MULAW", AL_FORMAT_61CHN_MULAW }, 1.139 + { "AL_FORMAT_71CHN_MULAW", AL_FORMAT_71CHN_MULAW }, 1.140 + { "AL_FORMAT_REAR_MULAW", AL_FORMAT_REAR_MULAW }, 1.141 + 1.142 + // Internal Buffer Formats 1.143 + { "AL_MONO8", AL_MONO8 }, 1.144 + { "AL_MONO16", AL_MONO16 }, 1.145 + { "AL_MONO32F", AL_MONO32F }, 1.146 + { "AL_STEREO8", AL_STEREO8 }, 1.147 + { "AL_STEREO16", AL_STEREO16 }, 1.148 + { "AL_STEREO32F", AL_STEREO32F }, 1.149 + { "AL_QUAD8", AL_QUAD8 }, 1.150 + { "AL_QUAD16", AL_QUAD16 }, 1.151 + { "AL_QUAD32F", AL_QUAD32F }, 1.152 + { "AL_REAR8", AL_REAR8 }, 1.153 + { "AL_REAR16", AL_REAR16 }, 1.154 + { "AL_REAR32F", AL_REAR32F }, 1.155 + { "AL_5POINT1_8", AL_5POINT1_8 }, 1.156 + { "AL_5POINT1_16", AL_5POINT1_16 }, 1.157 + { "AL_5POINT1_32F", AL_5POINT1_32F }, 1.158 + { "AL_6POINT1_8", AL_6POINT1_8 }, 1.159 + { "AL_6POINT1_16", AL_6POINT1_16 }, 1.160 + { "AL_6POINT1_32F", AL_6POINT1_32F }, 1.161 + { "AL_7POINT1_8", AL_7POINT1_8 }, 1.162 + { "AL_7POINT1_16", AL_7POINT1_16 }, 1.163 + { "AL_7POINT1_32F", AL_7POINT1_32F }, 1.164 + 1.165 + // Buffer Channel Configurations 1.166 + { "AL_MONO", AL_MONO }, 1.167 + { "AL_STEREO", AL_STEREO }, 1.168 + { "AL_QUAD", AL_QUAD }, 1.169 + { "AL_REAR", AL_REAR }, 1.170 + { "AL_5POINT1", AL_5POINT1 }, 1.171 + { "AL_6POINT1", AL_6POINT1 }, 1.172 + { "AL_7POINT1", AL_7POINT1 }, 1.173 + 1.174 + // Buffer Sample Types 1.175 + { "AL_BYTE", AL_BYTE }, 1.176 + { "AL_UNSIGNED_BYTE", AL_UNSIGNED_BYTE }, 1.177 + { "AL_SHORT", AL_SHORT }, 1.178 + { "AL_UNSIGNED_SHORT", AL_UNSIGNED_SHORT }, 1.179 + { "AL_INT", AL_INT }, 1.180 + { "AL_UNSIGNED_INT", AL_UNSIGNED_INT }, 1.181 + { "AL_FLOAT", AL_FLOAT }, 1.182 + { "AL_DOUBLE", AL_DOUBLE }, 1.183 + { "AL_MULAW", AL_MULAW }, 1.184 + { "AL_IMA4", AL_IMA4 }, 1.185 + { "AL_BYTE3", AL_BYTE3 }, 1.186 + { "AL_UNSIGNED_BYTE3", AL_UNSIGNED_BYTE3 }, 1.187 + 1.188 + // Buffer attributes 1.189 + { "AL_FREQUENCY", AL_FREQUENCY }, 1.190 + { "AL_BITS", AL_BITS }, 1.191 + { "AL_CHANNELS", AL_CHANNELS }, 1.192 + { "AL_SIZE", AL_SIZE }, 1.193 + 1.194 + // Buffer States (not supported yet) 1.195 + { "AL_UNUSED", AL_UNUSED }, 1.196 + { "AL_PENDING", AL_PENDING }, 1.197 + { "AL_PROCESSED", AL_PROCESSED }, 1.198 + 1.199 + // AL Error Messages 1.200 + { "AL_NO_ERROR", AL_NO_ERROR }, 1.201 + { "AL_INVALID_NAME", AL_INVALID_NAME }, 1.202 + { "AL_INVALID_ENUM", AL_INVALID_ENUM }, 1.203 + { "AL_INVALID_VALUE", AL_INVALID_VALUE }, 1.204 + { "AL_INVALID_OPERATION", AL_INVALID_OPERATION }, 1.205 + { "AL_OUT_OF_MEMORY", AL_OUT_OF_MEMORY }, 1.206 + 1.207 + // Context strings 1.208 + { "AL_VENDOR", AL_VENDOR }, 1.209 + { "AL_VERSION", AL_VERSION }, 1.210 + { "AL_RENDERER", AL_RENDERER }, 1.211 + { "AL_EXTENSIONS", AL_EXTENSIONS }, 1.212 + 1.213 + // Global states 1.214 + { "AL_DOPPLER_FACTOR", AL_DOPPLER_FACTOR }, 1.215 + { "AL_DOPPLER_VELOCITY", AL_DOPPLER_VELOCITY }, 1.216 + { "AL_DISTANCE_MODEL", AL_DISTANCE_MODEL }, 1.217 + { "AL_SPEED_OF_SOUND", AL_SPEED_OF_SOUND }, 1.218 + { "AL_SOURCE_DISTANCE_MODEL", AL_SOURCE_DISTANCE_MODEL }, 1.219 + { "AL_DEFERRED_UPDATES_SOFT", AL_DEFERRED_UPDATES_SOFT }, 1.220 + 1.221 + // Distance Models 1.222 + { "AL_INVERSE_DISTANCE", AL_INVERSE_DISTANCE }, 1.223 + { "AL_INVERSE_DISTANCE_CLAMPED", AL_INVERSE_DISTANCE_CLAMPED }, 1.224 + { "AL_LINEAR_DISTANCE", AL_LINEAR_DISTANCE }, 1.225 + { "AL_LINEAR_DISTANCE_CLAMPED", AL_LINEAR_DISTANCE_CLAMPED }, 1.226 + { "AL_EXPONENT_DISTANCE", AL_EXPONENT_DISTANCE }, 1.227 + { "AL_EXPONENT_DISTANCE_CLAMPED", AL_EXPONENT_DISTANCE_CLAMPED }, 1.228 + 1.229 + // Filter types 1.230 + { "AL_FILTER_TYPE", AL_FILTER_TYPE }, 1.231 + { "AL_FILTER_NULL", AL_FILTER_NULL }, 1.232 + { "AL_FILTER_LOWPASS", AL_FILTER_LOWPASS }, 1.233 +#if 0 1.234 + { "AL_FILTER_HIGHPASS", AL_FILTER_HIGHPASS }, 1.235 + { "AL_FILTER_BANDPASS", AL_FILTER_BANDPASS }, 1.236 +#endif 1.237 + 1.238 + // Filter params 1.239 + { "AL_LOWPASS_GAIN", AL_LOWPASS_GAIN }, 1.240 + { "AL_LOWPASS_GAINHF", AL_LOWPASS_GAINHF }, 1.241 + 1.242 + // Effect types 1.243 + { "AL_EFFECT_TYPE", AL_EFFECT_TYPE }, 1.244 + { "AL_EFFECT_NULL", AL_EFFECT_NULL }, 1.245 + { "AL_EFFECT_REVERB", AL_EFFECT_REVERB }, 1.246 + { "AL_EFFECT_EAXREVERB", AL_EFFECT_EAXREVERB }, 1.247 +#if 0 1.248 + { "AL_EFFECT_CHORUS", AL_EFFECT_CHORUS }, 1.249 + { "AL_EFFECT_DISTORTION", AL_EFFECT_DISTORTION }, 1.250 +#endif 1.251 + { "AL_EFFECT_ECHO", AL_EFFECT_ECHO }, 1.252 +#if 0 1.253 + { "AL_EFFECT_FLANGER", AL_EFFECT_FLANGER }, 1.254 + { "AL_EFFECT_FREQUENCY_SHIFTER", AL_EFFECT_FREQUENCY_SHIFTER }, 1.255 + { "AL_EFFECT_VOCAL_MORPHER", AL_EFFECT_VOCAL_MORPHER }, 1.256 + { "AL_EFFECT_PITCH_SHIFTER", AL_EFFECT_PITCH_SHIFTER }, 1.257 +#endif 1.258 + { "AL_EFFECT_RING_MODULATOR", AL_EFFECT_RING_MODULATOR }, 1.259 +#if 0 1.260 + { "AL_EFFECT_AUTOWAH", AL_EFFECT_AUTOWAH }, 1.261 + { "AL_EFFECT_COMPRESSOR", AL_EFFECT_COMPRESSOR }, 1.262 + { "AL_EFFECT_EQUALIZER", AL_EFFECT_EQUALIZER }, 1.263 +#endif 1.264 + { "AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT",AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT}, 1.265 + { "AL_EFFECT_DEDICATED_DIALOGUE", AL_EFFECT_DEDICATED_DIALOGUE }, 1.266 + 1.267 + // Reverb params 1.268 + { "AL_REVERB_DENSITY", AL_REVERB_DENSITY }, 1.269 + { "AL_REVERB_DIFFUSION", AL_REVERB_DIFFUSION }, 1.270 + { "AL_REVERB_GAIN", AL_REVERB_GAIN }, 1.271 + { "AL_REVERB_GAINHF", AL_REVERB_GAINHF }, 1.272 + { "AL_REVERB_DECAY_TIME", AL_REVERB_DECAY_TIME }, 1.273 + { "AL_REVERB_DECAY_HFRATIO", AL_REVERB_DECAY_HFRATIO }, 1.274 + { "AL_REVERB_REFLECTIONS_GAIN", AL_REVERB_REFLECTIONS_GAIN }, 1.275 + { "AL_REVERB_REFLECTIONS_DELAY", AL_REVERB_REFLECTIONS_DELAY }, 1.276 + { "AL_REVERB_LATE_REVERB_GAIN", AL_REVERB_LATE_REVERB_GAIN }, 1.277 + { "AL_REVERB_LATE_REVERB_DELAY", AL_REVERB_LATE_REVERB_DELAY }, 1.278 + { "AL_REVERB_AIR_ABSORPTION_GAINHF", AL_REVERB_AIR_ABSORPTION_GAINHF }, 1.279 + { "AL_REVERB_ROOM_ROLLOFF_FACTOR", AL_REVERB_ROOM_ROLLOFF_FACTOR }, 1.280 + { "AL_REVERB_DECAY_HFLIMIT", AL_REVERB_DECAY_HFLIMIT }, 1.281 + 1.282 + // EAX Reverb params 1.283 + { "AL_EAXREVERB_DENSITY", AL_EAXREVERB_DENSITY }, 1.284 + { "AL_EAXREVERB_DIFFUSION", AL_EAXREVERB_DIFFUSION }, 1.285 + { "AL_EAXREVERB_GAIN", AL_EAXREVERB_GAIN }, 1.286 + { "AL_EAXREVERB_GAINHF", AL_EAXREVERB_GAINHF }, 1.287 + { "AL_EAXREVERB_GAINLF", AL_EAXREVERB_GAINLF }, 1.288 + { "AL_EAXREVERB_DECAY_TIME", AL_EAXREVERB_DECAY_TIME }, 1.289 + { "AL_EAXREVERB_DECAY_HFRATIO", AL_EAXREVERB_DECAY_HFRATIO }, 1.290 + { "AL_EAXREVERB_DECAY_LFRATIO", AL_EAXREVERB_DECAY_LFRATIO }, 1.291 + { "AL_EAXREVERB_REFLECTIONS_GAIN", AL_EAXREVERB_REFLECTIONS_GAIN }, 1.292 + { "AL_EAXREVERB_REFLECTIONS_DELAY", AL_EAXREVERB_REFLECTIONS_DELAY }, 1.293 + { "AL_EAXREVERB_REFLECTIONS_PAN", AL_EAXREVERB_REFLECTIONS_PAN }, 1.294 + { "AL_EAXREVERB_LATE_REVERB_GAIN", AL_EAXREVERB_LATE_REVERB_GAIN }, 1.295 + { "AL_EAXREVERB_LATE_REVERB_DELAY", AL_EAXREVERB_LATE_REVERB_DELAY }, 1.296 + { "AL_EAXREVERB_LATE_REVERB_PAN", AL_EAXREVERB_LATE_REVERB_PAN }, 1.297 + { "AL_EAXREVERB_ECHO_TIME", AL_EAXREVERB_ECHO_TIME }, 1.298 + { "AL_EAXREVERB_ECHO_DEPTH", AL_EAXREVERB_ECHO_DEPTH }, 1.299 + { "AL_EAXREVERB_MODULATION_TIME", AL_EAXREVERB_MODULATION_TIME }, 1.300 + { "AL_EAXREVERB_MODULATION_DEPTH", AL_EAXREVERB_MODULATION_DEPTH }, 1.301 + { "AL_EAXREVERB_AIR_ABSORPTION_GAINHF", AL_EAXREVERB_AIR_ABSORPTION_GAINHF }, 1.302 + { "AL_EAXREVERB_HFREFERENCE", AL_EAXREVERB_HFREFERENCE }, 1.303 + { "AL_EAXREVERB_LFREFERENCE", AL_EAXREVERB_LFREFERENCE }, 1.304 + { "AL_EAXREVERB_ROOM_ROLLOFF_FACTOR", AL_EAXREVERB_ROOM_ROLLOFF_FACTOR }, 1.305 + { "AL_EAXREVERB_DECAY_HFLIMIT", AL_EAXREVERB_DECAY_HFLIMIT }, 1.306 + 1.307 + // Echo params 1.308 + { "AL_ECHO_DELAY", AL_ECHO_DELAY }, 1.309 + { "AL_ECHO_LRDELAY", AL_ECHO_LRDELAY }, 1.310 + { "AL_ECHO_DAMPING", AL_ECHO_DAMPING }, 1.311 + { "AL_ECHO_FEEDBACK", AL_ECHO_FEEDBACK }, 1.312 + { "AL_ECHO_SPREAD", AL_ECHO_SPREAD }, 1.313 + 1.314 + // Ring Modulator params 1.315 + { "AL_RING_MODULATOR_FREQUENCY", AL_RING_MODULATOR_FREQUENCY }, 1.316 + { "AL_RING_MODULATOR_HIGHPASS_CUTOFF", AL_RING_MODULATOR_HIGHPASS_CUTOFF }, 1.317 + { "AL_RING_MODULATOR_WAVEFORM", AL_RING_MODULATOR_WAVEFORM }, 1.318 + 1.319 + // Dedicated Dialogue/LFE params 1.320 + { "AL_DEDICATED_GAIN", AL_DEDICATED_GAIN }, 1.321 + 1.322 + 1.323 + // Default 1.324 + { NULL, (ALenum)0 } 1.325 +}; 1.326 + 1.327 + 1.328 +const struct EffectList EffectList[] = { 1.329 + { "eaxreverb", EAXREVERB, "AL_EFFECT_EAXREVERB", AL_EFFECT_EAXREVERB }, 1.330 + { "reverb", REVERB, "AL_EFFECT_REVERB", AL_EFFECT_REVERB }, 1.331 + { "echo", ECHO, "AL_EFFECT_ECHO", AL_EFFECT_ECHO }, 1.332 + { "modulator", MODULATOR, "AL_EFFECT_RING_MODULATOR", AL_EFFECT_RING_MODULATOR }, 1.333 + { "dedicated", DEDICATED, "AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT", AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT }, 1.334 + { "dedicated", DEDICATED, "AL_EFFECT_DEDICATED_DIALOGUE", AL_EFFECT_DEDICATED_DIALOGUE }, 1.335 + { NULL, 0, NULL, (ALenum)0 } 1.336 +}; 1.337 + 1.338 + 1.339 +AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extName) 1.340 +{ 1.341 + ALboolean bIsSupported = AL_FALSE; 1.342 + ALCcontext *Context; 1.343 + const char *ptr; 1.344 + size_t len; 1.345 + 1.346 + Context = GetLockedContext(); 1.347 + if(!Context) return AL_FALSE; 1.348 + 1.349 + if(!extName) 1.350 + alSetError(Context, AL_INVALID_VALUE); 1.351 + else 1.352 + { 1.353 + len = strlen(extName); 1.354 + ptr = Context->ExtensionList; 1.355 + while(ptr && *ptr) 1.356 + { 1.357 + if(strncasecmp(ptr, extName, len) == 0 && 1.358 + (ptr[len] == '\0' || isspace(ptr[len]))) 1.359 + { 1.360 + bIsSupported = AL_TRUE; 1.361 + break; 1.362 + } 1.363 + if((ptr=strchr(ptr, ' ')) != NULL) 1.364 + { 1.365 + do { 1.366 + ++ptr; 1.367 + } while(isspace(*ptr)); 1.368 + } 1.369 + } 1.370 + } 1.371 + 1.372 + UnlockContext(Context); 1.373 + 1.374 + return bIsSupported; 1.375 +} 1.376 + 1.377 + 1.378 +AL_API ALvoid* AL_APIENTRY alGetProcAddress(const ALchar *funcName) 1.379 +{ 1.380 + if(!funcName) 1.381 + return NULL; 1.382 + return alcGetProcAddress(NULL, funcName); 1.383 +} 1.384 + 1.385 +AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *enumName) 1.386 +{ 1.387 + ALsizei i; 1.388 + 1.389 + for(i = 0;EffectList[i].ename;i++) 1.390 + { 1.391 + if(DisabledEffects[EffectList[i].type] && 1.392 + strcmp(EffectList[i].ename, enumName) == 0) 1.393 + return (ALenum)0; 1.394 + } 1.395 + 1.396 + i = 0; 1.397 + while(enumeration[i].enumName && 1.398 + strcmp(enumeration[i].enumName, enumName) != 0) 1.399 + i++; 1.400 + 1.401 + return enumeration[i].value; 1.402 +}