config/Param: split block-specific attributes to new struct ConfigBlock
The old struct config_param remains only for top-level string options.
This commit is contained in:
@@ -56,21 +56,21 @@ struct flac_encoder {
|
||||
static constexpr Domain flac_encoder_domain("vorbis_encoder");
|
||||
|
||||
static bool
|
||||
flac_encoder_configure(struct flac_encoder *encoder, const config_param ¶m,
|
||||
flac_encoder_configure(struct flac_encoder *encoder, const ConfigBlock &block,
|
||||
gcc_unused Error &error)
|
||||
{
|
||||
encoder->compression = param.GetBlockValue("compression", 5u);
|
||||
encoder->compression = block.GetBlockValue("compression", 5u);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static Encoder *
|
||||
flac_encoder_init(const config_param ¶m, Error &error)
|
||||
flac_encoder_init(const ConfigBlock &block, Error &error)
|
||||
{
|
||||
flac_encoder *encoder = new flac_encoder();
|
||||
|
||||
/* load configuration from "param" */
|
||||
if (!flac_encoder_configure(encoder, param, error)) {
|
||||
/* load configuration from "block" */
|
||||
if (!flac_encoder_configure(encoder, block, error)) {
|
||||
/* configuration has failed, roll back and return error */
|
||||
delete encoder;
|
||||
return nullptr;
|
||||
|
Reference in New Issue
Block a user