annotate OpenAL32/alExtension.c @ 17:fdf84bc57e67

forgetting send.c
author Robert McIntyre <rlm@mit.edu>
date Thu, 03 Nov 2011 12:12:05 -0700
parents f9476ff7637e
children
rev   line source
rlm@0 1 /**
rlm@0 2 * OpenAL cross platform audio library
rlm@0 3 * Copyright (C) 1999-2007 by authors.
rlm@0 4 * This library is free software; you can redistribute it and/or
rlm@0 5 * modify it under the terms of the GNU Library General Public
rlm@0 6 * License as published by the Free Software Foundation; either
rlm@0 7 * version 2 of the License, or (at your option) any later version.
rlm@0 8 *
rlm@0 9 * This library is distributed in the hope that it will be useful,
rlm@0 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
rlm@0 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
rlm@0 12 * Library General Public License for more details.
rlm@0 13 *
rlm@0 14 * You should have received a copy of the GNU Library General Public
rlm@0 15 * License along with this library; if not, write to the
rlm@0 16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
rlm@0 17 * Boston, MA 02111-1307, USA.
rlm@0 18 * Or go to http://www.gnu.org/copyleft/lgpl.html
rlm@0 19 */
rlm@0 20
rlm@0 21 #include "config.h"
rlm@0 22
rlm@0 23 #include <stdlib.h>
rlm@0 24 #include <string.h>
rlm@0 25 #include <ctype.h>
rlm@0 26
rlm@0 27 #include "alError.h"
rlm@0 28 #include "alMain.h"
rlm@0 29 #include "alFilter.h"
rlm@0 30 #include "alEffect.h"
rlm@0 31 #include "alAuxEffectSlot.h"
rlm@0 32 #include "alSource.h"
rlm@0 33 #include "alBuffer.h"
rlm@0 34 #include "AL/al.h"
rlm@0 35 #include "AL/alc.h"
rlm@0 36
rlm@0 37 typedef struct ALenums {
rlm@0 38 const ALchar *enumName;
rlm@0 39 ALenum value;
rlm@0 40 } ALenums;
rlm@0 41
rlm@0 42
rlm@0 43 static const ALenums enumeration[] = {
rlm@0 44 // Types
rlm@0 45 { "AL_INVALID", AL_INVALID },
rlm@0 46 { "AL_NONE", AL_NONE },
rlm@0 47 { "AL_FALSE", AL_FALSE },
rlm@0 48 { "AL_TRUE", AL_TRUE },
rlm@0 49
rlm@0 50 // Source and Listener Properties
rlm@0 51 { "AL_SOURCE_RELATIVE", AL_SOURCE_RELATIVE },
rlm@0 52 { "AL_CONE_INNER_ANGLE", AL_CONE_INNER_ANGLE },
rlm@0 53 { "AL_CONE_OUTER_ANGLE", AL_CONE_OUTER_ANGLE },
rlm@0 54 { "AL_PITCH", AL_PITCH },
rlm@0 55 { "AL_POSITION", AL_POSITION },
rlm@0 56 { "AL_DIRECTION", AL_DIRECTION },
rlm@0 57 { "AL_VELOCITY", AL_VELOCITY },
rlm@0 58 { "AL_LOOPING", AL_LOOPING },
rlm@0 59 { "AL_BUFFER", AL_BUFFER },
rlm@0 60 { "AL_GAIN", AL_GAIN },
rlm@0 61 { "AL_MIN_GAIN", AL_MIN_GAIN },
rlm@0 62 { "AL_MAX_GAIN", AL_MAX_GAIN },
rlm@0 63 { "AL_ORIENTATION", AL_ORIENTATION },
rlm@0 64 { "AL_REFERENCE_DISTANCE", AL_REFERENCE_DISTANCE },
rlm@0 65 { "AL_ROLLOFF_FACTOR", AL_ROLLOFF_FACTOR },
rlm@0 66 { "AL_CONE_OUTER_GAIN", AL_CONE_OUTER_GAIN },
rlm@0 67 { "AL_MAX_DISTANCE", AL_MAX_DISTANCE },
rlm@0 68 { "AL_SEC_OFFSET", AL_SEC_OFFSET },
rlm@0 69 { "AL_SAMPLE_OFFSET", AL_SAMPLE_OFFSET },
rlm@0 70 { "AL_SAMPLE_RW_OFFSETS_SOFT", AL_SAMPLE_RW_OFFSETS_SOFT },
rlm@0 71 { "AL_BYTE_OFFSET", AL_BYTE_OFFSET },
rlm@0 72 { "AL_BYTE_RW_OFFSETS_SOFT", AL_BYTE_RW_OFFSETS_SOFT },
rlm@0 73 { "AL_SOURCE_TYPE", AL_SOURCE_TYPE },
rlm@0 74 { "AL_STATIC", AL_STATIC },
rlm@0 75 { "AL_STREAMING", AL_STREAMING },
rlm@0 76 { "AL_UNDETERMINED", AL_UNDETERMINED },
rlm@0 77 { "AL_METERS_PER_UNIT", AL_METERS_PER_UNIT },
rlm@0 78 { "AL_VIRTUAL_CHANNELS_SOFT", AL_VIRTUAL_CHANNELS_SOFT },
rlm@0 79
rlm@0 80 // Source EFX Properties
rlm@0 81 { "AL_DIRECT_FILTER", AL_DIRECT_FILTER },
rlm@0 82 { "AL_AUXILIARY_SEND_FILTER", AL_AUXILIARY_SEND_FILTER },
rlm@0 83 { "AL_AIR_ABSORPTION_FACTOR", AL_AIR_ABSORPTION_FACTOR },
rlm@0 84 { "AL_ROOM_ROLLOFF_FACTOR", AL_ROOM_ROLLOFF_FACTOR },
rlm@0 85 { "AL_CONE_OUTER_GAINHF", AL_CONE_OUTER_GAINHF },
rlm@0 86 { "AL_DIRECT_FILTER_GAINHF_AUTO", AL_DIRECT_FILTER_GAINHF_AUTO },
rlm@0 87 { "AL_AUXILIARY_SEND_FILTER_GAIN_AUTO", AL_AUXILIARY_SEND_FILTER_GAIN_AUTO },
rlm@0 88 { "AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO", AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO},
rlm@0 89
rlm@0 90 // Source State information
rlm@0 91 { "AL_SOURCE_STATE", AL_SOURCE_STATE },
rlm@0 92 { "AL_INITIAL", AL_INITIAL },
rlm@0 93 { "AL_PLAYING", AL_PLAYING },
rlm@0 94 { "AL_PAUSED", AL_PAUSED },
rlm@0 95 { "AL_STOPPED", AL_STOPPED },
rlm@0 96
rlm@0 97 // Queue information
rlm@0 98 { "AL_BUFFERS_QUEUED", AL_BUFFERS_QUEUED },
rlm@0 99 { "AL_BUFFERS_PROCESSED", AL_BUFFERS_PROCESSED },
rlm@0 100
rlm@0 101 // Buffer Formats
rlm@0 102 { "AL_FORMAT_MONO8", AL_FORMAT_MONO8 },
rlm@0 103 { "AL_FORMAT_MONO16", AL_FORMAT_MONO16 },
rlm@0 104 { "AL_FORMAT_MONO_FLOAT32", AL_FORMAT_MONO_FLOAT32 },
rlm@0 105 { "AL_FORMAT_MONO_DOUBLE_EXT", AL_FORMAT_MONO_DOUBLE_EXT },
rlm@0 106 { "AL_FORMAT_STEREO8", AL_FORMAT_STEREO8 },
rlm@0 107 { "AL_FORMAT_STEREO16", AL_FORMAT_STEREO16 },
rlm@0 108 { "AL_FORMAT_STEREO_FLOAT32", AL_FORMAT_STEREO_FLOAT32 },
rlm@0 109 { "AL_FORMAT_STEREO_DOUBLE_EXT", AL_FORMAT_STEREO_DOUBLE_EXT },
rlm@0 110 { "AL_FORMAT_MONO_IMA4", AL_FORMAT_MONO_IMA4 },
rlm@0 111 { "AL_FORMAT_STEREO_IMA4", AL_FORMAT_STEREO_IMA4 },
rlm@0 112 { "AL_FORMAT_QUAD8_LOKI", AL_FORMAT_QUAD8_LOKI },
rlm@0 113 { "AL_FORMAT_QUAD16_LOKI", AL_FORMAT_QUAD16_LOKI },
rlm@0 114 { "AL_FORMAT_QUAD8", AL_FORMAT_QUAD8 },
rlm@0 115 { "AL_FORMAT_QUAD16", AL_FORMAT_QUAD16 },
rlm@0 116 { "AL_FORMAT_QUAD32", AL_FORMAT_QUAD32 },
rlm@0 117 { "AL_FORMAT_51CHN8", AL_FORMAT_51CHN8 },
rlm@0 118 { "AL_FORMAT_51CHN16", AL_FORMAT_51CHN16 },
rlm@0 119 { "AL_FORMAT_51CHN32", AL_FORMAT_51CHN32 },
rlm@0 120 { "AL_FORMAT_61CHN8", AL_FORMAT_61CHN8 },
rlm@0 121 { "AL_FORMAT_61CHN16", AL_FORMAT_61CHN16 },
rlm@0 122 { "AL_FORMAT_61CHN32", AL_FORMAT_61CHN32 },
rlm@0 123 { "AL_FORMAT_71CHN8", AL_FORMAT_71CHN8 },
rlm@0 124 { "AL_FORMAT_71CHN16", AL_FORMAT_71CHN16 },
rlm@0 125 { "AL_FORMAT_71CHN32", AL_FORMAT_71CHN32 },
rlm@0 126 { "AL_FORMAT_REAR8", AL_FORMAT_REAR8 },
rlm@0 127 { "AL_FORMAT_REAR16", AL_FORMAT_REAR16 },
rlm@0 128 { "AL_FORMAT_REAR32", AL_FORMAT_REAR32 },
rlm@0 129 { "AL_FORMAT_MONO_MULAW", AL_FORMAT_MONO_MULAW },
rlm@0 130 { "AL_FORMAT_MONO_MULAW_EXT", AL_FORMAT_MONO_MULAW },
rlm@0 131 { "AL_FORMAT_STEREO_MULAW", AL_FORMAT_STEREO_MULAW },
rlm@0 132 { "AL_FORMAT_STEREO_MULAW_EXT", AL_FORMAT_STEREO_MULAW },
rlm@0 133 { "AL_FORMAT_QUAD_MULAW", AL_FORMAT_QUAD_MULAW },
rlm@0 134 { "AL_FORMAT_51CHN_MULAW", AL_FORMAT_51CHN_MULAW },
rlm@0 135 { "AL_FORMAT_61CHN_MULAW", AL_FORMAT_61CHN_MULAW },
rlm@0 136 { "AL_FORMAT_71CHN_MULAW", AL_FORMAT_71CHN_MULAW },
rlm@0 137 { "AL_FORMAT_REAR_MULAW", AL_FORMAT_REAR_MULAW },
rlm@0 138
rlm@0 139 // Internal Buffer Formats
rlm@0 140 { "AL_MONO8", AL_MONO8 },
rlm@0 141 { "AL_MONO16", AL_MONO16 },
rlm@0 142 { "AL_MONO32F", AL_MONO32F },
rlm@0 143 { "AL_STEREO8", AL_STEREO8 },
rlm@0 144 { "AL_STEREO16", AL_STEREO16 },
rlm@0 145 { "AL_STEREO32F", AL_STEREO32F },
rlm@0 146 { "AL_QUAD8", AL_QUAD8 },
rlm@0 147 { "AL_QUAD16", AL_QUAD16 },
rlm@0 148 { "AL_QUAD32F", AL_QUAD32F },
rlm@0 149 { "AL_REAR8", AL_REAR8 },
rlm@0 150 { "AL_REAR16", AL_REAR16 },
rlm@0 151 { "AL_REAR32F", AL_REAR32F },
rlm@0 152 { "AL_5POINT1_8", AL_5POINT1_8 },
rlm@0 153 { "AL_5POINT1_16", AL_5POINT1_16 },
rlm@0 154 { "AL_5POINT1_32F", AL_5POINT1_32F },
rlm@0 155 { "AL_6POINT1_8", AL_6POINT1_8 },
rlm@0 156 { "AL_6POINT1_16", AL_6POINT1_16 },
rlm@0 157 { "AL_6POINT1_32F", AL_6POINT1_32F },
rlm@0 158 { "AL_7POINT1_8", AL_7POINT1_8 },
rlm@0 159 { "AL_7POINT1_16", AL_7POINT1_16 },
rlm@0 160 { "AL_7POINT1_32F", AL_7POINT1_32F },
rlm@0 161
rlm@0 162 // Buffer Channel Configurations
rlm@0 163 { "AL_MONO", AL_MONO },
rlm@0 164 { "AL_STEREO", AL_STEREO },
rlm@0 165 { "AL_QUAD", AL_QUAD },
rlm@0 166 { "AL_REAR", AL_REAR },
rlm@0 167 { "AL_5POINT1", AL_5POINT1 },
rlm@0 168 { "AL_6POINT1", AL_6POINT1 },
rlm@0 169 { "AL_7POINT1", AL_7POINT1 },
rlm@0 170
rlm@0 171 // Buffer Sample Types
rlm@0 172 { "AL_BYTE", AL_BYTE },
rlm@0 173 { "AL_UNSIGNED_BYTE", AL_UNSIGNED_BYTE },
rlm@0 174 { "AL_SHORT", AL_SHORT },
rlm@0 175 { "AL_UNSIGNED_SHORT", AL_UNSIGNED_SHORT },
rlm@0 176 { "AL_INT", AL_INT },
rlm@0 177 { "AL_UNSIGNED_INT", AL_UNSIGNED_INT },
rlm@0 178 { "AL_FLOAT", AL_FLOAT },
rlm@0 179 { "AL_DOUBLE", AL_DOUBLE },
rlm@0 180 { "AL_MULAW", AL_MULAW },
rlm@0 181 { "AL_IMA4", AL_IMA4 },
rlm@0 182 { "AL_BYTE3", AL_BYTE3 },
rlm@0 183 { "AL_UNSIGNED_BYTE3", AL_UNSIGNED_BYTE3 },
rlm@0 184
rlm@0 185 // Buffer attributes
rlm@0 186 { "AL_FREQUENCY", AL_FREQUENCY },
rlm@0 187 { "AL_BITS", AL_BITS },
rlm@0 188 { "AL_CHANNELS", AL_CHANNELS },
rlm@0 189 { "AL_SIZE", AL_SIZE },
rlm@0 190
rlm@0 191 // Buffer States (not supported yet)
rlm@0 192 { "AL_UNUSED", AL_UNUSED },
rlm@0 193 { "AL_PENDING", AL_PENDING },
rlm@0 194 { "AL_PROCESSED", AL_PROCESSED },
rlm@0 195
rlm@0 196 // AL Error Messages
rlm@0 197 { "AL_NO_ERROR", AL_NO_ERROR },
rlm@0 198 { "AL_INVALID_NAME", AL_INVALID_NAME },
rlm@0 199 { "AL_INVALID_ENUM", AL_INVALID_ENUM },
rlm@0 200 { "AL_INVALID_VALUE", AL_INVALID_VALUE },
rlm@0 201 { "AL_INVALID_OPERATION", AL_INVALID_OPERATION },
rlm@0 202 { "AL_OUT_OF_MEMORY", AL_OUT_OF_MEMORY },
rlm@0 203
rlm@0 204 // Context strings
rlm@0 205 { "AL_VENDOR", AL_VENDOR },
rlm@0 206 { "AL_VERSION", AL_VERSION },
rlm@0 207 { "AL_RENDERER", AL_RENDERER },
rlm@0 208 { "AL_EXTENSIONS", AL_EXTENSIONS },
rlm@0 209
rlm@0 210 // Global states
rlm@0 211 { "AL_DOPPLER_FACTOR", AL_DOPPLER_FACTOR },
rlm@0 212 { "AL_DOPPLER_VELOCITY", AL_DOPPLER_VELOCITY },
rlm@0 213 { "AL_DISTANCE_MODEL", AL_DISTANCE_MODEL },
rlm@0 214 { "AL_SPEED_OF_SOUND", AL_SPEED_OF_SOUND },
rlm@0 215 { "AL_SOURCE_DISTANCE_MODEL", AL_SOURCE_DISTANCE_MODEL },
rlm@0 216 { "AL_DEFERRED_UPDATES_SOFT", AL_DEFERRED_UPDATES_SOFT },
rlm@0 217
rlm@0 218 // Distance Models
rlm@0 219 { "AL_INVERSE_DISTANCE", AL_INVERSE_DISTANCE },
rlm@0 220 { "AL_INVERSE_DISTANCE_CLAMPED", AL_INVERSE_DISTANCE_CLAMPED },
rlm@0 221 { "AL_LINEAR_DISTANCE", AL_LINEAR_DISTANCE },
rlm@0 222 { "AL_LINEAR_DISTANCE_CLAMPED", AL_LINEAR_DISTANCE_CLAMPED },
rlm@0 223 { "AL_EXPONENT_DISTANCE", AL_EXPONENT_DISTANCE },
rlm@0 224 { "AL_EXPONENT_DISTANCE_CLAMPED", AL_EXPONENT_DISTANCE_CLAMPED },
rlm@0 225
rlm@0 226 // Filter types
rlm@0 227 { "AL_FILTER_TYPE", AL_FILTER_TYPE },
rlm@0 228 { "AL_FILTER_NULL", AL_FILTER_NULL },
rlm@0 229 { "AL_FILTER_LOWPASS", AL_FILTER_LOWPASS },
rlm@0 230 #if 0
rlm@0 231 { "AL_FILTER_HIGHPASS", AL_FILTER_HIGHPASS },
rlm@0 232 { "AL_FILTER_BANDPASS", AL_FILTER_BANDPASS },
rlm@0 233 #endif
rlm@0 234
rlm@0 235 // Filter params
rlm@0 236 { "AL_LOWPASS_GAIN", AL_LOWPASS_GAIN },
rlm@0 237 { "AL_LOWPASS_GAINHF", AL_LOWPASS_GAINHF },
rlm@0 238
rlm@0 239 // Effect types
rlm@0 240 { "AL_EFFECT_TYPE", AL_EFFECT_TYPE },
rlm@0 241 { "AL_EFFECT_NULL", AL_EFFECT_NULL },
rlm@0 242 { "AL_EFFECT_REVERB", AL_EFFECT_REVERB },
rlm@0 243 { "AL_EFFECT_EAXREVERB", AL_EFFECT_EAXREVERB },
rlm@0 244 #if 0
rlm@0 245 { "AL_EFFECT_CHORUS", AL_EFFECT_CHORUS },
rlm@0 246 { "AL_EFFECT_DISTORTION", AL_EFFECT_DISTORTION },
rlm@0 247 #endif
rlm@0 248 { "AL_EFFECT_ECHO", AL_EFFECT_ECHO },
rlm@0 249 #if 0
rlm@0 250 { "AL_EFFECT_FLANGER", AL_EFFECT_FLANGER },
rlm@0 251 { "AL_EFFECT_FREQUENCY_SHIFTER", AL_EFFECT_FREQUENCY_SHIFTER },
rlm@0 252 { "AL_EFFECT_VOCAL_MORPHER", AL_EFFECT_VOCAL_MORPHER },
rlm@0 253 { "AL_EFFECT_PITCH_SHIFTER", AL_EFFECT_PITCH_SHIFTER },
rlm@0 254 #endif
rlm@0 255 { "AL_EFFECT_RING_MODULATOR", AL_EFFECT_RING_MODULATOR },
rlm@0 256 #if 0
rlm@0 257 { "AL_EFFECT_AUTOWAH", AL_EFFECT_AUTOWAH },
rlm@0 258 { "AL_EFFECT_COMPRESSOR", AL_EFFECT_COMPRESSOR },
rlm@0 259 { "AL_EFFECT_EQUALIZER", AL_EFFECT_EQUALIZER },
rlm@0 260 #endif
rlm@0 261 { "AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT",AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT},
rlm@0 262 { "AL_EFFECT_DEDICATED_DIALOGUE", AL_EFFECT_DEDICATED_DIALOGUE },
rlm@0 263
rlm@0 264 // Reverb params
rlm@0 265 { "AL_REVERB_DENSITY", AL_REVERB_DENSITY },
rlm@0 266 { "AL_REVERB_DIFFUSION", AL_REVERB_DIFFUSION },
rlm@0 267 { "AL_REVERB_GAIN", AL_REVERB_GAIN },
rlm@0 268 { "AL_REVERB_GAINHF", AL_REVERB_GAINHF },
rlm@0 269 { "AL_REVERB_DECAY_TIME", AL_REVERB_DECAY_TIME },
rlm@0 270 { "AL_REVERB_DECAY_HFRATIO", AL_REVERB_DECAY_HFRATIO },
rlm@0 271 { "AL_REVERB_REFLECTIONS_GAIN", AL_REVERB_REFLECTIONS_GAIN },
rlm@0 272 { "AL_REVERB_REFLECTIONS_DELAY", AL_REVERB_REFLECTIONS_DELAY },
rlm@0 273 { "AL_REVERB_LATE_REVERB_GAIN", AL_REVERB_LATE_REVERB_GAIN },
rlm@0 274 { "AL_REVERB_LATE_REVERB_DELAY", AL_REVERB_LATE_REVERB_DELAY },
rlm@0 275 { "AL_REVERB_AIR_ABSORPTION_GAINHF", AL_REVERB_AIR_ABSORPTION_GAINHF },
rlm@0 276 { "AL_REVERB_ROOM_ROLLOFF_FACTOR", AL_REVERB_ROOM_ROLLOFF_FACTOR },
rlm@0 277 { "AL_REVERB_DECAY_HFLIMIT", AL_REVERB_DECAY_HFLIMIT },
rlm@0 278
rlm@0 279 // EAX Reverb params
rlm@0 280 { "AL_EAXREVERB_DENSITY", AL_EAXREVERB_DENSITY },
rlm@0 281 { "AL_EAXREVERB_DIFFUSION", AL_EAXREVERB_DIFFUSION },
rlm@0 282 { "AL_EAXREVERB_GAIN", AL_EAXREVERB_GAIN },
rlm@0 283 { "AL_EAXREVERB_GAINHF", AL_EAXREVERB_GAINHF },
rlm@0 284 { "AL_EAXREVERB_GAINLF", AL_EAXREVERB_GAINLF },
rlm@0 285 { "AL_EAXREVERB_DECAY_TIME", AL_EAXREVERB_DECAY_TIME },
rlm@0 286 { "AL_EAXREVERB_DECAY_HFRATIO", AL_EAXREVERB_DECAY_HFRATIO },
rlm@0 287 { "AL_EAXREVERB_DECAY_LFRATIO", AL_EAXREVERB_DECAY_LFRATIO },
rlm@0 288 { "AL_EAXREVERB_REFLECTIONS_GAIN", AL_EAXREVERB_REFLECTIONS_GAIN },
rlm@0 289 { "AL_EAXREVERB_REFLECTIONS_DELAY", AL_EAXREVERB_REFLECTIONS_DELAY },
rlm@0 290 { "AL_EAXREVERB_REFLECTIONS_PAN", AL_EAXREVERB_REFLECTIONS_PAN },
rlm@0 291 { "AL_EAXREVERB_LATE_REVERB_GAIN", AL_EAXREVERB_LATE_REVERB_GAIN },
rlm@0 292 { "AL_EAXREVERB_LATE_REVERB_DELAY", AL_EAXREVERB_LATE_REVERB_DELAY },
rlm@0 293 { "AL_EAXREVERB_LATE_REVERB_PAN", AL_EAXREVERB_LATE_REVERB_PAN },
rlm@0 294 { "AL_EAXREVERB_ECHO_TIME", AL_EAXREVERB_ECHO_TIME },
rlm@0 295 { "AL_EAXREVERB_ECHO_DEPTH", AL_EAXREVERB_ECHO_DEPTH },
rlm@0 296 { "AL_EAXREVERB_MODULATION_TIME", AL_EAXREVERB_MODULATION_TIME },
rlm@0 297 { "AL_EAXREVERB_MODULATION_DEPTH", AL_EAXREVERB_MODULATION_DEPTH },
rlm@0 298 { "AL_EAXREVERB_AIR_ABSORPTION_GAINHF", AL_EAXREVERB_AIR_ABSORPTION_GAINHF },
rlm@0 299 { "AL_EAXREVERB_HFREFERENCE", AL_EAXREVERB_HFREFERENCE },
rlm@0 300 { "AL_EAXREVERB_LFREFERENCE", AL_EAXREVERB_LFREFERENCE },
rlm@0 301 { "AL_EAXREVERB_ROOM_ROLLOFF_FACTOR", AL_EAXREVERB_ROOM_ROLLOFF_FACTOR },
rlm@0 302 { "AL_EAXREVERB_DECAY_HFLIMIT", AL_EAXREVERB_DECAY_HFLIMIT },
rlm@0 303
rlm@0 304 // Echo params
rlm@0 305 { "AL_ECHO_DELAY", AL_ECHO_DELAY },
rlm@0 306 { "AL_ECHO_LRDELAY", AL_ECHO_LRDELAY },
rlm@0 307 { "AL_ECHO_DAMPING", AL_ECHO_DAMPING },
rlm@0 308 { "AL_ECHO_FEEDBACK", AL_ECHO_FEEDBACK },
rlm@0 309 { "AL_ECHO_SPREAD", AL_ECHO_SPREAD },
rlm@0 310
rlm@0 311 // Ring Modulator params
rlm@0 312 { "AL_RING_MODULATOR_FREQUENCY", AL_RING_MODULATOR_FREQUENCY },
rlm@0 313 { "AL_RING_MODULATOR_HIGHPASS_CUTOFF", AL_RING_MODULATOR_HIGHPASS_CUTOFF },
rlm@0 314 { "AL_RING_MODULATOR_WAVEFORM", AL_RING_MODULATOR_WAVEFORM },
rlm@0 315
rlm@0 316 // Dedicated Dialogue/LFE params
rlm@0 317 { "AL_DEDICATED_GAIN", AL_DEDICATED_GAIN },
rlm@0 318
rlm@0 319
rlm@0 320 // Default
rlm@0 321 { NULL, (ALenum)0 }
rlm@0 322 };
rlm@0 323
rlm@0 324
rlm@0 325 const struct EffectList EffectList[] = {
rlm@0 326 { "eaxreverb", EAXREVERB, "AL_EFFECT_EAXREVERB", AL_EFFECT_EAXREVERB },
rlm@0 327 { "reverb", REVERB, "AL_EFFECT_REVERB", AL_EFFECT_REVERB },
rlm@0 328 { "echo", ECHO, "AL_EFFECT_ECHO", AL_EFFECT_ECHO },
rlm@0 329 { "modulator", MODULATOR, "AL_EFFECT_RING_MODULATOR", AL_EFFECT_RING_MODULATOR },
rlm@0 330 { "dedicated", DEDICATED, "AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT", AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT },
rlm@0 331 { "dedicated", DEDICATED, "AL_EFFECT_DEDICATED_DIALOGUE", AL_EFFECT_DEDICATED_DIALOGUE },
rlm@0 332 { NULL, 0, NULL, (ALenum)0 }
rlm@0 333 };
rlm@0 334
rlm@0 335
rlm@0 336 AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extName)
rlm@0 337 {
rlm@0 338 ALboolean bIsSupported = AL_FALSE;
rlm@0 339 ALCcontext *Context;
rlm@0 340 const char *ptr;
rlm@0 341 size_t len;
rlm@0 342
rlm@0 343 Context = GetLockedContext();
rlm@0 344 if(!Context) return AL_FALSE;
rlm@0 345
rlm@0 346 if(!extName)
rlm@0 347 alSetError(Context, AL_INVALID_VALUE);
rlm@0 348 else
rlm@0 349 {
rlm@0 350 len = strlen(extName);
rlm@0 351 ptr = Context->ExtensionList;
rlm@0 352 while(ptr && *ptr)
rlm@0 353 {
rlm@0 354 if(strncasecmp(ptr, extName, len) == 0 &&
rlm@0 355 (ptr[len] == '\0' || isspace(ptr[len])))
rlm@0 356 {
rlm@0 357 bIsSupported = AL_TRUE;
rlm@0 358 break;
rlm@0 359 }
rlm@0 360 if((ptr=strchr(ptr, ' ')) != NULL)
rlm@0 361 {
rlm@0 362 do {
rlm@0 363 ++ptr;
rlm@0 364 } while(isspace(*ptr));
rlm@0 365 }
rlm@0 366 }
rlm@0 367 }
rlm@0 368
rlm@0 369 UnlockContext(Context);
rlm@0 370
rlm@0 371 return bIsSupported;
rlm@0 372 }
rlm@0 373
rlm@0 374
rlm@0 375 AL_API ALvoid* AL_APIENTRY alGetProcAddress(const ALchar *funcName)
rlm@0 376 {
rlm@0 377 if(!funcName)
rlm@0 378 return NULL;
rlm@0 379 return alcGetProcAddress(NULL, funcName);
rlm@0 380 }
rlm@0 381
rlm@0 382 AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *enumName)
rlm@0 383 {
rlm@0 384 ALsizei i;
rlm@0 385
rlm@0 386 for(i = 0;EffectList[i].ename;i++)
rlm@0 387 {
rlm@0 388 if(DisabledEffects[EffectList[i].type] &&
rlm@0 389 strcmp(EffectList[i].ename, enumName) == 0)
rlm@0 390 return (ALenum)0;
rlm@0 391 }
rlm@0 392
rlm@0 393 i = 0;
rlm@0 394 while(enumeration[i].enumName &&
rlm@0 395 strcmp(enumeration[i].enumName, enumName) != 0)
rlm@0 396 i++;
rlm@0 397
rlm@0 398 return enumeration[i].value;
rlm@0 399 }