fluidmax: Fix compilation failure

...by adding new functions to reset reverb and chorus into the engine.
This commit is contained in:
David Henningsson 2012-11-18 09:30:46 +00:00
parent 9fba1fe88a
commit 5f3568deee
6 changed files with 47 additions and 2 deletions

View file

@ -761,7 +761,7 @@ fluidmax_reverb(t_object *o, Symbol *s, short ac, Atom *at)
if(ac == 0)
{
fluid_synth_set_reverb_on(self->synth, 1);
fluid_revmodel_reset(self->synth->reverb);
fluid_synth_reset_reverb(self->synth);
self->reverb = 1;
}
else if(ftmax_is_number(at))
@ -816,7 +816,7 @@ fluidmax_chorus(t_object *o, Symbol *s, short ac, Atom *at)
if(ac == 0)
{
fluid_synth_set_chorus_on(self->synth, 1);
fluid_chorus_reset(self->synth->chorus);
fluid_synth_reset_chorus(self->synth);
self->chorus = 1;
}
else if(ftmax_is_number(at))

View file

@ -111,6 +111,8 @@ fluid_rvoice_event_dispatch(fluid_rvoice_event_t* event)
EVENTFUNC_I1(fluid_rvoice_mixer_set_chorus_enabled, fluid_rvoice_mixer_t*);
EVENTFUNC_I1(fluid_rvoice_mixer_set_mix_fx, fluid_rvoice_mixer_t*);
EVENTFUNC_0(fluid_rvoice_mixer_reset_fx, fluid_rvoice_mixer_t*);
EVENTFUNC_0(fluid_rvoice_mixer_reset_reverb, fluid_rvoice_mixer_t*);
EVENTFUNC_0(fluid_rvoice_mixer_reset_chorus, fluid_rvoice_mixer_t*);
EVENTFUNC_IR(fluid_rvoice_mixer_set_threads, fluid_rvoice_mixer_t*);
EVENTFUNC_ALL(fluid_rvoice_mixer_set_chorus_params, fluid_rvoice_mixer_t*);

View file

@ -683,6 +683,16 @@ void fluid_rvoice_mixer_reset_fx(fluid_rvoice_mixer_t* mixer)
fluid_chorus_reset(mixer->fx.chorus);
}
void fluid_rvoice_mixer_reset_reverb(fluid_rvoice_mixer_t* mixer)
{
fluid_revmodel_reset(mixer->fx.reverb);
}
void fluid_rvoice_mixer_reset_chorus(fluid_rvoice_mixer_t* mixer)
{
fluid_chorus_reset(mixer->fx.chorus);
}
int fluid_rvoice_mixer_get_bufs(fluid_rvoice_mixer_t* mixer,
fluid_real_t*** left, fluid_real_t*** right)
{

View file

@ -59,6 +59,8 @@ void fluid_rvoice_mixer_set_reverb_params(fluid_rvoice_mixer_t* mixer, int set,
double roomsize, double damping,
double width, double level);
void fluid_rvoice_mixer_reset_fx(fluid_rvoice_mixer_t* mixer);
void fluid_rvoice_mixer_reset_reverb(fluid_rvoice_mixer_t* mixer);
void fluid_rvoice_mixer_reset_chorus(fluid_rvoice_mixer_t* mixer);
void fluid_rvoice_mixer_set_threads(fluid_rvoice_mixer_t* mixer, int thread_count,
int prio_level);

View file

@ -1535,6 +1535,35 @@ fluid_synth_all_sounds_off_LOCAL(fluid_synth_t* synth, int chan)
return FLUID_OK;
}
/**
* Reset reverb engine
* @param synth FluidSynth instance
* @return FLUID_OK on success, FLUID_FAILED otherwise
*/
int
fluid_synth_reset_reverb(fluid_synth_t* synth)
{
fluid_return_val_if_fail (synth != NULL, FLUID_FAILED);
fluid_synth_api_enter(synth);
fluid_synth_update_mixer(synth, fluid_rvoice_mixer_reset_reverb, 0, 0.0f);
FLUID_API_RETURN(FLUID_OK);
}
/**
* Reset chorus engine
* @param synth FluidSynth instance
* @return FLUID_OK on success, FLUID_FAILED otherwise
*/
int
fluid_synth_reset_chorus(fluid_synth_t* synth)
{
fluid_return_val_if_fail (synth != NULL, FLUID_FAILED);
fluid_synth_api_enter(synth);
fluid_synth_update_mixer(synth, fluid_rvoice_mixer_reset_chorus, 0, 0.0f);
FLUID_API_RETURN(FLUID_OK);
}
/**
* Send MIDI system reset command (big red 'panic' button), turns off notes and
* resets controllers.

View file

@ -211,10 +211,12 @@ void fluid_synth_dither_s16(int *dither_index, int len, float* lin, float* rin,
void* lout, int loff, int lincr,
void* rout, int roff, int rincr);
int fluid_synth_reset_reverb(fluid_synth_t* synth);
int fluid_synth_set_reverb_preset(fluid_synth_t* synth, int num);
int fluid_synth_set_reverb_full(fluid_synth_t* synth, int set, double roomsize,
double damping, double width, double level);
int fluid_synth_reset_chorus(fluid_synth_t* synth);
int fluid_synth_set_chorus_full(fluid_synth_t* synth, int set, int nr, double level,
double speed, double depth_ms, int type);