aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/ALu.c1
-rw-r--r--OpenAL32/Include/alAuxEffectSlot.h2
-rw-r--r--OpenAL32/alAuxEffectSlot.c29
3 files changed, 26 insertions, 6 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 061f87a1..170c7210 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -394,6 +394,7 @@ static ALvoid CalcSourceParams(ALCcontext *ALContext, ALsource *ALSource,
*wetgainhf = WetGainHF;
//8. Convert pannings into channel volumes
+ WetMix *= ALSource->Send[0].Slot.Gain;
switch(OutputFormat)
{
case AL_FORMAT_MONO8:
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;