2007-11-14 02:02:18 +00:00
|
|
|
/**
|
|
|
|
* OpenAL cross platform audio library
|
|
|
|
* Copyright (C) 1999-2007 by authors.
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
* Or go to http://www.gnu.org/copyleft/lgpl.html
|
|
|
|
*/
|
|
|
|
|
2008-01-16 22:09:04 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2007-11-14 02:02:18 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <ctype.h>
|
2010-03-25 05:43:08 +00:00
|
|
|
|
2007-11-14 02:02:18 +00:00
|
|
|
#include "alError.h"
|
|
|
|
#include "alMain.h"
|
2007-12-17 23:43:35 +00:00
|
|
|
#include "alFilter.h"
|
2007-12-18 01:44:11 +00:00
|
|
|
#include "alEffect.h"
|
|
|
|
#include "alAuxEffectSlot.h"
|
2008-01-01 03:34:52 +00:00
|
|
|
#include "alSource.h"
|
2008-11-11 13:57:32 +00:00
|
|
|
#include "alBuffer.h"
|
2007-11-14 02:02:18 +00:00
|
|
|
#include "AL/al.h"
|
|
|
|
#include "AL/alc.h"
|
|
|
|
|
2010-03-25 05:43:08 +00:00
|
|
|
typedef struct ALenums {
|
|
|
|
const ALchar *enumName;
|
|
|
|
ALenum value;
|
|
|
|
} ALenums;
|
|
|
|
|
|
|
|
|
|
|
|
static const ALenums enumeration[] = {
|
2007-11-14 02:02:18 +00:00
|
|
|
// Types
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_INVALID", AL_INVALID },
|
|
|
|
{ "AL_NONE", AL_NONE },
|
|
|
|
{ "AL_FALSE", AL_FALSE },
|
|
|
|
{ "AL_TRUE", AL_TRUE },
|
2007-11-14 02:02:18 +00:00
|
|
|
|
|
|
|
// Source and Listener Properties
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_SOURCE_RELATIVE", AL_SOURCE_RELATIVE },
|
|
|
|
{ "AL_CONE_INNER_ANGLE", AL_CONE_INNER_ANGLE },
|
|
|
|
{ "AL_CONE_OUTER_ANGLE", AL_CONE_OUTER_ANGLE },
|
|
|
|
{ "AL_PITCH", AL_PITCH },
|
|
|
|
{ "AL_POSITION", AL_POSITION },
|
|
|
|
{ "AL_DIRECTION", AL_DIRECTION },
|
|
|
|
{ "AL_VELOCITY", AL_VELOCITY },
|
|
|
|
{ "AL_LOOPING", AL_LOOPING },
|
|
|
|
{ "AL_BUFFER", AL_BUFFER },
|
|
|
|
{ "AL_GAIN", AL_GAIN },
|
|
|
|
{ "AL_MIN_GAIN", AL_MIN_GAIN },
|
|
|
|
{ "AL_MAX_GAIN", AL_MAX_GAIN },
|
|
|
|
{ "AL_ORIENTATION", AL_ORIENTATION },
|
|
|
|
{ "AL_REFERENCE_DISTANCE", AL_REFERENCE_DISTANCE },
|
|
|
|
{ "AL_ROLLOFF_FACTOR", AL_ROLLOFF_FACTOR },
|
|
|
|
{ "AL_CONE_OUTER_GAIN", AL_CONE_OUTER_GAIN },
|
|
|
|
{ "AL_MAX_DISTANCE", AL_MAX_DISTANCE },
|
|
|
|
{ "AL_SEC_OFFSET", AL_SEC_OFFSET },
|
|
|
|
{ "AL_SAMPLE_OFFSET", AL_SAMPLE_OFFSET },
|
2010-09-21 16:43:35 +00:00
|
|
|
{ "AL_SAMPLE_RW_OFFSETS_SOFT", AL_SAMPLE_RW_OFFSETS_SOFT },
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_BYTE_OFFSET", AL_BYTE_OFFSET },
|
2010-09-21 16:43:35 +00:00
|
|
|
{ "AL_BYTE_RW_OFFSETS_SOFT", AL_BYTE_RW_OFFSETS_SOFT },
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_SOURCE_TYPE", AL_SOURCE_TYPE },
|
|
|
|
{ "AL_STATIC", AL_STATIC },
|
|
|
|
{ "AL_STREAMING", AL_STREAMING },
|
|
|
|
{ "AL_UNDETERMINED", AL_UNDETERMINED },
|
|
|
|
{ "AL_METERS_PER_UNIT", AL_METERS_PER_UNIT },
|
2012-02-10 07:35:17 +00:00
|
|
|
{ "AL_DIRECT_CHANNELS_SOFT", AL_DIRECT_CHANNELS_SOFT },
|
2007-11-14 02:02:18 +00:00
|
|
|
|
2007-12-18 00:02:34 +00:00
|
|
|
// Source EFX Properties
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_DIRECT_FILTER", AL_DIRECT_FILTER },
|
|
|
|
{ "AL_AUXILIARY_SEND_FILTER", AL_AUXILIARY_SEND_FILTER },
|
|
|
|
{ "AL_AIR_ABSORPTION_FACTOR", AL_AIR_ABSORPTION_FACTOR },
|
|
|
|
{ "AL_ROOM_ROLLOFF_FACTOR", AL_ROOM_ROLLOFF_FACTOR },
|
|
|
|
{ "AL_CONE_OUTER_GAINHF", AL_CONE_OUTER_GAINHF },
|
|
|
|
{ "AL_DIRECT_FILTER_GAINHF_AUTO", AL_DIRECT_FILTER_GAINHF_AUTO },
|
|
|
|
{ "AL_AUXILIARY_SEND_FILTER_GAIN_AUTO", AL_AUXILIARY_SEND_FILTER_GAIN_AUTO },
|
|
|
|
{ "AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO", AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO},
|
2007-12-18 00:02:34 +00:00
|
|
|
|
2007-11-14 02:02:18 +00:00
|
|
|
// Source State information
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_SOURCE_STATE", AL_SOURCE_STATE },
|
|
|
|
{ "AL_INITIAL", AL_INITIAL },
|
|
|
|
{ "AL_PLAYING", AL_PLAYING },
|
|
|
|
{ "AL_PAUSED", AL_PAUSED },
|
|
|
|
{ "AL_STOPPED", AL_STOPPED },
|
2007-11-14 02:02:18 +00:00
|
|
|
|
|
|
|
// Queue information
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_BUFFERS_QUEUED", AL_BUFFERS_QUEUED },
|
|
|
|
{ "AL_BUFFERS_PROCESSED", AL_BUFFERS_PROCESSED },
|
2007-11-14 02:02:18 +00:00
|
|
|
|
|
|
|
// Buffer Formats
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_FORMAT_MONO8", AL_FORMAT_MONO8 },
|
|
|
|
{ "AL_FORMAT_MONO16", AL_FORMAT_MONO16 },
|
|
|
|
{ "AL_FORMAT_MONO_FLOAT32", AL_FORMAT_MONO_FLOAT32 },
|
|
|
|
{ "AL_FORMAT_MONO_DOUBLE_EXT", AL_FORMAT_MONO_DOUBLE_EXT },
|
|
|
|
{ "AL_FORMAT_STEREO8", AL_FORMAT_STEREO8 },
|
|
|
|
{ "AL_FORMAT_STEREO16", AL_FORMAT_STEREO16 },
|
|
|
|
{ "AL_FORMAT_STEREO_FLOAT32", AL_FORMAT_STEREO_FLOAT32 },
|
|
|
|
{ "AL_FORMAT_STEREO_DOUBLE_EXT", AL_FORMAT_STEREO_DOUBLE_EXT },
|
|
|
|
{ "AL_FORMAT_MONO_IMA4", AL_FORMAT_MONO_IMA4 },
|
|
|
|
{ "AL_FORMAT_STEREO_IMA4", AL_FORMAT_STEREO_IMA4 },
|
|
|
|
{ "AL_FORMAT_QUAD8_LOKI", AL_FORMAT_QUAD8_LOKI },
|
|
|
|
{ "AL_FORMAT_QUAD16_LOKI", AL_FORMAT_QUAD16_LOKI },
|
|
|
|
{ "AL_FORMAT_QUAD8", AL_FORMAT_QUAD8 },
|
|
|
|
{ "AL_FORMAT_QUAD16", AL_FORMAT_QUAD16 },
|
|
|
|
{ "AL_FORMAT_QUAD32", AL_FORMAT_QUAD32 },
|
|
|
|
{ "AL_FORMAT_51CHN8", AL_FORMAT_51CHN8 },
|
|
|
|
{ "AL_FORMAT_51CHN16", AL_FORMAT_51CHN16 },
|
|
|
|
{ "AL_FORMAT_51CHN32", AL_FORMAT_51CHN32 },
|
|
|
|
{ "AL_FORMAT_61CHN8", AL_FORMAT_61CHN8 },
|
|
|
|
{ "AL_FORMAT_61CHN16", AL_FORMAT_61CHN16 },
|
|
|
|
{ "AL_FORMAT_61CHN32", AL_FORMAT_61CHN32 },
|
|
|
|
{ "AL_FORMAT_71CHN8", AL_FORMAT_71CHN8 },
|
|
|
|
{ "AL_FORMAT_71CHN16", AL_FORMAT_71CHN16 },
|
|
|
|
{ "AL_FORMAT_71CHN32", AL_FORMAT_71CHN32 },
|
|
|
|
{ "AL_FORMAT_REAR8", AL_FORMAT_REAR8 },
|
|
|
|
{ "AL_FORMAT_REAR16", AL_FORMAT_REAR16 },
|
|
|
|
{ "AL_FORMAT_REAR32", AL_FORMAT_REAR32 },
|
|
|
|
{ "AL_FORMAT_MONO_MULAW", AL_FORMAT_MONO_MULAW },
|
2011-10-01 11:56:45 +00:00
|
|
|
{ "AL_FORMAT_MONO_MULAW_EXT", AL_FORMAT_MONO_MULAW_EXT },
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_FORMAT_STEREO_MULAW", AL_FORMAT_STEREO_MULAW },
|
2011-10-01 11:56:45 +00:00
|
|
|
{ "AL_FORMAT_STEREO_MULAW_EXT", AL_FORMAT_STEREO_MULAW_EXT },
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_FORMAT_QUAD_MULAW", AL_FORMAT_QUAD_MULAW },
|
|
|
|
{ "AL_FORMAT_51CHN_MULAW", AL_FORMAT_51CHN_MULAW },
|
|
|
|
{ "AL_FORMAT_61CHN_MULAW", AL_FORMAT_61CHN_MULAW },
|
|
|
|
{ "AL_FORMAT_71CHN_MULAW", AL_FORMAT_71CHN_MULAW },
|
|
|
|
{ "AL_FORMAT_REAR_MULAW", AL_FORMAT_REAR_MULAW },
|
2011-10-01 11:55:03 +00:00
|
|
|
{ "AL_FORMAT_MONO_ALAW_EXT", AL_FORMAT_MONO_ALAW_EXT },
|
|
|
|
{ "AL_FORMAT_STEREO_ALAW_EXT", AL_FORMAT_STEREO_ALAW_EXT },
|
2007-11-14 02:02:18 +00:00
|
|
|
|
2011-04-10 16:48:37 +00:00
|
|
|
// Internal Buffer Formats
|
2012-01-10 08:41:05 +00:00
|
|
|
{ "AL_MONO8_SOFT", AL_MONO8_SOFT },
|
|
|
|
{ "AL_MONO16_SOFT", AL_MONO16_SOFT },
|
|
|
|
{ "AL_MONO32F_SOFT", AL_MONO32F_SOFT },
|
|
|
|
{ "AL_STEREO8_SOFT", AL_STEREO8_SOFT },
|
|
|
|
{ "AL_STEREO16_SOFT", AL_STEREO16_SOFT },
|
|
|
|
{ "AL_STEREO32F_SOFT", AL_STEREO32F_SOFT },
|
|
|
|
{ "AL_QUAD8_SOFT", AL_QUAD8_SOFT },
|
|
|
|
{ "AL_QUAD16_SOFT", AL_QUAD16_SOFT },
|
|
|
|
{ "AL_QUAD32F_SOFT", AL_QUAD32F_SOFT },
|
|
|
|
{ "AL_REAR8_SOFT", AL_REAR8_SOFT },
|
|
|
|
{ "AL_REAR16_SOFT", AL_REAR16_SOFT },
|
|
|
|
{ "AL_REAR32F_SOFT", AL_REAR32F_SOFT },
|
|
|
|
{ "AL_5POINT1_8_SOFT", AL_5POINT1_8_SOFT },
|
|
|
|
{ "AL_5POINT1_16_SOFT", AL_5POINT1_16_SOFT },
|
|
|
|
{ "AL_5POINT1_32F_SOFT", AL_5POINT1_32F_SOFT },
|
|
|
|
{ "AL_6POINT1_8_SOFT", AL_6POINT1_8_SOFT },
|
|
|
|
{ "AL_6POINT1_16_SOFT", AL_6POINT1_16_SOFT },
|
|
|
|
{ "AL_6POINT1_32F_SOFT", AL_6POINT1_32F_SOFT },
|
|
|
|
{ "AL_7POINT1_8_SOFT", AL_7POINT1_8_SOFT },
|
|
|
|
{ "AL_7POINT1_16_SOFT", AL_7POINT1_16_SOFT },
|
|
|
|
{ "AL_7POINT1_32F_SOFT", AL_7POINT1_32F_SOFT },
|
2011-04-10 16:48:37 +00:00
|
|
|
|
|
|
|
// Buffer Channel Configurations
|
2012-01-10 08:41:05 +00:00
|
|
|
{ "AL_MONO_SOFT", AL_MONO_SOFT },
|
|
|
|
{ "AL_STEREO_SOFT", AL_STEREO_SOFT },
|
|
|
|
{ "AL_QUAD_SOFT", AL_QUAD_SOFT },
|
|
|
|
{ "AL_REAR_SOFT", AL_REAR_SOFT },
|
|
|
|
{ "AL_5POINT1_SOFT", AL_5POINT1_SOFT },
|
|
|
|
{ "AL_6POINT1_SOFT", AL_6POINT1_SOFT },
|
|
|
|
{ "AL_7POINT1_SOFT", AL_7POINT1_SOFT },
|
2011-04-10 16:48:37 +00:00
|
|
|
|
|
|
|
// Buffer Sample Types
|
2012-01-10 08:41:05 +00:00
|
|
|
{ "AL_BYTE_SOFT", AL_BYTE_SOFT },
|
|
|
|
{ "AL_UNSIGNED_BYTE_SOFT", AL_UNSIGNED_BYTE_SOFT },
|
|
|
|
{ "AL_SHORT_SOFT", AL_SHORT_SOFT },
|
|
|
|
{ "AL_UNSIGNED_SHORT_SOFT", AL_UNSIGNED_SHORT_SOFT },
|
|
|
|
{ "AL_INT_SOFT", AL_INT_SOFT },
|
|
|
|
{ "AL_UNSIGNED_INT_SOFT", AL_UNSIGNED_INT_SOFT },
|
|
|
|
{ "AL_FLOAT_SOFT", AL_FLOAT_SOFT },
|
|
|
|
{ "AL_DOUBLE_SOFT", AL_DOUBLE_SOFT },
|
|
|
|
{ "AL_BYTE3_SOFT", AL_BYTE3_SOFT },
|
|
|
|
{ "AL_UNSIGNED_BYTE3_SOFT", AL_UNSIGNED_BYTE3_SOFT },
|
2011-04-10 16:48:37 +00:00
|
|
|
|
2007-11-14 02:02:18 +00:00
|
|
|
// Buffer attributes
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_FREQUENCY", AL_FREQUENCY },
|
|
|
|
{ "AL_BITS", AL_BITS },
|
|
|
|
{ "AL_CHANNELS", AL_CHANNELS },
|
|
|
|
{ "AL_SIZE", AL_SIZE },
|
2012-01-10 08:41:05 +00:00
|
|
|
{ "AL_INTERNAL_FORMAT_SOFT", AL_INTERNAL_FORMAT_SOFT },
|
|
|
|
{ "AL_BYTE_LENGTH_SOFT", AL_BYTE_LENGTH_SOFT },
|
|
|
|
{ "AL_SAMPLE_LENGTH_SOFT", AL_SAMPLE_LENGTH_SOFT },
|
|
|
|
{ "AL_SEC_LENGTH_SOFT", AL_SEC_LENGTH_SOFT },
|
2007-11-14 02:02:18 +00:00
|
|
|
|
|
|
|
// Buffer States (not supported yet)
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_UNUSED", AL_UNUSED },
|
|
|
|
{ "AL_PENDING", AL_PENDING },
|
|
|
|
{ "AL_PROCESSED", AL_PROCESSED },
|
2007-11-14 02:02:18 +00:00
|
|
|
|
|
|
|
// AL Error Messages
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_NO_ERROR", AL_NO_ERROR },
|
|
|
|
{ "AL_INVALID_NAME", AL_INVALID_NAME },
|
|
|
|
{ "AL_INVALID_ENUM", AL_INVALID_ENUM },
|
|
|
|
{ "AL_INVALID_VALUE", AL_INVALID_VALUE },
|
|
|
|
{ "AL_INVALID_OPERATION", AL_INVALID_OPERATION },
|
|
|
|
{ "AL_OUT_OF_MEMORY", AL_OUT_OF_MEMORY },
|
2007-11-14 02:02:18 +00:00
|
|
|
|
|
|
|
// Context strings
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_VENDOR", AL_VENDOR },
|
|
|
|
{ "AL_VERSION", AL_VERSION },
|
|
|
|
{ "AL_RENDERER", AL_RENDERER },
|
|
|
|
{ "AL_EXTENSIONS", AL_EXTENSIONS },
|
2007-11-14 02:02:18 +00:00
|
|
|
|
|
|
|
// Global states
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_DOPPLER_FACTOR", AL_DOPPLER_FACTOR },
|
|
|
|
{ "AL_DOPPLER_VELOCITY", AL_DOPPLER_VELOCITY },
|
|
|
|
{ "AL_DISTANCE_MODEL", AL_DISTANCE_MODEL },
|
|
|
|
{ "AL_SPEED_OF_SOUND", AL_SPEED_OF_SOUND },
|
2010-04-25 15:40:37 +00:00
|
|
|
{ "AL_SOURCE_DISTANCE_MODEL", AL_SOURCE_DISTANCE_MODEL },
|
2011-07-16 23:59:20 +00:00
|
|
|
{ "AL_DEFERRED_UPDATES_SOFT", AL_DEFERRED_UPDATES_SOFT },
|
2007-11-14 02:02:18 +00:00
|
|
|
|
|
|
|
// Distance Models
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_INVERSE_DISTANCE", AL_INVERSE_DISTANCE },
|
|
|
|
{ "AL_INVERSE_DISTANCE_CLAMPED", AL_INVERSE_DISTANCE_CLAMPED },
|
|
|
|
{ "AL_LINEAR_DISTANCE", AL_LINEAR_DISTANCE },
|
|
|
|
{ "AL_LINEAR_DISTANCE_CLAMPED", AL_LINEAR_DISTANCE_CLAMPED },
|
|
|
|
{ "AL_EXPONENT_DISTANCE", AL_EXPONENT_DISTANCE },
|
|
|
|
{ "AL_EXPONENT_DISTANCE_CLAMPED", AL_EXPONENT_DISTANCE_CLAMPED },
|
2007-11-14 02:02:18 +00:00
|
|
|
|
2007-12-17 23:43:35 +00:00
|
|
|
// Filter types
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_FILTER_TYPE", AL_FILTER_TYPE },
|
|
|
|
{ "AL_FILTER_NULL", AL_FILTER_NULL },
|
|
|
|
{ "AL_FILTER_LOWPASS", AL_FILTER_LOWPASS },
|
2010-03-21 03:30:43 +00:00
|
|
|
#if 0
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_FILTER_HIGHPASS", AL_FILTER_HIGHPASS },
|
|
|
|
{ "AL_FILTER_BANDPASS", AL_FILTER_BANDPASS },
|
2010-03-21 03:30:43 +00:00
|
|
|
#endif
|
2007-12-17 23:43:35 +00:00
|
|
|
|
2007-12-18 06:42:38 +00:00
|
|
|
// Filter params
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_LOWPASS_GAIN", AL_LOWPASS_GAIN },
|
|
|
|
{ "AL_LOWPASS_GAINHF", AL_LOWPASS_GAINHF },
|
2007-12-18 06:42:38 +00:00
|
|
|
|
2007-12-18 01:52:03 +00:00
|
|
|
// Effect types
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_EFFECT_TYPE", AL_EFFECT_TYPE },
|
|
|
|
{ "AL_EFFECT_NULL", AL_EFFECT_NULL },
|
|
|
|
{ "AL_EFFECT_REVERB", AL_EFFECT_REVERB },
|
|
|
|
{ "AL_EFFECT_EAXREVERB", AL_EFFECT_EAXREVERB },
|
2010-03-18 02:20:52 +00:00
|
|
|
#if 0
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_EFFECT_CHORUS", AL_EFFECT_CHORUS },
|
|
|
|
{ "AL_EFFECT_DISTORTION", AL_EFFECT_DISTORTION },
|
2010-03-18 02:20:52 +00:00
|
|
|
#endif
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_EFFECT_ECHO", AL_EFFECT_ECHO },
|
2010-03-18 02:20:52 +00:00
|
|
|
#if 0
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_EFFECT_FLANGER", AL_EFFECT_FLANGER },
|
|
|
|
{ "AL_EFFECT_FREQUENCY_SHIFTER", AL_EFFECT_FREQUENCY_SHIFTER },
|
|
|
|
{ "AL_EFFECT_VOCAL_MORPHER", AL_EFFECT_VOCAL_MORPHER },
|
|
|
|
{ "AL_EFFECT_PITCH_SHIFTER", AL_EFFECT_PITCH_SHIFTER },
|
2010-04-08 15:54:28 +00:00
|
|
|
#endif
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_EFFECT_RING_MODULATOR", AL_EFFECT_RING_MODULATOR },
|
2010-04-08 15:54:28 +00:00
|
|
|
#if 0
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_EFFECT_AUTOWAH", AL_EFFECT_AUTOWAH },
|
|
|
|
{ "AL_EFFECT_COMPRESSOR", AL_EFFECT_COMPRESSOR },
|
|
|
|
{ "AL_EFFECT_EQUALIZER", AL_EFFECT_EQUALIZER },
|
2010-03-18 02:20:52 +00:00
|
|
|
#endif
|
2011-03-13 04:11:25 +00:00
|
|
|
{ "AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT",AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT},
|
|
|
|
{ "AL_EFFECT_DEDICATED_DIALOGUE", AL_EFFECT_DEDICATED_DIALOGUE },
|
2007-12-18 01:52:03 +00:00
|
|
|
|
2008-01-16 04:32:20 +00:00
|
|
|
// Reverb params
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_REVERB_DENSITY", AL_REVERB_DENSITY },
|
|
|
|
{ "AL_REVERB_DIFFUSION", AL_REVERB_DIFFUSION },
|
|
|
|
{ "AL_REVERB_GAIN", AL_REVERB_GAIN },
|
|
|
|
{ "AL_REVERB_GAINHF", AL_REVERB_GAINHF },
|
|
|
|
{ "AL_REVERB_DECAY_TIME", AL_REVERB_DECAY_TIME },
|
|
|
|
{ "AL_REVERB_DECAY_HFRATIO", AL_REVERB_DECAY_HFRATIO },
|
|
|
|
{ "AL_REVERB_REFLECTIONS_GAIN", AL_REVERB_REFLECTIONS_GAIN },
|
|
|
|
{ "AL_REVERB_REFLECTIONS_DELAY", AL_REVERB_REFLECTIONS_DELAY },
|
|
|
|
{ "AL_REVERB_LATE_REVERB_GAIN", AL_REVERB_LATE_REVERB_GAIN },
|
|
|
|
{ "AL_REVERB_LATE_REVERB_DELAY", AL_REVERB_LATE_REVERB_DELAY },
|
|
|
|
{ "AL_REVERB_AIR_ABSORPTION_GAINHF", AL_REVERB_AIR_ABSORPTION_GAINHF },
|
|
|
|
{ "AL_REVERB_ROOM_ROLLOFF_FACTOR", AL_REVERB_ROOM_ROLLOFF_FACTOR },
|
|
|
|
{ "AL_REVERB_DECAY_HFLIMIT", AL_REVERB_DECAY_HFLIMIT },
|
2008-01-16 04:32:20 +00:00
|
|
|
|
2010-03-21 03:24:50 +00:00
|
|
|
// EAX Reverb params
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_EAXREVERB_DENSITY", AL_EAXREVERB_DENSITY },
|
|
|
|
{ "AL_EAXREVERB_DIFFUSION", AL_EAXREVERB_DIFFUSION },
|
|
|
|
{ "AL_EAXREVERB_GAIN", AL_EAXREVERB_GAIN },
|
|
|
|
{ "AL_EAXREVERB_GAINHF", AL_EAXREVERB_GAINHF },
|
|
|
|
{ "AL_EAXREVERB_GAINLF", AL_EAXREVERB_GAINLF },
|
|
|
|
{ "AL_EAXREVERB_DECAY_TIME", AL_EAXREVERB_DECAY_TIME },
|
|
|
|
{ "AL_EAXREVERB_DECAY_HFRATIO", AL_EAXREVERB_DECAY_HFRATIO },
|
|
|
|
{ "AL_EAXREVERB_DECAY_LFRATIO", AL_EAXREVERB_DECAY_LFRATIO },
|
|
|
|
{ "AL_EAXREVERB_REFLECTIONS_GAIN", AL_EAXREVERB_REFLECTIONS_GAIN },
|
|
|
|
{ "AL_EAXREVERB_REFLECTIONS_DELAY", AL_EAXREVERB_REFLECTIONS_DELAY },
|
|
|
|
{ "AL_EAXREVERB_REFLECTIONS_PAN", AL_EAXREVERB_REFLECTIONS_PAN },
|
|
|
|
{ "AL_EAXREVERB_LATE_REVERB_GAIN", AL_EAXREVERB_LATE_REVERB_GAIN },
|
|
|
|
{ "AL_EAXREVERB_LATE_REVERB_DELAY", AL_EAXREVERB_LATE_REVERB_DELAY },
|
|
|
|
{ "AL_EAXREVERB_LATE_REVERB_PAN", AL_EAXREVERB_LATE_REVERB_PAN },
|
|
|
|
{ "AL_EAXREVERB_ECHO_TIME", AL_EAXREVERB_ECHO_TIME },
|
|
|
|
{ "AL_EAXREVERB_ECHO_DEPTH", AL_EAXREVERB_ECHO_DEPTH },
|
|
|
|
{ "AL_EAXREVERB_MODULATION_TIME", AL_EAXREVERB_MODULATION_TIME },
|
|
|
|
{ "AL_EAXREVERB_MODULATION_DEPTH", AL_EAXREVERB_MODULATION_DEPTH },
|
|
|
|
{ "AL_EAXREVERB_AIR_ABSORPTION_GAINHF", AL_EAXREVERB_AIR_ABSORPTION_GAINHF },
|
|
|
|
{ "AL_EAXREVERB_HFREFERENCE", AL_EAXREVERB_HFREFERENCE },
|
|
|
|
{ "AL_EAXREVERB_LFREFERENCE", AL_EAXREVERB_LFREFERENCE },
|
|
|
|
{ "AL_EAXREVERB_ROOM_ROLLOFF_FACTOR", AL_EAXREVERB_ROOM_ROLLOFF_FACTOR },
|
|
|
|
{ "AL_EAXREVERB_DECAY_HFLIMIT", AL_EAXREVERB_DECAY_HFLIMIT },
|
2010-03-21 03:24:50 +00:00
|
|
|
|
|
|
|
// Echo params
|
2010-03-25 05:43:08 +00:00
|
|
|
{ "AL_ECHO_DELAY", AL_ECHO_DELAY },
|
|
|
|
{ "AL_ECHO_LRDELAY", AL_ECHO_LRDELAY },
|
|
|
|
{ "AL_ECHO_DAMPING", AL_ECHO_DAMPING },
|
|
|
|
{ "AL_ECHO_FEEDBACK", AL_ECHO_FEEDBACK },
|
|
|
|
{ "AL_ECHO_SPREAD", AL_ECHO_SPREAD },
|
2010-03-21 03:24:50 +00:00
|
|
|
|
2010-04-08 15:54:28 +00:00
|
|
|
// Ring Modulator params
|
|
|
|
{ "AL_RING_MODULATOR_FREQUENCY", AL_RING_MODULATOR_FREQUENCY },
|
|
|
|
{ "AL_RING_MODULATOR_HIGHPASS_CUTOFF", AL_RING_MODULATOR_HIGHPASS_CUTOFF },
|
|
|
|
{ "AL_RING_MODULATOR_WAVEFORM", AL_RING_MODULATOR_WAVEFORM },
|
|
|
|
|
2011-03-13 04:11:25 +00:00
|
|
|
// Dedicated Dialogue/LFE params
|
|
|
|
{ "AL_DEDICATED_GAIN", AL_DEDICATED_GAIN },
|
|
|
|
|
2008-01-16 04:32:20 +00:00
|
|
|
|
2007-11-14 02:02:18 +00:00
|
|
|
// Default
|
2010-03-25 05:43:08 +00:00
|
|
|
{ NULL, (ALenum)0 }
|
2007-12-18 01:52:03 +00:00
|
|
|
};
|
2007-11-14 02:02:18 +00:00
|
|
|
|
|
|
|
|
2011-03-13 04:37:22 +00:00
|
|
|
const struct EffectList EffectList[] = {
|
2011-03-13 04:54:49 +00:00
|
|
|
{ "eaxreverb", EAXREVERB, "AL_EFFECT_EAXREVERB", AL_EFFECT_EAXREVERB },
|
|
|
|
{ "reverb", REVERB, "AL_EFFECT_REVERB", AL_EFFECT_REVERB },
|
|
|
|
{ "echo", ECHO, "AL_EFFECT_ECHO", AL_EFFECT_ECHO },
|
|
|
|
{ "modulator", MODULATOR, "AL_EFFECT_RING_MODULATOR", AL_EFFECT_RING_MODULATOR },
|
|
|
|
{ "dedicated", DEDICATED, "AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT", AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT },
|
|
|
|
{ "dedicated", DEDICATED, "AL_EFFECT_DEDICATED_DIALOGUE", AL_EFFECT_DEDICATED_DIALOGUE },
|
|
|
|
{ NULL, 0, NULL, (ALenum)0 }
|
2011-03-13 04:37:22 +00:00
|
|
|
};
|
|
|
|
|
2007-11-14 02:02:18 +00:00
|
|
|
|
2010-03-19 21:34:18 +00:00
|
|
|
AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extName)
|
2007-11-14 02:02:18 +00:00
|
|
|
{
|
|
|
|
ALboolean bIsSupported = AL_FALSE;
|
2011-07-01 01:10:04 +00:00
|
|
|
ALCcontext *Context;
|
2008-01-15 00:26:22 +00:00
|
|
|
const char *ptr;
|
|
|
|
size_t len;
|
2007-11-14 02:02:18 +00:00
|
|
|
|
2011-09-11 11:32:34 +00:00
|
|
|
Context = GetContextRef();
|
2011-07-01 01:10:04 +00:00
|
|
|
if(!Context) return AL_FALSE;
|
2010-03-17 00:35:51 +00:00
|
|
|
|
|
|
|
if(!extName)
|
2011-07-01 01:10:04 +00:00
|
|
|
alSetError(Context, AL_INVALID_VALUE);
|
|
|
|
else
|
2007-11-14 02:02:18 +00:00
|
|
|
{
|
2011-07-01 01:10:04 +00:00
|
|
|
len = strlen(extName);
|
|
|
|
ptr = Context->ExtensionList;
|
|
|
|
while(ptr && *ptr)
|
2007-11-14 02:02:18 +00:00
|
|
|
{
|
2011-07-01 01:10:04 +00:00
|
|
|
if(strncasecmp(ptr, extName, len) == 0 &&
|
|
|
|
(ptr[len] == '\0' || isspace(ptr[len])))
|
|
|
|
{
|
|
|
|
bIsSupported = AL_TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if((ptr=strchr(ptr, ' ')) != NULL)
|
|
|
|
{
|
|
|
|
do {
|
|
|
|
++ptr;
|
|
|
|
} while(isspace(*ptr));
|
|
|
|
}
|
2007-11-14 02:02:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-09-11 11:32:34 +00:00
|
|
|
ALCcontext_DecRef(Context);
|
2007-11-14 02:02:18 +00:00
|
|
|
return bIsSupported;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-03-22 22:12:20 +00:00
|
|
|
AL_API ALvoid* AL_APIENTRY alGetProcAddress(const ALchar *funcName)
|
2007-11-14 02:02:18 +00:00
|
|
|
{
|
2010-04-28 22:07:38 +00:00
|
|
|
if(!funcName)
|
|
|
|
return NULL;
|
|
|
|
return alcGetProcAddress(NULL, funcName);
|
2007-11-14 02:02:18 +00:00
|
|
|
}
|
|
|
|
|
2010-03-19 21:34:18 +00:00
|
|
|
AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *enumName)
|
2007-11-14 02:02:18 +00:00
|
|
|
{
|
2011-03-13 04:27:46 +00:00
|
|
|
ALsizei i;
|
|
|
|
|
2011-03-13 04:37:22 +00:00
|
|
|
for(i = 0;EffectList[i].ename;i++)
|
2011-03-13 04:27:46 +00:00
|
|
|
{
|
|
|
|
if(DisabledEffects[EffectList[i].type] &&
|
2011-03-13 04:37:22 +00:00
|
|
|
strcmp(EffectList[i].ename, enumName) == 0)
|
2011-03-13 04:27:46 +00:00
|
|
|
return (ALenum)0;
|
|
|
|
}
|
2007-11-14 02:02:18 +00:00
|
|
|
|
2011-03-13 04:27:46 +00:00
|
|
|
i = 0;
|
2007-11-14 02:02:18 +00:00
|
|
|
while(enumeration[i].enumName &&
|
|
|
|
strcmp(enumeration[i].enumName, enumName) != 0)
|
|
|
|
i++;
|
|
|
|
|
|
|
|
return enumeration[i].value;
|
|
|
|
}
|