summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-07-17 22:32:56 +0200
committerMax Kellermann <max@musicpd.org>2018-07-17 22:32:56 +0200
commit0209bc4ba7112792ab3b88e6aff548ad5da04d63 (patch)
treece1ff610357b244789c6f5b6f51aff20c3f9e083
parentdd57b81989a1f7622aa5017e1edf86070fd3b061 (diff)
ReplayGainGlobal: use struct ConfigData
-rw-r--r--src/Main.cxx6
-rw-r--r--src/ReplayGainGlobal.cxx12
-rw-r--r--src/ReplayGainGlobal.hxx3
3 files changed, 11 insertions, 10 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index 40d7ef895..9b92ad8d7 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -135,9 +135,9 @@ struct Config {
};
static Config
-LoadConfig()
+LoadConfig(const ConfigData &config)
{
- return {LoadReplayGainConfig()};
+ return {LoadReplayGainConfig(config)};
}
#ifdef ENABLE_DAEMON
@@ -494,7 +494,7 @@ try {
ParseCommandLine(argc, argv, options);
#endif
- const auto config = LoadConfig();
+ const auto config = LoadConfig(GetGlobalConfig());
#ifdef ENABLE_DAEMON
glue_daemonize_init(&options);
diff --git a/src/ReplayGainGlobal.cxx b/src/ReplayGainGlobal.cxx
index 22c1c9767..8adbeb062 100644
--- a/src/ReplayGainGlobal.cxx
+++ b/src/ReplayGainGlobal.cxx
@@ -21,7 +21,7 @@
#include "ReplayGainGlobal.hxx"
#include "ReplayGainConfig.hxx"
#include "config/Param.hxx"
-#include "config/Global.hxx"
+#include "config/Data.hxx"
#include "util/RuntimeError.hxx"
#include <assert.h>
@@ -56,20 +56,20 @@ ParsePreamp(const ConfigParam &p)
}
ReplayGainConfig
-LoadReplayGainConfig()
+LoadReplayGainConfig(const ConfigData &config)
{
ReplayGainConfig replay_gain_config;
- const auto *param = config_get_param(ConfigOption::REPLAYGAIN_PREAMP);
+ const auto *param = config.GetParam(ConfigOption::REPLAYGAIN_PREAMP);
if (param)
replay_gain_config.preamp = ParsePreamp(*param);
- param = config_get_param(ConfigOption::REPLAYGAIN_MISSING_PREAMP);
+ param = config.GetParam(ConfigOption::REPLAYGAIN_MISSING_PREAMP);
if (param)
replay_gain_config.missing_preamp = ParsePreamp(*param);
- replay_gain_config.limit = config_get_bool(ConfigOption::REPLAYGAIN_LIMIT,
- ReplayGainConfig::DEFAULT_LIMIT);
+ replay_gain_config.limit = config.GetBool(ConfigOption::REPLAYGAIN_LIMIT,
+ ReplayGainConfig::DEFAULT_LIMIT);
return replay_gain_config;
}
diff --git a/src/ReplayGainGlobal.hxx b/src/ReplayGainGlobal.hxx
index 772ac9407..3b7c59941 100644
--- a/src/ReplayGainGlobal.hxx
+++ b/src/ReplayGainGlobal.hxx
@@ -22,9 +22,10 @@
#include "check.h"
+struct ConfigData;
struct ReplayGainConfig;
ReplayGainConfig
-LoadReplayGainConfig();
+LoadReplayGainConfig(const ConfigData &config);
#endif