From 4fa5538e2bed36903b403e1aaee2462d22b456dc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 21 Jan 2015 22:13:44 +0100 Subject: config/Param: split block-specific attributes to new struct ConfigBlock The old struct config_param remains only for top-level string options. --- src/decoder/plugins/AdPlugDecoderPlugin.cxx | 4 ++-- src/decoder/plugins/AudiofileDecoderPlugin.cxx | 2 +- src/decoder/plugins/DsdiffDecoderPlugin.cxx | 4 ++-- src/decoder/plugins/FfmpegDecoderPlugin.cxx | 2 +- src/decoder/plugins/FlacDecoderPlugin.cxx | 2 +- src/decoder/plugins/FluidsynthDecoderPlugin.cxx | 6 +++--- src/decoder/plugins/MadDecoderPlugin.cxx | 2 +- src/decoder/plugins/MikmodDecoderPlugin.cxx | 8 ++++---- src/decoder/plugins/ModplugDecoderPlugin.cxx | 6 +++--- src/decoder/plugins/Mpg123DecoderPlugin.cxx | 2 +- src/decoder/plugins/OpusDecoderPlugin.cxx | 2 +- src/decoder/plugins/SidplayDecoderPlugin.cxx | 10 +++++----- src/decoder/plugins/SndfileDecoderPlugin.cxx | 2 +- src/decoder/plugins/VorbisDecoderPlugin.cxx | 2 +- src/decoder/plugins/WildmidiDecoderPlugin.cxx | 4 ++-- 15 files changed, 29 insertions(+), 29 deletions(-) (limited to 'src/decoder/plugins') diff --git a/src/decoder/plugins/AdPlugDecoderPlugin.cxx b/src/decoder/plugins/AdPlugDecoderPlugin.cxx index 5c495f74f..dd3f2b7ff 100644 --- a/src/decoder/plugins/AdPlugDecoderPlugin.cxx +++ b/src/decoder/plugins/AdPlugDecoderPlugin.cxx @@ -38,14 +38,14 @@ static constexpr Domain adplug_domain("adplug"); static unsigned sample_rate; static bool -adplug_init(const config_param ¶m) +adplug_init(const ConfigBlock &block) { FormatDebug(adplug_domain, "adplug %s", CAdPlug::get_version().c_str()); Error error; - sample_rate = param.GetBlockValue("sample_rate", 48000u); + sample_rate = block.GetBlockValue("sample_rate", 48000u); if (!audio_check_sample_rate(sample_rate, error)) { LogError(error); return false; diff --git a/src/decoder/plugins/AudiofileDecoderPlugin.cxx b/src/decoder/plugins/AudiofileDecoderPlugin.cxx index 5e3db7073..7d59d9460 100644 --- a/src/decoder/plugins/AudiofileDecoderPlugin.cxx +++ b/src/decoder/plugins/AudiofileDecoderPlugin.cxx @@ -43,7 +43,7 @@ audiofile_error_func(long, const char *msg) } static bool -audiofile_init(const config_param &) +audiofile_init(const ConfigBlock &) { afSetErrorHandler(audiofile_error_func); return true; diff --git a/src/decoder/plugins/DsdiffDecoderPlugin.cxx b/src/decoder/plugins/DsdiffDecoderPlugin.cxx index 4e7d32bfd..bd587e0ce 100644 --- a/src/decoder/plugins/DsdiffDecoderPlugin.cxx +++ b/src/decoder/plugins/DsdiffDecoderPlugin.cxx @@ -72,9 +72,9 @@ struct DsdiffMetaData { static bool lsbitfirst; static bool -dsdiff_init(const config_param ¶m) +dsdiff_init(const ConfigBlock &block) { - lsbitfirst = param.GetBlockValue("lsbitfirst", false); + lsbitfirst = block.GetBlockValue("lsbitfirst", false); return true; } diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index 772922865..faff70c66 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -73,7 +73,7 @@ FfmpegOpenInput(AVIOContext *pb, } static bool -ffmpeg_init(gcc_unused const config_param ¶m) +ffmpeg_init(gcc_unused const ConfigBlock &block) { FfmpegInit(); return true; diff --git a/src/decoder/plugins/FlacDecoderPlugin.cxx b/src/decoder/plugins/FlacDecoderPlugin.cxx index 5e674b35b..1455f7084 100644 --- a/src/decoder/plugins/FlacDecoderPlugin.cxx +++ b/src/decoder/plugins/FlacDecoderPlugin.cxx @@ -291,7 +291,7 @@ flac_decode(Decoder &decoder, InputStream &input_stream) } static bool -oggflac_init(gcc_unused const config_param ¶m) +oggflac_init(gcc_unused const ConfigBlock &block) { return !!FLAC_API_SUPPORTS_OGG_FLAC; } diff --git a/src/decoder/plugins/FluidsynthDecoderPlugin.cxx b/src/decoder/plugins/FluidsynthDecoderPlugin.cxx index 7a3b16199..2b4967b95 100644 --- a/src/decoder/plugins/FluidsynthDecoderPlugin.cxx +++ b/src/decoder/plugins/FluidsynthDecoderPlugin.cxx @@ -73,17 +73,17 @@ fluidsynth_mpd_log_function(int level, char *message, gcc_unused void *data) } static bool -fluidsynth_init(const config_param ¶m) +fluidsynth_init(const ConfigBlock &block) { Error error; - sample_rate = param.GetBlockValue("sample_rate", 48000u); + sample_rate = block.GetBlockValue("sample_rate", 48000u); if (!audio_check_sample_rate(sample_rate, error)) { LogError(error); return false; } - soundfont_path = param.GetBlockValue("soundfont", + soundfont_path = block.GetBlockValue("soundfont", "/usr/share/sounds/sf2/FluidR3_GM.sf2"); fluid_set_log_function(LAST_LOG_LEVEL, diff --git a/src/decoder/plugins/MadDecoderPlugin.cxx b/src/decoder/plugins/MadDecoderPlugin.cxx index 6e6feabc1..ea2c9ac6c 100644 --- a/src/decoder/plugins/MadDecoderPlugin.cxx +++ b/src/decoder/plugins/MadDecoderPlugin.cxx @@ -107,7 +107,7 @@ mad_fixed_to_24_buffer(int32_t *dest, const struct mad_synth *synth, } static bool -mp3_plugin_init(gcc_unused const config_param ¶m) +mp3_plugin_init(gcc_unused const ConfigBlock &block) { gapless_playback = config_get_bool(ConfigOption::GAPLESS_MP3_PLAYBACK, DEFAULT_GAPLESS_MP3_PLAYBACK); diff --git a/src/decoder/plugins/MikmodDecoderPlugin.cxx b/src/decoder/plugins/MikmodDecoderPlugin.cxx index 95f619061..135bae15a 100644 --- a/src/decoder/plugins/MikmodDecoderPlugin.cxx +++ b/src/decoder/plugins/MikmodDecoderPlugin.cxx @@ -109,15 +109,15 @@ static bool mikmod_loop; static unsigned mikmod_sample_rate; static bool -mikmod_decoder_init(const config_param ¶m) +mikmod_decoder_init(const ConfigBlock &block) { static char params[] = ""; - mikmod_loop = param.GetBlockValue("loop", false); - mikmod_sample_rate = param.GetBlockValue("sample_rate", 44100u); + mikmod_loop = block.GetBlockValue("loop", false); + mikmod_sample_rate = block.GetBlockValue("sample_rate", 44100u); if (!audio_valid_sample_rate(mikmod_sample_rate)) FormatFatalError("Invalid sample rate in line %d: %u", - param.line, mikmod_sample_rate); + block.line, mikmod_sample_rate); md_device = 0; md_reverb = 0; diff --git a/src/decoder/plugins/ModplugDecoderPlugin.cxx b/src/decoder/plugins/ModplugDecoderPlugin.cxx index fb65ded67..153392929 100644 --- a/src/decoder/plugins/ModplugDecoderPlugin.cxx +++ b/src/decoder/plugins/ModplugDecoderPlugin.cxx @@ -41,12 +41,12 @@ static constexpr offset_type MODPLUG_FILE_LIMIT = 100 * 1024 * 1024; static int modplug_loop_count; static bool -modplug_decoder_init(const config_param ¶m) +modplug_decoder_init(const ConfigBlock &block) { - modplug_loop_count = param.GetBlockValue("loop_count", 0); + modplug_loop_count = block.GetBlockValue("loop_count", 0); if (modplug_loop_count < -1) FormatFatalError("Invalid loop count in line %d: %i", - param.line, modplug_loop_count); + block.line, modplug_loop_count); return true; } diff --git a/src/decoder/plugins/Mpg123DecoderPlugin.cxx b/src/decoder/plugins/Mpg123DecoderPlugin.cxx index 5d66eda5c..760b8b9c2 100644 --- a/src/decoder/plugins/Mpg123DecoderPlugin.cxx +++ b/src/decoder/plugins/Mpg123DecoderPlugin.cxx @@ -37,7 +37,7 @@ static constexpr Domain mpg123_domain("mpg123"); static bool -mpd_mpg123_init(gcc_unused const config_param ¶m) +mpd_mpg123_init(gcc_unused const ConfigBlock &block) { mpg123_init(); diff --git a/src/decoder/plugins/OpusDecoderPlugin.cxx b/src/decoder/plugins/OpusDecoderPlugin.cxx index 345df1111..0d03566a7 100644 --- a/src/decoder/plugins/OpusDecoderPlugin.cxx +++ b/src/decoder/plugins/OpusDecoderPlugin.cxx @@ -61,7 +61,7 @@ IsOpusTags(const ogg_packet &packet) } static bool -mpd_opus_init(gcc_unused const config_param ¶m) +mpd_opus_init(gcc_unused const ConfigBlock &block) { LogDebug(opus_domain, opus_get_version_string()); diff --git a/src/decoder/plugins/SidplayDecoderPlugin.cxx b/src/decoder/plugins/SidplayDecoderPlugin.cxx index 4bb31db34..0d17e98c4 100644 --- a/src/decoder/plugins/SidplayDecoderPlugin.cxx +++ b/src/decoder/plugins/SidplayDecoderPlugin.cxx @@ -64,22 +64,22 @@ sidplay_load_songlength_db(const Path path) } static bool -sidplay_init(const config_param ¶m) +sidplay_init(const ConfigBlock &block) { /* read the songlengths database file */ Error error; - const auto database_path = param.GetBlockPath("songlength_database", error); + const auto database_path = block.GetBlockPath("songlength_database", error); if (!database_path.IsNull()) songlength_database = sidplay_load_songlength_db(database_path); else if (error.IsDefined()) FatalError(error); - default_songlength = param.GetBlockValue("default_songlength", 0u); + default_songlength = block.GetBlockValue("default_songlength", 0u); all_files_are_containers = - param.GetBlockValue("all_files_are_containers", true); + block.GetBlockValue("all_files_are_containers", true); - filter_setting = param.GetBlockValue("filter", true); + filter_setting = block.GetBlockValue("filter", true); return true; } diff --git a/src/decoder/plugins/SndfileDecoderPlugin.cxx b/src/decoder/plugins/SndfileDecoderPlugin.cxx index f84cb02aa..68ca20cc7 100644 --- a/src/decoder/plugins/SndfileDecoderPlugin.cxx +++ b/src/decoder/plugins/SndfileDecoderPlugin.cxx @@ -32,7 +32,7 @@ static constexpr Domain sndfile_domain("sndfile"); static bool -sndfile_init(gcc_unused const config_param ¶m) +sndfile_init(gcc_unused const ConfigBlock &block) { LogDebug(sndfile_domain, sf_version_string()); return true; diff --git a/src/decoder/plugins/VorbisDecoderPlugin.cxx b/src/decoder/plugins/VorbisDecoderPlugin.cxx index 7b2fae4d7..d569f747e 100644 --- a/src/decoder/plugins/VorbisDecoderPlugin.cxx +++ b/src/decoder/plugins/VorbisDecoderPlugin.cxx @@ -194,7 +194,7 @@ vorbis_interleave(float *dest, const float *const*src, /* public */ static bool -vorbis_init(gcc_unused const config_param ¶m) +vorbis_init(gcc_unused const ConfigBlock &block) { #ifndef HAVE_TREMOR LogDebug(vorbis_domain, vorbis_version_string()); diff --git a/src/decoder/plugins/WildmidiDecoderPlugin.cxx b/src/decoder/plugins/WildmidiDecoderPlugin.cxx index 6b3307f44..64fa33b05 100644 --- a/src/decoder/plugins/WildmidiDecoderPlugin.cxx +++ b/src/decoder/plugins/WildmidiDecoderPlugin.cxx @@ -38,11 +38,11 @@ static constexpr Domain wildmidi_domain("wildmidi"); static constexpr unsigned WILDMIDI_SAMPLE_RATE = 48000; static bool -wildmidi_init(const config_param ¶m) +wildmidi_init(const ConfigBlock &block) { Error error; const AllocatedPath path = - param.GetBlockPath("config_file", + block.GetBlockPath("config_file", "/etc/timidity/timidity.cfg", error); if (path.IsNull()) -- cgit v1.2.3