libfluidsynth
2.1.1
|
Functions for manipulating the ladspa effects unit. More...
Functions | |
FLUIDSYNTH_API int | fluid_ladspa_is_active (fluid_ladspa_fx_t *fx) |
Check if the LADSPA engine is currently used to render audio. More... | |
FLUIDSYNTH_API int | fluid_ladspa_activate (fluid_ladspa_fx_t *fx) |
Activate the LADSPA fx instance and each configured effect. More... | |
FLUIDSYNTH_API int | fluid_ladspa_deactivate (fluid_ladspa_fx_t *fx) |
Deactivate a LADSPA fx instance and all configured effects. More... | |
FLUIDSYNTH_API int | fluid_ladspa_reset (fluid_ladspa_fx_t *fx) |
Reset the LADSPA effects engine: Deactivate LADSPA if currently active, remove all effects, remove all user nodes and unload all libraries. More... | |
FLUIDSYNTH_API int | fluid_ladspa_check (fluid_ladspa_fx_t *fx, char *err, int err_size) |
Do a sanity check for problems in the LADSPA setup. More... | |
FLUIDSYNTH_API int | fluid_ladspa_host_port_exists (fluid_ladspa_fx_t *fx, const char *name) |
Check if a named host port exists. More... | |
FLUIDSYNTH_API int | fluid_ladspa_add_buffer (fluid_ladspa_fx_t *fx, const char *name) |
Create and add a new audio buffer. More... | |
FLUIDSYNTH_API int | fluid_ladspa_buffer_exists (fluid_ladspa_fx_t *fx, const char *name) |
Check if a named user buffer exists. More... | |
FLUIDSYNTH_API int | fluid_ladspa_add_effect (fluid_ladspa_fx_t *fx, const char *effect_name, const char *lib_name, const char *plugin_name) |
Create an effect, i.e. More... | |
FLUIDSYNTH_API int | fluid_ladspa_effect_can_mix (fluid_ladspa_fx_t *fx, const char *name) |
Check if the effect plugin supports the run_adding and set_run_adding_gain interfaces necessary for output mixing. More... | |
FLUIDSYNTH_API int | fluid_ladspa_effect_set_mix (fluid_ladspa_fx_t *fx, const char *name, int mix, float gain) |
Set if the effect should replace everything in the output buffers (mix = 0, default) or add to the buffers with a fixed gain (mix = 1). More... | |
FLUIDSYNTH_API int | fluid_ladspa_effect_port_exists (fluid_ladspa_fx_t *fx, const char *effect_name, const char *port_name) |
Check if the named port exists on an effect. More... | |
FLUIDSYNTH_API int | fluid_ladspa_effect_set_control (fluid_ladspa_fx_t *fx, const char *effect_name, const char *port_name, float val) |
Set the value of an effect control port. More... | |
FLUIDSYNTH_API int | fluid_ladspa_effect_link (fluid_ladspa_fx_t *fx, const char *effect_name, const char *port_name, const char *name) |
Connect an effect port to a host port or buffer. More... | |
Functions for manipulating the ladspa effects unit.
This header defines useful functions for programmatically manipulating the ladspa effects unit of the synth that can be retrieved via fluid_synth_get_ladspa_fx().
Using any of those functions requires fluidsynth to be compiled with ladspa support. Else all of those functions are useless dummies.
FLUIDSYNTH_API int fluid_ladspa_is_active | ( | fluid_ladspa_fx_t * | fx | ) |
Check if the LADSPA engine is currently used to render audio.
If an engine is active, the only allowed user actions are deactivation or setting values of control ports on effects. Anything else, especially adding or removing effects, buffers or ports, is only allowed in deactivated state.
fx | LADSPA fx instance |
Referenced by fluid_ladspa_activate(), fluid_ladspa_add_buffer(), fluid_ladspa_add_effect(), fluid_ladspa_effect_link(), and fluid_ladspa_reset().
FLUIDSYNTH_API int fluid_ladspa_activate | ( | fluid_ladspa_fx_t * | fx | ) |
Activate the LADSPA fx instance and each configured effect.
fx | LADSPA fx instance |
References FLUID_ERR, FLUID_FAILED, fluid_ladspa_check(), fluid_ladspa_is_active(), and FLUID_OK.
FLUIDSYNTH_API int fluid_ladspa_deactivate | ( | fluid_ladspa_fx_t * | fx | ) |
Deactivate a LADSPA fx instance and all configured effects.
fx | LADSPA fx instance |
References FLUID_FAILED, and FLUID_OK.
Referenced by fluid_ladspa_reset().
FLUIDSYNTH_API int fluid_ladspa_reset | ( | fluid_ladspa_fx_t * | fx | ) |
Reset the LADSPA effects engine: Deactivate LADSPA if currently active, remove all effects, remove all user nodes and unload all libraries.
fx | LADSPA fx instance |
References FLUID_FAILED, fluid_ladspa_deactivate(), fluid_ladspa_is_active(), and FLUID_OK.
FLUIDSYNTH_API int fluid_ladspa_check | ( | fluid_ladspa_fx_t * | fx, |
char * | err, | ||
int | err_size | ||
) |
Do a sanity check for problems in the LADSPA setup.
If the check detects problems and the err pointer is not NULL, a description of the first found problem is written to that string (up to err_size - 1 characters).
fx | LADSPA fx instance |
err | externally provided buffer for the error message. Set to NULL if you don't need an error message. |
err_size | size of the err buffer |
References FLUID_FAILED, and FLUID_OK.
Referenced by fluid_ladspa_activate().
FLUIDSYNTH_API int fluid_ladspa_host_port_exists | ( | fluid_ladspa_fx_t * | fx, |
const char * | name | ||
) |
Check if a named host port exists.
fx | LADSPA fx instance |
name | the port name |
FLUIDSYNTH_API int fluid_ladspa_add_buffer | ( | fluid_ladspa_fx_t * | fx, |
const char * | name | ||
) |
Create and add a new audio buffer.
fx | LADSPA effects instance |
name | name of the new buffer |
References FLUID_FAILED, fluid_ladspa_is_active(), and FLUID_OK.
FLUIDSYNTH_API int fluid_ladspa_buffer_exists | ( | fluid_ladspa_fx_t * | fx, |
const char * | name | ||
) |
Check if a named user buffer exists.
fx | LADSPA fx instance |
name | the buffer name |
FLUIDSYNTH_API int fluid_ladspa_add_effect | ( | fluid_ladspa_fx_t * | fx, |
const char * | effect_name, | ||
const char * | lib_name, | ||
const char * | plugin_name | ||
) |
Create an effect, i.e.
an instance of a LADSPA plugin
fx | LADSPA effects instance |
effect_name | name of the effect |
lib_name | filename of ladspa plugin library |
plugin_name | optional, plugin name if there is more than one plugin in the library |
References FLUID_ERR, FLUID_FAILED, fluid_ladspa_is_active(), and FLUID_OK.
FLUIDSYNTH_API int fluid_ladspa_effect_can_mix | ( | fluid_ladspa_fx_t * | fx, |
const char * | name | ||
) |
Check if the effect plugin supports the run_adding and set_run_adding_gain interfaces necessary for output mixing.
fx | LADSPA fx |
name | the name of the effect |
Referenced by fluid_ladspa_effect_set_mix().
FLUIDSYNTH_API int fluid_ladspa_effect_set_mix | ( | fluid_ladspa_fx_t * | fx, |
const char * | name, | ||
int | mix, | ||
float | gain | ||
) |
Set if the effect should replace everything in the output buffers (mix = 0, default) or add to the buffers with a fixed gain (mix = 1).
fx | LADSPA fx instance |
name | the name of the effect |
mix | (boolean) if to enable mix mode |
gain | the gain to apply to the effect output before adding to output. |
References FLUID_ERR, FLUID_FAILED, fluid_ladspa_effect_can_mix(), and FLUID_OK.
FLUIDSYNTH_API int fluid_ladspa_effect_port_exists | ( | fluid_ladspa_fx_t * | fx, |
const char * | effect_name, | ||
const char * | port_name | ||
) |
Check if the named port exists on an effect.
fx | LADSPA fx instance |
effect_name | name of the effect |
port_name | the port name |
FLUIDSYNTH_API int fluid_ladspa_effect_set_control | ( | fluid_ladspa_fx_t * | fx, |
const char * | effect_name, | ||
const char * | port_name, | ||
float | val | ||
) |
Set the value of an effect control port.
fx | LADSPA fx instance |
effect_name | name of the effect |
port_name | name of the port |
val | floating point value |
References FLUID_FAILED, and FLUID_OK.
FLUIDSYNTH_API int fluid_ladspa_effect_link | ( | fluid_ladspa_fx_t * | fx, |
const char * | effect_name, | ||
const char * | port_name, | ||
const char * | name | ||
) |
Connect an effect port to a host port or buffer.
fx | LADSPA effects instance |
effect_name | name of the effect |
port_name | the port name to connect to (case-insensitive prefix match) |
name | the host port or buffer to connect to (case-insensitive) |
References FLUID_ERR, FLUID_FAILED, fluid_ladspa_is_active(), and FLUID_OK.