diff options
author | Chris Robinson <[email protected]> | 2007-12-18 15:47:24 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2007-12-18 15:47:24 -0800 |
commit | 9adc20e4e727bb2a9829cf9c9a970358d094b951 (patch) | |
tree | 993de47a9a08ec5c777c72a77c1d47c1f975747f /OpenAL32 | |
parent | bdf16bf601ed1cedc652af62029d4cbd91e90c09 (diff) |
Implement AL_EFFECTSLOT_GAIN property
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alAuxEffectSlot.h | 2 | ||||
-rw-r--r-- | OpenAL32/alAuxEffectSlot.c | 29 |
2 files changed, 25 insertions, 6 deletions
diff --git a/OpenAL32/Include/alAuxEffectSlot.h b/OpenAL32/Include/alAuxEffectSlot.h index 26e9822d..72640610 100644 --- a/OpenAL32/Include/alAuxEffectSlot.h +++ b/OpenAL32/Include/alAuxEffectSlot.h @@ -21,6 +21,8 @@ typedef struct ALeffectslot_struct ALeffect effect; + ALfloat Gain; + // Index to itself ALuint effectslot; diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c index 8e76984f..564314bd 100644 --- a/OpenAL32/alAuxEffectSlot.c +++ b/OpenAL32/alAuxEffectSlot.c @@ -229,8 +229,17 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotf(ALuint effectslot, ALenum param if (alIsAuxiliaryEffectSlot(effectslot)) { + ALeffectslot *ALEffectSlot = (ALeffectslot*)ALTHUNK_LOOKUPENTRY(effectslot); + switch(param) { + case AL_EFFECTSLOT_GAIN: + if(flValue >= 0.0f && flValue <= 1.0f) + ALEffectSlot->Gain = flValue; + else + alSetError(AL_INVALID_VALUE); + break; + default: alSetError(AL_INVALID_ENUM); break; @@ -246,8 +255,6 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum para { ALCcontext *Context; - (void)pflValues; - Context = alcGetCurrentContext(); SuspendContext(Context); @@ -255,6 +262,10 @@ AL_API ALvoid AL_APIENTRY alAuxiliaryEffectSlotfv(ALuint effectslot, ALenum para { switch(param) { + case AL_EFFECTSLOT_GAIN: + alAuxiliaryEffectSlotf(effectslot, param, pflValues[0]); + break; + default: alSetError(AL_INVALID_ENUM); break; @@ -324,15 +335,19 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum pa { ALCcontext *Context; - (void)pflValue; - Context = alcGetCurrentContext(); SuspendContext(Context); if (alIsAuxiliaryEffectSlot(effectslot)) { + ALeffectslot *ALEffectSlot = (ALeffectslot*)ALTHUNK_LOOKUPENTRY(effectslot); + switch(param) { + case AL_EFFECTSLOT_GAIN: + *pflValue = ALEffectSlot->Gain; + break; + default: alSetError(AL_INVALID_ENUM); break; @@ -348,8 +363,6 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum p { ALCcontext *Context; - (void)pflValues; - Context = alcGetCurrentContext(); SuspendContext(Context); @@ -357,6 +370,10 @@ AL_API ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum p { switch(param) { + case AL_EFFECTSLOT_GAIN: + alGetAuxiliaryEffectSlotf(effectslot, param, pflValues); + break; + default: alSetError(AL_INVALID_ENUM); break; |