diff options
author | Chris Robinson <[email protected]> | 2018-09-19 22:18:46 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-09-19 22:18:46 -0700 |
commit | 5c6b8eda4f4defc85faf76edb2772f6b340c7c1a (patch) | |
tree | f5110aed671ade8156448b4e84613f8aa4b0185d /Alc/effects | |
parent | ea95a8adef036602770546fb14bcaf713ec40b8b (diff) |
Remove another duplicate function
Diffstat (limited to 'Alc/effects')
-rw-r--r-- | Alc/effects/autowah.c | 4 | ||||
-rw-r--r-- | Alc/effects/chorus.c | 4 | ||||
-rw-r--r-- | Alc/effects/compressor.c | 3 | ||||
-rw-r--r-- | Alc/effects/dedicated.c | 2 | ||||
-rw-r--r-- | Alc/effects/distortion.c | 3 | ||||
-rw-r--r-- | Alc/effects/echo.c | 4 | ||||
-rw-r--r-- | Alc/effects/equalizer.c | 18 | ||||
-rw-r--r-- | Alc/effects/fshifter.c | 2 | ||||
-rw-r--r-- | Alc/effects/modulator.c | 4 | ||||
-rw-r--r-- | Alc/effects/pshifter.c | 2 | ||||
-rw-r--r-- | Alc/effects/reverb.c | 8 |
11 files changed, 26 insertions, 28 deletions
diff --git a/Alc/effects/autowah.c b/Alc/effects/autowah.c index 28b366b1..ba1180ef 100644 --- a/Alc/effects/autowah.c +++ b/Alc/effects/autowah.c @@ -130,8 +130,8 @@ static ALvoid ALautowahState_update(ALautowahState *state, const ALCcontext *con STATIC_CAST(ALeffectState,state)->OutBuffer = device->FOAOut.Buffer; STATIC_CAST(ALeffectState,state)->OutChannels = device->FOAOut.NumChannels; for(i = 0;i < MAX_EFFECT_CHANNELS;i++) - ComputeFirstOrderGains(&device->FOAOut, IdentityMatrixf.m[i], - slot->Params.Gain, state->Chans[i].TargetGains); + ComputePanGains(&device->FOAOut, IdentityMatrixf.m[i], slot->Params.Gain, + state->Chans[i].TargetGains); } static ALvoid ALautowahState_process(ALautowahState *state, ALsizei SamplesToDo, const ALfloat (*restrict SamplesIn)[BUFFERSIZE], ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALsizei NumChannels) diff --git a/Alc/effects/chorus.c b/Alc/effects/chorus.c index ffb2b572..f2861cf5 100644 --- a/Alc/effects/chorus.c +++ b/Alc/effects/chorus.c @@ -149,9 +149,9 @@ static ALvoid ALchorusState_update(ALchorusState *state, const ALCcontext *Conte /* Gains for left and right sides */ CalcAngleCoeffs(-F_PI_2, 0.0f, 0.0f, coeffs); - ComputeDryPanGains(&device->Dry, coeffs, Slot->Params.Gain, state->Gains[0].Target); + ComputePanGains(&device->Dry, coeffs, Slot->Params.Gain, state->Gains[0].Target); CalcAngleCoeffs( F_PI_2, 0.0f, 0.0f, coeffs); - ComputeDryPanGains(&device->Dry, coeffs, Slot->Params.Gain, state->Gains[1].Target); + ComputePanGains(&device->Dry, coeffs, Slot->Params.Gain, state->Gains[1].Target); phase = props->Chorus.Phase; rate = props->Chorus.Rate; diff --git a/Alc/effects/compressor.c b/Alc/effects/compressor.c index af60777a..2b4a76b0 100644 --- a/Alc/effects/compressor.c +++ b/Alc/effects/compressor.c @@ -99,8 +99,7 @@ static ALvoid ALcompressorState_update(ALcompressorState *state, const ALCcontex STATIC_CAST(ALeffectState,state)->OutBuffer = device->FOAOut.Buffer; STATIC_CAST(ALeffectState,state)->OutChannels = device->FOAOut.NumChannels; for(i = 0;i < 4;i++) - ComputeFirstOrderGains(&device->FOAOut, IdentityMatrixf.m[i], - slot->Params.Gain, state->Gain[i]); + ComputePanGains(&device->FOAOut, IdentityMatrixf.m[i], slot->Params.Gain, state->Gain[i]); } static ALvoid ALcompressorState_process(ALcompressorState *state, ALsizei SamplesToDo, const ALfloat (*restrict SamplesIn)[BUFFERSIZE], ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALsizei NumChannels) diff --git a/Alc/effects/dedicated.c b/Alc/effects/dedicated.c index 62a3894f..0e1fd389 100644 --- a/Alc/effects/dedicated.c +++ b/Alc/effects/dedicated.c @@ -102,7 +102,7 @@ static ALvoid ALdedicatedState_update(ALdedicatedState *state, const ALCcontext STATIC_CAST(ALeffectState,state)->OutBuffer = device->Dry.Buffer; STATIC_CAST(ALeffectState,state)->OutChannels = device->Dry.NumChannels; - ComputeDryPanGains(&device->Dry, coeffs, Gain, state->TargetGains); + ComputePanGains(&device->Dry, coeffs, Gain, state->TargetGains); } } } diff --git a/Alc/effects/distortion.c b/Alc/effects/distortion.c index f4e9969c..de8da4fe 100644 --- a/Alc/effects/distortion.c +++ b/Alc/effects/distortion.c @@ -104,8 +104,7 @@ static ALvoid ALdistortionState_update(ALdistortionState *state, const ALCcontex ); CalcAngleCoeffs(0.0f, 0.0f, 0.0f, coeffs); - ComputeDryPanGains(&device->Dry, coeffs, slot->Params.Gain * props->Distortion.Gain, - state->Gain); + ComputePanGains(&device->Dry, coeffs, slot->Params.Gain*props->Distortion.Gain, state->Gain); } static ALvoid ALdistortionState_process(ALdistortionState *state, ALsizei SamplesToDo, const ALfloat (*restrict SamplesIn)[BUFFERSIZE], ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALsizei NumChannels) diff --git a/Alc/effects/echo.c b/Alc/effects/echo.c index 676b17e8..4570fcb1 100644 --- a/Alc/effects/echo.c +++ b/Alc/effects/echo.c @@ -141,11 +141,11 @@ static ALvoid ALechoState_update(ALechoState *state, const ALCcontext *context, /* First tap panning */ CalcAngleCoeffs(-F_PI_2*lrpan, 0.0f, spread, coeffs); - ComputeDryPanGains(&device->Dry, coeffs, slot->Params.Gain, state->Gains[0].Target); + ComputePanGains(&device->Dry, coeffs, slot->Params.Gain, state->Gains[0].Target); /* Second tap panning */ CalcAngleCoeffs( F_PI_2*lrpan, 0.0f, spread, coeffs); - ComputeDryPanGains(&device->Dry, coeffs, slot->Params.Gain, state->Gains[1].Target); + ComputePanGains(&device->Dry, coeffs, slot->Params.Gain, state->Gains[1].Target); } static ALvoid ALechoState_process(ALechoState *state, ALsizei SamplesToDo, const ALfloat (*restrict SamplesIn)[BUFFERSIZE], ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALsizei NumChannels) diff --git a/Alc/effects/equalizer.c b/Alc/effects/equalizer.c index 8ff56fb5..17106127 100644 --- a/Alc/effects/equalizer.c +++ b/Alc/effects/equalizer.c @@ -76,12 +76,12 @@ typedef struct ALequalizerState { DERIVE_FROM_TYPE(ALeffectState); struct { + /* Effect parameters */ + BiquadFilter filter[4]; + /* Effect gains for each channel */ ALfloat CurrentGains[MAX_OUTPUT_CHANNELS]; ALfloat TargetGains[MAX_OUTPUT_CHANNELS]; - - /* Effect parameters */ - BiquadFilter filter[4]; } Chans[MAX_EFFECT_CHANNELS]; ALfloat SampleBuffer[MAX_EFFECT_CHANNELS][BUFFERSIZE]; @@ -128,12 +128,6 @@ static ALvoid ALequalizerState_update(ALequalizerState *state, const ALCcontext ALfloat gain, f0norm; ALuint i; - STATIC_CAST(ALeffectState,state)->OutBuffer = device->FOAOut.Buffer; - STATIC_CAST(ALeffectState,state)->OutChannels = device->FOAOut.NumChannels; - for(i = 0;i < MAX_EFFECT_CHANNELS;i++) - ComputeFirstOrderGains(&device->FOAOut, IdentityMatrixf.m[i], - slot->Params.Gain, state->Chans[i].TargetGains); - /* Calculate coefficients for the each type of filter. Note that the shelf * filters' gain is for the reference frequency, which is the centerpoint * of the transition band. @@ -174,6 +168,12 @@ static ALvoid ALequalizerState_update(ALequalizerState *state, const ALCcontext BiquadFilter_copyParams(&state->Chans[i].filter[2], &state->Chans[0].filter[2]); BiquadFilter_copyParams(&state->Chans[i].filter[3], &state->Chans[0].filter[3]); } + + STATIC_CAST(ALeffectState,state)->OutBuffer = device->FOAOut.Buffer; + STATIC_CAST(ALeffectState,state)->OutChannels = device->FOAOut.NumChannels; + for(i = 0;i < MAX_EFFECT_CHANNELS;i++) + ComputePanGains(&device->FOAOut, IdentityMatrixf.m[i], slot->Params.Gain, + state->Chans[i].TargetGains); } static ALvoid ALequalizerState_process(ALequalizerState *state, ALsizei SamplesToDo, const ALfloat (*restrict SamplesIn)[BUFFERSIZE], ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALsizei NumChannels) diff --git a/Alc/effects/fshifter.c b/Alc/effects/fshifter.c index 5aa08453..7d72472a 100644 --- a/Alc/effects/fshifter.c +++ b/Alc/effects/fshifter.c @@ -144,7 +144,7 @@ static ALvoid ALfshifterState_update(ALfshifterState *state, const ALCcontext *c } CalcAngleCoeffs(0.0f, 0.0f, 0.0f, coeffs); - ComputeDryPanGains(&device->Dry, coeffs, slot->Params.Gain, state->TargetGains); + ComputePanGains(&device->Dry, coeffs, slot->Params.Gain, state->TargetGains); } static ALvoid ALfshifterState_process(ALfshifterState *state, ALsizei SamplesToDo, const ALfloat (*restrict SamplesIn)[BUFFERSIZE], ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALsizei NumChannels) diff --git a/Alc/effects/modulator.c b/Alc/effects/modulator.c index 9855b1b8..e368adb8 100644 --- a/Alc/effects/modulator.c +++ b/Alc/effects/modulator.c @@ -158,8 +158,8 @@ static ALvoid ALmodulatorState_update(ALmodulatorState *state, const ALCcontext STATIC_CAST(ALeffectState,state)->OutBuffer = device->FOAOut.Buffer; STATIC_CAST(ALeffectState,state)->OutChannels = device->FOAOut.NumChannels; for(i = 0;i < MAX_EFFECT_CHANNELS;i++) - ComputeFirstOrderGains(&device->FOAOut, IdentityMatrixf.m[i], - slot->Params.Gain, state->Chans[i].TargetGains); + ComputePanGains(&device->FOAOut, IdentityMatrixf.m[i], slot->Params.Gain, + state->Chans[i].TargetGains); } static ALvoid ALmodulatorState_process(ALmodulatorState *state, ALsizei SamplesToDo, const ALfloat (*restrict SamplesIn)[BUFFERSIZE], ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALsizei NumChannels) diff --git a/Alc/effects/pshifter.c b/Alc/effects/pshifter.c index f27c413c..ed18e9a8 100644 --- a/Alc/effects/pshifter.c +++ b/Alc/effects/pshifter.c @@ -208,7 +208,7 @@ static ALvoid ALpshifterState_update(ALpshifterState *state, const ALCcontext *c state->PitchShift = state->PitchShiftI * (1.0f/FRACTIONONE); CalcAngleCoeffs(0.0f, 0.0f, 0.0f, coeffs); - ComputeDryPanGains(&device->Dry, coeffs, slot->Params.Gain, state->TargetGains); + ComputePanGains(&device->Dry, coeffs, slot->Params.Gain, state->TargetGains); } static ALvoid ALpshifterState_process(ALpshifterState *state, ALsizei SamplesToDo, const ALfloat (*restrict SamplesIn)[BUFFERSIZE], ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALsizei NumChannels) diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index 6fdd53cd..a5de52f9 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -868,15 +868,15 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection MATRIX_MULT(transform, rot, A2B); memset(&State->Early.PanGain, 0, sizeof(State->Early.PanGain)); for(i = 0;i < MAX_EFFECT_CHANNELS;i++) - ComputeFirstOrderGains(&Device->FOAOut, transform.m[i], earlyGain, - State->Early.PanGain[i]); + ComputePanGains(&Device->FOAOut, transform.m[i], earlyGain, + State->Early.PanGain[i]); rot = GetTransformFromVector(LateReverbPan); MATRIX_MULT(transform, rot, A2B); memset(&State->Late.PanGain, 0, sizeof(State->Late.PanGain)); for(i = 0;i < MAX_EFFECT_CHANNELS;i++) - ComputeFirstOrderGains(&Device->FOAOut, transform.m[i], lateGain, - State->Late.PanGain[i]); + ComputePanGains(&Device->FOAOut, transform.m[i], lateGain, + State->Late.PanGain[i]); #undef MATRIX_MULT } |