re-introduce fluid_synth_set_gen2()

to reduce API breakage
This commit is contained in:
derselbst 2017-12-06 12:18:06 +01:00
parent 38fc7fb027
commit a4e43d3543
3 changed files with 12 additions and 7 deletions

View file

@ -86,7 +86,6 @@ Changes in FluidSynth 2.0.0 concerning developers:
- remove misspelled FLUID_SEQ_PITCHWHHELSENS macro
- remove obsolete "audio.[out|in]put-channels" settings
- remove unimplemented "synth.dump" setting
- remove fluid_synth_set_gen2(), fluid_synth_set_gen() now behaves as fluid_synth_set_gen2()
- remove struct _fluid_mod_t from public API, use the getters and setters of mod.h instead
- remove struct _fluid_gen_t, fluid_gen_set_default_values() and enum fluid_gen_flags from public API
- remove macros fluid_sfont_get_id() and fluid_sample_refcount() from public API

View file

@ -218,6 +218,8 @@ enum fluid_interp {
/* Generator interface */
FLUIDSYNTH_API int fluid_synth_set_gen (fluid_synth_t* synth, int chan,
int param, float value);
FLUIDSYNTH_API int fluid_synth_set_gen2 (fluid_synth_t* synth, int chan,
int param, float value,
int absolute, int normalized);
FLUIDSYNTH_API float fluid_synth_get_gen(fluid_synth_t* synth, int chan, int param);

View file

@ -4831,6 +4831,14 @@ fluid_synth_get_settings(fluid_synth_t* synth)
return synth->settings;
}
/**
* Same as calling \c fluid_synth_set_gen2(synth, chan, param, value, FALSE, FALSE)
* @return FLUID_OK on success, FLUID_FAILED otherwise
*/
int fluid_synth_set_gen(fluid_synth_t* synth, int chan, int param, float value)
{
return fluid_synth_set_gen2(synth, chan, param, value, FALSE, FALSE);
}
/**
* Set a SoundFont generator (effect) value on a MIDI channel in real-time.
@ -4843,19 +4851,15 @@ fluid_synth_get_settings(fluid_synth_t* synth)
* TRUE to take the value as a 0.0-1.0 range and apply it to the valid
* generator effect range (scaled and shifted as necessary).
* @return FLUID_OK on success, FLUID_FAILED otherwise
* @since 2.0.0
*
* This function allows for setting all effect parameters in real time on a
* MIDI channel. Setting absolute to non-zero will cause the value to override
* any generator values set in the instruments played on the MIDI channel.
* See SoundFont 2.01 spec, paragraph 8.1.3, page 48 for details on SoundFont
* generator parameters and valid ranges.
*
* @note The old behaviour of fluid_synth_set_gen() assumed \c absolute and \c normalized to
* be FALSE.
*/
int
fluid_synth_set_gen(fluid_synth_t* synth, int chan, int param,
fluid_synth_set_gen2(fluid_synth_t* synth, int chan, int param,
float value, int absolute, int normalized)
{
float v;