From 77c1f5487668569abb24dc458c40f019539dda52 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 25 Nov 2016 11:13:08 +0100 Subject: ReplayGainConfig: add struct ReplayGainConfig, move globals to ReplayGainGlobal.cxx --- src/ReplayGainInfo.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/ReplayGainInfo.cxx') diff --git a/src/ReplayGainInfo.cxx b/src/ReplayGainInfo.cxx index 3524811a0..9e2644778 100644 --- a/src/ReplayGainInfo.cxx +++ b/src/ReplayGainInfo.cxx @@ -19,25 +19,25 @@ #include "config.h" #include "ReplayGainInfo.hxx" +#include "ReplayGainConfig.hxx" #include float -ReplayGainTuple::CalculateScale(float preamp, float missing_preamp, - bool peak_limit) const +ReplayGainTuple::CalculateScale(const ReplayGainConfig &config) const { float scale; if (IsDefined()) { scale = pow(10.0, gain / 20.0); - scale *= preamp; + scale *= config.preamp; if (scale > 15.0) scale = 15.0; - if (peak_limit && scale * peak > 1.0) + if (config.limit && scale * peak > 1.0) scale = 1.0 / peak; } else - scale = missing_preamp; + scale = config.missing_preamp; return scale; } -- cgit v1.2.3