playlist/Plugin: rename with CamelCase

This commit is contained in:
Max Kellermann 2019-09-01 14:58:49 +02:00
parent 2376527d1f
commit 0d16772dea
23 changed files with 30 additions and 29 deletions

View File

@ -27,7 +27,7 @@ struct ConfigBlock;
struct Tag;
class SongEnumerator;
struct playlist_plugin {
struct PlaylistPlugin {
const char *name;
/**
@ -77,7 +77,7 @@ struct playlist_plugin {
* the plugin is not available
*/
static inline bool
playlist_plugin_init(const struct playlist_plugin *plugin,
playlist_plugin_init(const PlaylistPlugin *plugin,
const ConfigBlock &block)
{
return plugin->init != nullptr
@ -89,7 +89,7 @@ playlist_plugin_init(const struct playlist_plugin *plugin,
* Deinitialize a plugin which was initialized successfully.
*/
static inline void
playlist_plugin_finish(const struct playlist_plugin *plugin) noexcept
playlist_plugin_finish(const PlaylistPlugin *plugin) noexcept
{
if (plugin->finish != nullptr)
plugin->finish();

View File

@ -43,7 +43,7 @@
#include <assert.h>
const struct playlist_plugin *const playlist_plugins[] = {
const PlaylistPlugin *const playlist_plugins[] = {
&extm3u_playlist_plugin,
&m3u_playlist_plugin,
&pls_playlist_plugin,
@ -81,7 +81,7 @@ playlist_list_global_init(const ConfigData &config)
const ConfigBlock empty;
for (unsigned i = 0; playlist_plugins[i] != nullptr; ++i) {
const struct playlist_plugin *plugin = playlist_plugins[i];
const auto *plugin = playlist_plugins[i];
const auto *param =
config.FindBlock(ConfigBlockOption::PLAYLIST_PLUGIN,
"name", plugin->name);
@ -117,7 +117,7 @@ playlist_list_open_uri_scheme(const char *uri, Mutex &mutex,
return nullptr;
for (unsigned i = 0; playlist_plugins[i] != nullptr; ++i) {
const struct playlist_plugin *plugin = playlist_plugins[i];
const auto *plugin = playlist_plugins[i];
assert(!tried[i]);
@ -147,7 +147,7 @@ playlist_list_open_uri_suffix(const char *uri, Mutex &mutex,
return nullptr;
for (unsigned i = 0; playlist_plugins[i] != nullptr; ++i) {
const struct playlist_plugin *plugin = playlist_plugins[i];
const auto *plugin = playlist_plugins[i];
if (playlist_plugins_enabled[i] && !tried[i] &&
plugin->open_uri != nullptr && plugin->suffixes != nullptr &&

View File

@ -25,12 +25,13 @@
#include "util/Compiler.h"
struct ConfigData;
struct PlaylistPlugin;
class SongEnumerator;
extern const struct playlist_plugin *const playlist_plugins[];
extern const PlaylistPlugin *const playlist_plugins[];
#define playlist_plugins_for_each(plugin) \
for (const struct playlist_plugin *plugin, \
for (const PlaylistPlugin *plugin, \
*const*playlist_plugin_iterator = &playlist_plugins[0]; \
(plugin = *playlist_plugin_iterator) != nullptr; \
++playlist_plugin_iterator)

View File

@ -166,7 +166,7 @@ static const char *const asx_mime_types[] = {
nullptr
};
const struct playlist_plugin asx_playlist_plugin = {
const PlaylistPlugin asx_playlist_plugin = {
"asx",
nullptr,

View File

@ -20,6 +20,6 @@
#ifndef MPD_ASX_PLAYLIST_PLUGIN_HXX
#define MPD_ASX_PLAYLIST_PLUGIN_HXX
extern const struct playlist_plugin asx_playlist_plugin;
extern const struct PlaylistPlugin asx_playlist_plugin;
#endif

View File

@ -70,7 +70,7 @@ static const char *const cue_playlist_mime_types[] = {
nullptr
};
const struct playlist_plugin cue_playlist_plugin = {
const PlaylistPlugin cue_playlist_plugin = {
"cue",
nullptr,

View File

@ -20,6 +20,6 @@
#ifndef MPD_CUE_PLAYLIST_PLUGIN_HXX
#define MPD_CUE_PLAYLIST_PLUGIN_HXX
extern const struct playlist_plugin cue_playlist_plugin;
extern const struct PlaylistPlugin cue_playlist_plugin;
#endif

View File

@ -159,7 +159,7 @@ static const char *const embcue_playlist_suffixes[] = {
nullptr
};
const struct playlist_plugin embcue_playlist_plugin = {
const PlaylistPlugin embcue_playlist_plugin = {
"embcue",
nullptr,

View File

@ -20,6 +20,6 @@
#ifndef MPD_EMBCUE_PLAYLIST_PLUGIN_HXX
#define MPD_EMBCUE_PLAYLIST_PLUGIN_HXX
extern const struct playlist_plugin embcue_playlist_plugin;
extern const struct PlaylistPlugin embcue_playlist_plugin;
#endif

View File

@ -147,7 +147,7 @@ static const char *const extm3u_mime_types[] = {
nullptr
};
const struct playlist_plugin extm3u_playlist_plugin = {
const PlaylistPlugin extm3u_playlist_plugin = {
"extm3u",
nullptr,

View File

@ -20,6 +20,6 @@
#ifndef MPD_EXTM3U_PLAYLIST_PLUGIN_HXX
#define MPD_EXTM3U_PLAYLIST_PLUGIN_HXX
extern const struct playlist_plugin extm3u_playlist_plugin;
extern const struct PlaylistPlugin extm3u_playlist_plugin;
#endif

View File

@ -103,7 +103,7 @@ static const char *const flac_playlist_suffixes[] = {
nullptr
};
const struct playlist_plugin flac_playlist_plugin = {
const PlaylistPlugin flac_playlist_plugin = {
"flac",
nullptr,

View File

@ -20,6 +20,6 @@
#ifndef MPD_FLAC_PLAYLIST_PLUGIN_HXX
#define MPD_FLAC_PLAYLIST_PLUGIN_HXX
extern const struct playlist_plugin flac_playlist_plugin;
extern const struct PlaylistPlugin flac_playlist_plugin;
#endif

View File

@ -69,7 +69,7 @@ static const char *const m3u_mime_types[] = {
nullptr
};
const struct playlist_plugin m3u_playlist_plugin = {
const PlaylistPlugin m3u_playlist_plugin = {
"m3u",
nullptr,

View File

@ -20,6 +20,6 @@
#ifndef MPD_M3U_PLAYLIST_PLUGIN_HXX
#define MPD_M3U_PLAYLIST_PLUGIN_HXX
extern const struct playlist_plugin m3u_playlist_plugin;
extern const struct PlaylistPlugin m3u_playlist_plugin;
#endif

View File

@ -172,7 +172,7 @@ static const char *const pls_mime_types[] = {
nullptr
};
const struct playlist_plugin pls_playlist_plugin = {
const PlaylistPlugin pls_playlist_plugin = {
"pls",
nullptr,

View File

@ -20,6 +20,6 @@
#ifndef MPD_PLS_PLAYLIST_PLUGIN_HXX
#define MPD_PLS_PLAYLIST_PLUGIN_HXX
extern const struct playlist_plugin pls_playlist_plugin;
extern const struct PlaylistPlugin pls_playlist_plugin;
#endif

View File

@ -165,7 +165,7 @@ static const char *const rss_mime_types[] = {
nullptr
};
const struct playlist_plugin rss_playlist_plugin = {
const PlaylistPlugin rss_playlist_plugin = {
"rss",
nullptr,

View File

@ -20,6 +20,6 @@
#ifndef MPD_RSS_PLAYLIST_PLUGIN_HXX
#define MPD_RSS_PLAYLIST_PLUGIN_HXX
extern const struct playlist_plugin rss_playlist_plugin;
extern const struct PlaylistPlugin rss_playlist_plugin;
#endif

View File

@ -288,7 +288,7 @@ static const char *const soundcloud_schemes[] = {
nullptr
};
const struct playlist_plugin soundcloud_playlist_plugin = {
const PlaylistPlugin soundcloud_playlist_plugin = {
"soundcloud",
soundcloud_init,

View File

@ -20,6 +20,6 @@
#ifndef MPD_SOUNDCLOUD_PLAYLIST_PLUGIN_HXX
#define MPD_SOUNDCLOUD_PLAYLIST_PLUGIN_HXX
extern const struct playlist_plugin soundcloud_playlist_plugin;
extern const struct PlaylistPlugin soundcloud_playlist_plugin;
#endif

View File

@ -211,7 +211,7 @@ static const char *const xspf_mime_types[] = {
nullptr
};
const struct playlist_plugin xspf_playlist_plugin = {
const PlaylistPlugin xspf_playlist_plugin = {
"xspf",
nullptr,

View File

@ -20,6 +20,6 @@
#ifndef MPD_XSPF_PLAYLIST_PLUGIN_HXX
#define MPD_XSPF_PLAYLIST_PLUGIN_HXX
extern const struct playlist_plugin xspf_playlist_plugin;
extern const struct PlaylistPlugin xspf_playlist_plugin;
#endif