config/Templates: add constructor with defaulted "repeat" parameter

This commit is contained in:
Max Kellermann 2015-06-26 00:11:23 +02:00
parent 8d11577ff2
commit 9477db2363
2 changed files with 53 additions and 49 deletions

View File

@ -24,55 +24,55 @@
#include <string.h> #include <string.h>
const ConfigTemplate config_param_templates[] = { const ConfigTemplate config_param_templates[] = {
{ "music_directory", false }, { "music_directory" },
{ "playlist_directory", false }, { "playlist_directory" },
{ "follow_inside_symlinks", false }, { "follow_inside_symlinks" },
{ "follow_outside_symlinks", false }, { "follow_outside_symlinks" },
{ "db_file", false }, { "db_file" },
{ "sticker_file", false }, { "sticker_file" },
{ "log_file", false }, { "log_file" },
{ "pid_file", false }, { "pid_file" },
{ "state_file", false }, { "state_file" },
{ "state_file_interval", false }, { "state_file_interval" },
{ "restore_paused", false }, { "restore_paused" },
{ "user", false }, { "user" },
{ "group", false }, { "group" },
{ "bind_to_address", true }, { "bind_to_address", true },
{ "port", false }, { "port" },
{ "log_level", false }, { "log_level" },
{ "zeroconf_name", false }, { "zeroconf_name" },
{ "zeroconf_enabled", false }, { "zeroconf_enabled" },
{ "password", true }, { "password", true },
{ "default_permissions", false }, { "default_permissions" },
{ "audio_output_format", false }, { "audio_output_format" },
{ "mixer_type", false }, { "mixer_type" },
{ "replaygain", false }, { "replaygain" },
{ "replaygain_preamp", false }, { "replaygain_preamp" },
{ "replaygain_missing_preamp", false }, { "replaygain_missing_preamp" },
{ "replaygain_limit", false }, { "replaygain_limit" },
{ "volume_normalization", false }, { "volume_normalization" },
{ "samplerate_converter", false }, { "samplerate_converter" },
{ "audio_buffer_size", false }, { "audio_buffer_size" },
{ "buffer_before_play", false }, { "buffer_before_play" },
{ "http_proxy_host", false }, { "http_proxy_host" },
{ "http_proxy_port", false }, { "http_proxy_port" },
{ "http_proxy_user", false }, { "http_proxy_user" },
{ "http_proxy_password", false }, { "http_proxy_password" },
{ "connection_timeout", false }, { "connection_timeout" },
{ "max_connections", false }, { "max_connections" },
{ "max_playlist_length", false }, { "max_playlist_length" },
{ "max_command_list_size", false }, { "max_command_list_size" },
{ "max_output_buffer_size", false }, { "max_output_buffer_size" },
{ "filesystem_charset", false }, { "filesystem_charset" },
{ "id3v1_encoding", false }, { "id3v1_encoding" },
{ "metadata_to_use", false }, { "metadata_to_use" },
{ "save_absolute_paths_in_playlists", false }, { "save_absolute_paths_in_playlists" },
{ "gapless_mp3_playback", false }, { "gapless_mp3_playback" },
{ "auto_update", false }, { "auto_update" },
{ "auto_update_depth", false }, { "auto_update_depth" },
{ "despotify_user", false }, { "despotify_user" },
{ "despotify_password", false }, { "despotify_password" },
{ "despotify_high_bitrate", false }, { "despotify_high_bitrate" },
}; };
static constexpr unsigned n_config_param_templates = static constexpr unsigned n_config_param_templates =
@ -86,9 +86,9 @@ const ConfigTemplate config_block_templates[] = {
{ "decoder", true }, { "decoder", true },
{ "input", true }, { "input", true },
{ "playlist_plugin", true }, { "playlist_plugin", true },
{ "resampler", false }, { "resampler" },
{ "filter", true }, { "filter", true },
{ "database", false }, { "database" },
{ "neighbors", true }, { "neighbors", true },
}; };

View File

@ -23,6 +23,10 @@
struct ConfigTemplate { struct ConfigTemplate {
const char *const name; const char *const name;
const bool repeatable; const bool repeatable;
constexpr ConfigTemplate(const char *_name,
bool _repeatable=false)
:name(_name), repeatable(_repeatable) {}
}; };
extern const ConfigTemplate config_param_templates[]; extern const ConfigTemplate config_param_templates[];