summaryrefslogtreecommitdiff
path: root/src/ReplayGainInfo.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-11-25 11:13:08 +0100
committerMax Kellermann <max@musicpd.org>2016-11-25 11:13:08 +0100
commit77c1f5487668569abb24dc458c40f019539dda52 (patch)
tree028c4bb9714a165f7a9ccb4984ae346267c719a7 /src/ReplayGainInfo.cxx
parentdc5984d0e0fb28ce4443c7bd1791fa1363fb7bed (diff)
ReplayGainConfig: add struct ReplayGainConfig, move globals to ReplayGainGlobal.cxx
Diffstat (limited to 'src/ReplayGainInfo.cxx')
-rw-r--r--src/ReplayGainInfo.cxx10
1 files changed, 5 insertions, 5 deletions
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 <math.h>
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;
}