diff options
author | Chris Robinson <[email protected]> | 2011-03-12 20:11:25 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-03-12 20:11:25 -0800 |
commit | 73123bc313fd0f700abc8569138081abca997b78 (patch) | |
tree | b438e53a2ed62f8b6391793aaf36297da0ad8b27 /OpenAL32/alEffect.c | |
parent | 947aa1342c82fe22b2030b04e43532af0a07d978 (diff) |
Add support for ALC_EXT_DEDICATED
Diffstat (limited to 'OpenAL32/alEffect.c')
-rw-r--r-- | OpenAL32/alEffect.c | 67 |
1 files changed, 66 insertions, 1 deletions
diff --git a/OpenAL32/alEffect.c b/OpenAL32/alEffect.c index 0814cfe0..69a5b32d 100644 --- a/OpenAL32/alEffect.c +++ b/OpenAL32/alEffect.c @@ -171,7 +171,9 @@ AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue) (iValue == AL_EFFECT_EAXREVERB && !DisabledEffects[EAXREVERB]) || (iValue == AL_EFFECT_REVERB && !DisabledEffects[REVERB]) || (iValue == AL_EFFECT_ECHO && !DisabledEffects[ECHO]) || - (iValue == AL_EFFECT_RING_MODULATOR && !DisabledEffects[MODULATOR])); + (iValue == AL_EFFECT_RING_MODULATOR && !DisabledEffects[MODULATOR]) || + ((iValue == AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT || + iValue == AL_EFFECT_DEDICATED_DIALOGUE) && !DisabledEffects[DEDICATED])); if(isOk) InitEffectParams(ALEffect, iValue); @@ -681,6 +683,23 @@ AL_API ALvoid AL_APIENTRY alEffectf(ALuint effect, ALenum param, ALfloat flValue break; } } + else if(ALEffect->type == AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT || + ALEffect->type == AL_EFFECT_DEDICATED_DIALOGUE) + { + switch(param) + { + case AL_DEDICATED_GAIN: + if(flValue >= 0.0f) + ALEffect->Dedicated.Gain = flValue; + else + alSetError(Context, AL_INVALID_VALUE); + break; + + default: + alSetError(Context, AL_INVALID_ENUM); + break; + } + } else alSetError(Context, AL_INVALID_ENUM); } @@ -810,6 +829,20 @@ AL_API ALvoid AL_APIENTRY alEffectfv(ALuint effect, ALenum param, ALfloat *pflVa break; } } + else if(ALEffect->type == AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT || + ALEffect->type == AL_EFFECT_DEDICATED_DIALOGUE) + { + switch(param) + { + case AL_DEDICATED_GAIN: + alEffectf(effect, param, pflValues[0]); + break; + + default: + alSetError(Context, AL_INVALID_ENUM); + break; + } + } else alSetError(Context, AL_INVALID_ENUM); } @@ -1176,6 +1209,20 @@ AL_API ALvoid AL_APIENTRY alGetEffectf(ALuint effect, ALenum param, ALfloat *pfl break; } } + else if(ALEffect->type == AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT || + ALEffect->type == AL_EFFECT_DEDICATED_DIALOGUE) + { + switch(param) + { + case AL_DEDICATED_GAIN: + *pflValue = ALEffect->Dedicated.Gain; + break; + + default: + alSetError(Context, AL_INVALID_ENUM); + break; + } + } else alSetError(Context, AL_INVALID_ENUM); } @@ -1295,6 +1342,20 @@ AL_API ALvoid AL_APIENTRY alGetEffectfv(ALuint effect, ALenum param, ALfloat *pf break; } } + else if(ALEffect->type == AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT || + ALEffect->type == AL_EFFECT_DEDICATED_DIALOGUE) + { + switch(param) + { + case AL_DEDICATED_GAIN: + alGetEffectf(effect, param, pflValues); + break; + + default: + alSetError(Context, AL_INVALID_ENUM); + break; + } + } else alSetError(Context, AL_INVALID_ENUM); } @@ -1372,5 +1433,9 @@ static void InitEffectParams(ALeffect *effect, ALenum type) effect->Modulator.HighPassCutoff = AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF; effect->Modulator.Waveform = AL_RING_MODULATOR_DEFAULT_WAVEFORM; break; + case AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT: + case AL_EFFECT_DEDICATED_DIALOGUE: + effect->Dedicated.Gain = 1.0f; + break; } } |