From ca92dbbc94cf547b4251be8cc9eb16e1365b9439 Mon Sep 17 00:00:00 2001 From: derselbst Date: Tue, 19 Sep 2017 10:54:58 +0200 Subject: [PATCH] correctly register synth.volenv options --- src/synth/fluid_synth.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c index 3fc5759d..aa5bd15a 100644 --- a/src/synth/fluid_synth.c +++ b/src/synth/fluid_synth.c @@ -225,6 +225,8 @@ void fluid_synth_settings(fluid_settings_t* settings) fluid_settings_add_option(settings, "synth.midi-bank-select", "mma"); fluid_settings_register_str(settings, "synth.volenv", "emu", 0, NULL, NULL); + fluid_settings_add_option(settings, "synth.volenv", "emu"); + fluid_settings_add_option(settings, "synth.volenv", "compliant"); } /** @@ -559,20 +561,22 @@ new_fluid_synth(fluid_settings_t *settings) /* initialize all the conversion tables and other stuff */ if (fluid_synth_initialized == 0) { - char* buf; - if(fluid_settings_getstr(settings, "synth.volenv", &buf)) + char buf[64]; + if (fluid_settings_str_equal (settings, "synth.volenv", "compliant") == 1) { - if(FLUID_STRCMP(buf, "compliant") == 0) fluid_conversion_set_atten_power(FLUID_ATTEN_POWER_DEFAULT_COMPLIANT); - else if(FLUID_STRCMP(buf, "emu") == 0) + } + else if (fluid_settings_str_equal (settings, "synth.volenv", "emu") == 1) + { fluid_conversion_set_atten_power(FLUID_ATTEN_POWER_DEFAULT_EMU); - else + } + else + { + if (fluid_settings_copystr(settings, "synth.volenv", buf, 64) == 1) { double atten = atof(buf); if(atten != 0.0) fluid_conversion_set_atten_power(atten); - else - fluid_conversion_set_atten_power(FLUID_ATTEN_POWER_DEFAULT_EMU); } }