- Fixed: Changing fluid_chorus and fluid_reverb did not take effect until the next song started.

SVN r3994 (trunk)
This commit is contained in:
Randy Heit 2012-12-21 23:58:33 +00:00
parent 849f30daab
commit 3123925fa8
2 changed files with 14 additions and 1 deletions

View File

@ -373,6 +373,8 @@ protected:
int (STACK_ARGS *fluid_settings_setint)(fluid_settings_t *, const char *, int);
int (STACK_ARGS *fluid_settings_getstr)(fluid_settings_t *, const char *, char **);
int (STACK_ARGS *fluid_settings_getint)(fluid_settings_t *, const char *, int *);
void (STACK_ARGS *fluid_synth_set_reverb_on)(fluid_synth_t *, int);
void (STACK_ARGS *fluid_synth_set_chorus_on)(fluid_synth_t *, int);
int (STACK_ARGS *fluid_synth_set_interp_method)(fluid_synth_t *, int, int);
int (STACK_ARGS *fluid_synth_set_polyphony)(fluid_synth_t *, int);
int (STACK_ARGS *fluid_synth_get_polyphony)(fluid_synth_t *);

View File

@ -544,7 +544,16 @@ void FluidSynthMIDIDevice::FluidSettingInt(const char *setting, int value)
}
else if (0 == fluid_settings_setint(FluidSettings, setting, value))
{
Printf("Faild to set %s to %d.\n", setting, value);
Printf("Failed to set %s to %d.\n", setting, value);
}
// fluid_settings_setint succeeded; update these settings in the running synth, too
else if (strcmp(setting, "synth.reverb.active") == 0)
{
fluid_synth_set_reverb_on(FluidSynth, value);
}
else if (strcmp(setting, "synth.chorus.active") == 0)
{
fluid_synth_set_chorus_on(FluidSynth, value);
}
}
@ -648,6 +657,8 @@ bool FluidSynthMIDIDevice::LoadFluidSynth()
{ (void **)&fluid_settings_setint, "fluid_settings_setint" },
{ (void **)&fluid_settings_getstr, "fluid_settings_getstr" },
{ (void **)&fluid_settings_getint, "fluid_settings_getint" },
{ (void **)&fluid_synth_set_reverb_on, "fluid_synth_set_reverb_on" },
{ (void **)&fluid_synth_set_chorus_on, "fluid_synth_set_chorus_on" },
{ (void **)&fluid_synth_set_interp_method, "fluid_synth_set_interp_method" },
{ (void **)&fluid_synth_set_polyphony, "fluid_synth_set_polyphony" },
{ (void **)&fluid_synth_get_polyphony, "fluid_synth_get_polyphony" },