diff options
author | Chris Robinson <[email protected]> | 2023-12-22 01:36:47 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-12-22 01:36:47 -0800 |
commit | 8346f77af0068d175cc9ecbf4c8894a2d1bcd617 (patch) | |
tree | 0a5b0c63fea5820bcff6c29ad1d028c3164a3fbd | |
parent | 2be61898ff31a7ada524a1fa06be30ddb4b78a22 (diff) |
Replace a series of if statements with a switch
-rw-r--r-- | al/eax/effect.h | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/al/eax/effect.h b/al/eax/effect.h index 14506846..a24f85fa 100644 --- a/al/eax/effect.h +++ b/al/eax/effect.h @@ -239,30 +239,22 @@ public: void call_set_defaults(const ALenum altype, EaxEffectProps &props) { - if(altype == AL_EFFECT_EAXREVERB) - return call_set_defaults<EaxReverbCommitter>(props); - if(altype == AL_EFFECT_CHORUS) - return call_set_defaults<EaxChorusCommitter>(props); - if(altype == AL_EFFECT_AUTOWAH) - return call_set_defaults<EaxAutowahCommitter>(props); - if(altype == AL_EFFECT_COMPRESSOR) - return call_set_defaults<EaxCompressorCommitter>(props); - if(altype == AL_EFFECT_DISTORTION) - return call_set_defaults<EaxDistortionCommitter>(props); - if(altype == AL_EFFECT_ECHO) - return call_set_defaults<EaxEchoCommitter>(props); - if(altype == AL_EFFECT_EQUALIZER) - return call_set_defaults<EaxEqualizerCommitter>(props); - if(altype == AL_EFFECT_FLANGER) - return call_set_defaults<EaxFlangerCommitter>(props); - if(altype == AL_EFFECT_FREQUENCY_SHIFTER) - return call_set_defaults<EaxFrequencyShifterCommitter>(props); - if(altype == AL_EFFECT_RING_MODULATOR) - return call_set_defaults<EaxModulatorCommitter>(props); - if(altype == AL_EFFECT_PITCH_SHIFTER) - return call_set_defaults<EaxPitchShifterCommitter>(props); - if(altype == AL_EFFECT_VOCAL_MORPHER) - return call_set_defaults<EaxVocalMorpherCommitter>(props); + switch(altype) + { + case AL_EFFECT_EAXREVERB: return call_set_defaults<EaxReverbCommitter>(props); + case AL_EFFECT_CHORUS: return call_set_defaults<EaxChorusCommitter>(props); + case AL_EFFECT_AUTOWAH: return call_set_defaults<EaxAutowahCommitter>(props); + case AL_EFFECT_COMPRESSOR: return call_set_defaults<EaxCompressorCommitter>(props); + case AL_EFFECT_DISTORTION: return call_set_defaults<EaxDistortionCommitter>(props); + case AL_EFFECT_ECHO: return call_set_defaults<EaxEchoCommitter>(props); + case AL_EFFECT_EQUALIZER: return call_set_defaults<EaxEqualizerCommitter>(props); + case AL_EFFECT_FLANGER: return call_set_defaults<EaxFlangerCommitter>(props); + case AL_EFFECT_FREQUENCY_SHIFTER: return call_set_defaults<EaxFrequencyShifterCommitter>(props); + case AL_EFFECT_RING_MODULATOR: return call_set_defaults<EaxModulatorCommitter>(props); + case AL_EFFECT_PITCH_SHIFTER: return call_set_defaults<EaxPitchShifterCommitter>(props); + case AL_EFFECT_VOCAL_MORPHER: return call_set_defaults<EaxVocalMorpherCommitter>(props); + case AL_EFFECT_NULL: break; + } return call_set_defaults<EaxNullCommitter>(props); } |