filter/Plugin: rename with CamelCase
This commit is contained in:
parent
541da2740d
commit
4dd1309c3f
@ -27,7 +27,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
PreparedFilter *
|
PreparedFilter *
|
||||||
filter_new(const struct filter_plugin *plugin, const ConfigBlock &block)
|
filter_new(const FilterPlugin *plugin, const ConfigBlock &block)
|
||||||
{
|
{
|
||||||
assert(plugin != nullptr);
|
assert(plugin != nullptr);
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ filter_configured_new(const ConfigBlock &block)
|
|||||||
if (plugin_name == nullptr)
|
if (plugin_name == nullptr)
|
||||||
throw std::runtime_error("No filter plugin specified");
|
throw std::runtime_error("No filter plugin specified");
|
||||||
|
|
||||||
const filter_plugin *plugin = filter_plugin_by_name(plugin_name);
|
const auto *plugin = filter_plugin_by_name(plugin_name);
|
||||||
if (plugin == nullptr)
|
if (plugin == nullptr)
|
||||||
throw FormatRuntimeError("No such filter plugin: %s",
|
throw FormatRuntimeError("No such filter plugin: %s",
|
||||||
plugin_name);
|
plugin_name);
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
struct ConfigBlock;
|
struct ConfigBlock;
|
||||||
class PreparedFilter;
|
class PreparedFilter;
|
||||||
|
|
||||||
struct filter_plugin {
|
struct FilterPlugin {
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,7 +47,7 @@ struct filter_plugin {
|
|||||||
* @param block configuration section
|
* @param block configuration section
|
||||||
*/
|
*/
|
||||||
PreparedFilter *
|
PreparedFilter *
|
||||||
filter_new(const struct filter_plugin *plugin,
|
filter_new(const FilterPlugin *plugin,
|
||||||
const ConfigBlock &block);
|
const ConfigBlock &block);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
const struct filter_plugin *const filter_plugins[] = {
|
const FilterPlugin *const filter_plugins[] = {
|
||||||
&null_filter_plugin,
|
&null_filter_plugin,
|
||||||
&route_filter_plugin,
|
&route_filter_plugin,
|
||||||
&normalize_filter_plugin,
|
&normalize_filter_plugin,
|
||||||
@ -32,7 +32,7 @@ const struct filter_plugin *const filter_plugins[] = {
|
|||||||
nullptr,
|
nullptr,
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct filter_plugin *
|
const FilterPlugin *
|
||||||
filter_plugin_by_name(const char *name)
|
filter_plugin_by_name(const char *name)
|
||||||
{
|
{
|
||||||
for (unsigned i = 0; filter_plugins[i] != nullptr; ++i)
|
for (unsigned i = 0; filter_plugins[i] != nullptr; ++i)
|
||||||
|
@ -28,16 +28,18 @@
|
|||||||
|
|
||||||
#include "Compiler.h"
|
#include "Compiler.h"
|
||||||
|
|
||||||
extern const struct filter_plugin null_filter_plugin;
|
struct FilterPlugin;
|
||||||
extern const struct filter_plugin chain_filter_plugin;
|
|
||||||
extern const struct filter_plugin convert_filter_plugin;
|
extern const FilterPlugin null_filter_plugin;
|
||||||
extern const struct filter_plugin route_filter_plugin;
|
extern const FilterPlugin chain_filter_plugin;
|
||||||
extern const struct filter_plugin normalize_filter_plugin;
|
extern const FilterPlugin convert_filter_plugin;
|
||||||
extern const struct filter_plugin volume_filter_plugin;
|
extern const FilterPlugin route_filter_plugin;
|
||||||
extern const struct filter_plugin replay_gain_filter_plugin;
|
extern const FilterPlugin normalize_filter_plugin;
|
||||||
|
extern const FilterPlugin volume_filter_plugin;
|
||||||
|
extern const FilterPlugin replay_gain_filter_plugin;
|
||||||
|
|
||||||
gcc_pure
|
gcc_pure
|
||||||
const struct filter_plugin *
|
const FilterPlugin *
|
||||||
filter_plugin_by_name(const char *name);
|
filter_plugin_by_name(const char *name);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -143,7 +143,7 @@ ChainFilter::FilterPCM(ConstBuffer<void> src)
|
|||||||
return src;
|
return src;
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct filter_plugin chain_filter_plugin = {
|
const FilterPlugin chain_filter_plugin = {
|
||||||
"chain",
|
"chain",
|
||||||
chain_filter_init,
|
chain_filter_init,
|
||||||
};
|
};
|
||||||
|
@ -125,7 +125,7 @@ ConvertFilter::FilterPCM(ConstBuffer<void> src)
|
|||||||
return state.Convert(src);
|
return state.Convert(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct filter_plugin convert_filter_plugin = {
|
const FilterPlugin convert_filter_plugin = {
|
||||||
"convert",
|
"convert",
|
||||||
convert_filter_init,
|
convert_filter_init,
|
||||||
};
|
};
|
||||||
|
@ -76,7 +76,7 @@ NormalizeFilter::FilterPCM(ConstBuffer<void> src)
|
|||||||
return { (const void *)dest, src.size };
|
return { (const void *)dest, src.size };
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct filter_plugin normalize_filter_plugin = {
|
const FilterPlugin normalize_filter_plugin = {
|
||||||
"normalize",
|
"normalize",
|
||||||
normalize_filter_init,
|
normalize_filter_init,
|
||||||
};
|
};
|
||||||
|
@ -54,7 +54,7 @@ null_filter_init(gcc_unused const ConfigBlock &block)
|
|||||||
return new PreparedNullFilter();
|
return new PreparedNullFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct filter_plugin null_filter_plugin = {
|
const FilterPlugin null_filter_plugin = {
|
||||||
"null",
|
"null",
|
||||||
null_filter_init,
|
null_filter_init,
|
||||||
};
|
};
|
||||||
|
@ -186,7 +186,7 @@ ReplayGainFilter::FilterPCM(ConstBuffer<void> src)
|
|||||||
: pv.Apply(src);
|
: pv.Apply(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct filter_plugin replay_gain_filter_plugin = {
|
const FilterPlugin replay_gain_filter_plugin = {
|
||||||
"replay_gain",
|
"replay_gain",
|
||||||
replay_gain_filter_init,
|
replay_gain_filter_init,
|
||||||
};
|
};
|
||||||
|
@ -272,7 +272,7 @@ RouteFilter::FilterPCM(ConstBuffer<void> src)
|
|||||||
return { result, result_size };
|
return { result, result_size };
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct filter_plugin route_filter_plugin = {
|
const FilterPlugin route_filter_plugin = {
|
||||||
"route",
|
"route",
|
||||||
route_filter_init,
|
route_filter_init,
|
||||||
};
|
};
|
||||||
|
@ -75,7 +75,7 @@ VolumeFilter::FilterPCM(ConstBuffer<void> src)
|
|||||||
return pv.Apply(src);
|
return pv.Apply(src);
|
||||||
}
|
}
|
||||||
|
|
||||||
const struct filter_plugin volume_filter_plugin = {
|
const FilterPlugin volume_filter_plugin = {
|
||||||
"volume",
|
"volume",
|
||||||
volume_filter_init,
|
volume_filter_init,
|
||||||
};
|
};
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
const struct filter_plugin *
|
const FilterPlugin *
|
||||||
filter_plugin_by_name(gcc_unused const char *name)
|
filter_plugin_by_name(gcc_unused const char *name)
|
||||||
{
|
{
|
||||||
assert(false);
|
assert(false);
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
const struct filter_plugin *
|
const FilterPlugin *
|
||||||
filter_plugin_by_name(gcc_unused const char *name)
|
filter_plugin_by_name(gcc_unused const char *name)
|
||||||
{
|
{
|
||||||
assert(false);
|
assert(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user