Mix Dedicated effects to the real output if possible

This commit is contained in:
Chris Robinson
2016-03-25 14:47:30 -07:00
parent 3148986184
commit 05dace6525
+21 -6
View File
@@ -57,22 +57,37 @@ static ALvoid ALdedicatedState_update(ALdedicatedState *state, const ALCdevice *
if(Slot->EffectType == AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT)
{
int idx;
if((idx=GetChannelIdxByName(device->Dry, LFE)) != -1)
if((idx=GetChannelIdxByName(device->RealOut, LFE)) != -1)
{
state->gains[idx] = Gain;
STATIC_CAST(ALeffectState,state)->OutBuffer = device->RealOut.Buffer;
STATIC_CAST(ALeffectState,state)->OutChannels = device->RealOut.NumChannels;
}
}
else if(Slot->EffectType == AL_EFFECT_DEDICATED_DIALOGUE)
{
int idx;
/* Dialog goes to the front-center speaker if it exists, otherwise it
* plays from the front-center location. */
if((idx=GetChannelIdxByName(device->Dry, FrontCenter)) != -1)
if((idx=GetChannelIdxByName(device->RealOut, FrontCenter)) != -1)
{
state->gains[idx] = Gain;
STATIC_CAST(ALeffectState,state)->OutBuffer = device->RealOut.Buffer;
STATIC_CAST(ALeffectState,state)->OutChannels = device->RealOut.NumChannels;
}
else
{
ALfloat coeffs[MAX_AMBI_COEFFS];
CalcXYZCoeffs(0.0f, 0.0f, -1.0f, coeffs);
ComputePanningGains(device->Dry.AmbiCoeffs, device->Dry.NumChannels,
coeffs, Gain, state->gains);
if((idx=GetChannelIdxByName(device->Dry, FrontCenter)) != -1)
state->gains[idx] = Gain;
else
{
ALfloat coeffs[MAX_AMBI_COEFFS];
CalcXYZCoeffs(0.0f, 0.0f, -1.0f, coeffs);
ComputePanningGains(device->Dry.AmbiCoeffs, device->Dry.NumChannels,
coeffs, Gain, state->gains);
}
STATIC_CAST(ALeffectState,state)->OutBuffer = device->Dry.Buffer;
STATIC_CAST(ALeffectState,state)->OutChannels = device->Dry.NumChannels;
}
}
}