playlist/Registry: use struct ConfigData

This commit is contained in:
Max Kellermann 2018-07-17 22:10:32 +02:00
parent ea5096ac90
commit 61a119b607
4 changed files with 8 additions and 7 deletions

View File

@ -572,7 +572,7 @@ try {
client_manager_init(); client_manager_init();
input_stream_global_init(GetGlobalConfig(), input_stream_global_init(GetGlobalConfig(),
instance->io_thread.GetEventLoop()); instance->io_thread.GetEventLoop());
playlist_list_global_init(); playlist_list_global_init(GetGlobalConfig());
#ifdef ENABLE_DAEMON #ifdef ENABLE_DAEMON
daemonize_commit(); daemonize_commit();

View File

@ -36,7 +36,7 @@
#include "util/UriUtil.hxx" #include "util/UriUtil.hxx"
#include "util/StringUtil.hxx" #include "util/StringUtil.hxx"
#include "util/Macros.hxx" #include "util/Macros.hxx"
#include "config/Global.hxx" #include "config/Data.hxx"
#include "config/Block.hxx" #include "config/Block.hxx"
#include <assert.h> #include <assert.h>
@ -75,15 +75,15 @@ static bool playlist_plugins_enabled[n_playlist_plugins];
if (playlist_plugins_enabled[playlist_plugin_iterator - playlist_plugins]) if (playlist_plugins_enabled[playlist_plugin_iterator - playlist_plugins])
void void
playlist_list_global_init(void) playlist_list_global_init(const ConfigData &config)
{ {
const ConfigBlock empty; const ConfigBlock empty;
for (unsigned i = 0; playlist_plugins[i] != nullptr; ++i) { for (unsigned i = 0; playlist_plugins[i] != nullptr; ++i) {
const struct playlist_plugin *plugin = playlist_plugins[i]; const struct playlist_plugin *plugin = playlist_plugins[i];
const auto *param = const auto *param =
config_find_block(ConfigBlockOption::PLAYLIST_PLUGIN, config.FindBlock(ConfigBlockOption::PLAYLIST_PLUGIN,
"name", plugin->name); "name", plugin->name);
if (param == nullptr) if (param == nullptr)
param = &empty; param = &empty;
else if (!param->GetBlockValue("enabled", true)) else if (!param->GetBlockValue("enabled", true))

View File

@ -23,6 +23,7 @@
#include "input/Ptr.hxx" #include "input/Ptr.hxx"
#include "Compiler.h" #include "Compiler.h"
struct ConfigData;
class Mutex; class Mutex;
class SongEnumerator; class SongEnumerator;
@ -38,7 +39,7 @@ extern const struct playlist_plugin *const playlist_plugins[];
* Initializes all playlist plugins. * Initializes all playlist plugins.
*/ */
void void
playlist_list_global_init(); playlist_list_global_init(const ConfigData &config);
/** /**
* Deinitializes all playlist plugins. * Deinitializes all playlist plugins.

View File

@ -68,7 +68,7 @@ try {
io_thread.Start(); io_thread.Start();
input_stream_global_init(GetGlobalConfig(), io_thread.GetEventLoop()); input_stream_global_init(GetGlobalConfig(), io_thread.GetEventLoop());
playlist_list_global_init(); playlist_list_global_init(GetGlobalConfig());
decoder_plugin_init_all(GetGlobalConfig()); decoder_plugin_init_all(GetGlobalConfig());
/* open the playlist */ /* open the playlist */