diff --git a/include/fluidsynth/ladspa.h b/include/fluidsynth/ladspa.h index 78ef0d0b..539a84d1 100644 --- a/include/fluidsynth/ladspa.h +++ b/include/fluidsynth/ladspa.h @@ -25,10 +25,6 @@ extern "C" { #endif -typedef struct _fluid_ladspa_fx_t fluid_ladspa_fx_t; - -FLUIDSYNTH_API fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth); - FLUIDSYNTH_API int fluid_ladspa_is_active(fluid_ladspa_fx_t *fx); FLUIDSYNTH_API int fluid_ladspa_activate(fluid_ladspa_fx_t *fx); FLUIDSYNTH_API int fluid_ladspa_deactivate(fluid_ladspa_fx_t *fx); diff --git a/include/fluidsynth/synth.h b/include/fluidsynth/synth.h index f4e0aeed..a459e761 100644 --- a/include/fluidsynth/synth.h +++ b/include/fluidsynth/synth.h @@ -347,6 +347,10 @@ FLUIDSYNTH_API FLUID_DEPRECATED void fluid_synth_set_midi_router(fluid_synth_t* synth, fluid_midi_router_t* router); +/* LADSPA */ + +FLUIDSYNTH_API fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth); + #ifdef __cplusplus } #endif diff --git a/include/fluidsynth/types.h b/include/fluidsynth/types.h index 0903a95f..7ef8d5d1 100644 --- a/include/fluidsynth/types.h +++ b/include/fluidsynth/types.h @@ -57,6 +57,8 @@ typedef struct _fluid_sequencer_t fluid_sequencer_t; /**< Sequencer i typedef struct _fluid_ramsfont_t fluid_ramsfont_t; /**< RAM SoundFont */ typedef struct _fluid_rampreset_t fluid_rampreset_t; /**< RAM SoundFont preset */ typedef struct _fluid_cmd_handler_t fluid_cmd_handler_t; /**< Shell Command Handler */ +typedef struct _fluid_ladspa_fx_t fluid_ladspa_fx_t; /**< LADSPA effects instance */ + typedef int fluid_istream_t; /**< Input stream descriptor */ typedef int fluid_ostream_t; /**< Output stream descriptor */ diff --git a/src/bindings/fluid_ladspa.c b/src/bindings/fluid_ladspa.c index 3c9499a7..0558c64f 100644 --- a/src/bindings/fluid_ladspa.c +++ b/src/bindings/fluid_ladspa.c @@ -262,17 +262,6 @@ void delete_fluid_ladspa_fx(fluid_ladspa_fx_t *fx) FLUID_FREE(fx); } -/** - * Return the LADSPA effects instance used by FluidSynth - * - * @param synth FluidSynth instance - * @return pointer to LADSPA fx or NULL - */ -fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth) -{ - return synth->ladspa_fx; -} - /** * Add host buffers to the LADSPA engine. * @@ -1674,11 +1663,6 @@ static FLUID_INLINE void copy_effect_to_host_buffers(fluid_ladspa_fx_t *fx, int /* Dummy functions to use if LADSPA is not compiled in, to keep the * FluidSynth library ABI stable */ -fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth) -{ - return NULL; -} - int fluid_ladspa_is_active(fluid_ladspa_fx_t *fx) { return FALSE; diff --git a/src/bindings/fluid_ladspa.h b/src/bindings/fluid_ladspa.h index e9c390ac..768ec648 100644 --- a/src/bindings/fluid_ladspa.h +++ b/src/bindings/fluid_ladspa.h @@ -29,7 +29,6 @@ fluid_ladspa_fx_t *new_fluid_ladspa_fx(fluid_real_t sample_rate, int buffer_size); void delete_fluid_ladspa_fx(fluid_ladspa_fx_t *fx); -fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth); int fluid_ladspa_set_sample_rate(fluid_ladspa_fx_t *fx, fluid_real_t sample_rate); diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c index 67544551..346e2301 100644 --- a/src/synth/fluid_synth.c +++ b/src/synth/fluid_synth.c @@ -5288,3 +5288,14 @@ int fluid_synth_set_channel_type(fluid_synth_t* synth, int chan, int type) FLUID_API_RETURN(FLUID_OK); } + +/** + * Return the LADSPA effects instance used by FluidSynth + * + * @param synth FluidSynth instance + * @return pointer to LADSPA fx or NULL + */ +fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth) +{ + return synth->ladspa_fx; +} diff --git a/src/synth/fluid_synth.h b/src/synth/fluid_synth.h index 5433c0fb..ea42c19a 100644 --- a/src/synth/fluid_synth.h +++ b/src/synth/fluid_synth.h @@ -169,9 +169,7 @@ struct _fluid_synth_t fluid_mod_t* default_mod; /**< the (dynamic) list of default modulators */ -#ifdef LADSPA - fluid_ladspa_fx_t* ladspa_fx; /**< Effects unit for LADSPA support */ -#endif + fluid_ladspa_fx_t* ladspa_fx; /**< Effects unit for LADSPA support */ }; fluid_preset_t* fluid_synth_find_preset(fluid_synth_t* synth, @@ -213,4 +211,6 @@ void fluid_synth_process_event_queue(fluid_synth_t* synth); void fluid_synth_settings(fluid_settings_t* settings); +fluid_ladspa_fx_t *fluid_synth_get_ladspa_fx(fluid_synth_t *synth); + #endif /* _FLUID_SYNTH_H */