diff options
author | Damien Zammit <damien@zamaudio.com> | 2016-04-20 17:03:24 +1000 |
---|---|---|
committer | Damien Zammit <damien@zamaudio.com> | 2016-04-20 17:03:24 +1000 |
commit | a88e07e54767623f6e318befb3a0411c1a347934 (patch) | |
tree | 2759053eedc5cbdfacf469c7b9cf3a62a60d82e8 /plugins/ZaMultiCompX2/ZaMultiCompX2Plugin.cpp | |
parent | 1e9bfa0a7a49d4ad2bd7caea663621aa8f3f7a8f (diff) |
Remove useless state from ZaMultiCompX2
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Diffstat (limited to 'plugins/ZaMultiCompX2/ZaMultiCompX2Plugin.cpp')
-rw-r--r-- | plugins/ZaMultiCompX2/ZaMultiCompX2Plugin.cpp | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/plugins/ZaMultiCompX2/ZaMultiCompX2Plugin.cpp b/plugins/ZaMultiCompX2/ZaMultiCompX2Plugin.cpp index 2744d80..78b47eb 100644 --- a/plugins/ZaMultiCompX2/ZaMultiCompX2Plugin.cpp +++ b/plugins/ZaMultiCompX2/ZaMultiCompX2Plugin.cpp @@ -709,21 +709,6 @@ void ZaMultiCompX2Plugin::setParameterValue(uint32_t index, float value) } } -String ZaMultiCompX2Plugin::getState(const char*) const -{ - return String(); -} - -void ZaMultiCompX2Plugin::setState(const char*, const char*) -{ - resetl = true; - resetr = true; -} - -void ZaMultiCompX2Plugin::initState(unsigned int, String&, String&) -{ -} - // ----------------------------------------------------------------------- // Process @@ -943,8 +928,8 @@ float ZaMultiCompX2Plugin::averageabs(float samples[]) void ZaMultiCompX2Plugin::run(const float** inputs, float** outputs, uint32_t frames) { float srate = getSampleRate(); - float maxxL = maxL; - float maxxR = maxR; + float maxxL = 0.; + float maxxR = 0.; uint32_t i; int tog1 = (toggle[0] > 0.5f) ? 1 : 0; @@ -1051,21 +1036,11 @@ void ZaMultiCompX2Plugin::run(const float** inputs, float** outputs, uint32_t fr outputs[0][i] *= from_dB(globalgain); outputs[1][i] *= from_dB(globalgain); - if (resetl) { - maxL = fabsf(outputs[0][i]); - resetl = false; - } else { - maxxL = (fabsf(outputs[0][i]) > maxxL) ? fabsf(outputs[0][i]) : sanitize_denormal(maxxL); - } - if (resetr) { - maxR = fabsf(outputs[1][i]); - resetr = false; - } else { - maxxR = (fabsf(outputs[1][i]) > maxxR) ? fabsf(outputs[1][i]) : sanitize_denormal(maxxR); - } + maxxL = (fabsf(outputs[0][i]) > maxxL) ? fabsf(outputs[0][i]) : sanitize_denormal(maxxL); + maxxR = (fabsf(outputs[1][i]) > maxxR) ? fabsf(outputs[1][i]) : sanitize_denormal(maxxR); } - outl = (maxxL <= 0.f) ? -160.f : to_dB(maxxL); - outr = (maxxR <= 0.f) ? -160.f : to_dB(maxxR); + outl = (maxxL == 0.f) ? -160.f : to_dB(maxxL); + outr = (maxxR == 0.f) ? -160.f : to_dB(maxxR); } // ----------------------------------------------------------------------- |