diff --git a/Makefile.plugins.mk b/Makefile.plugins.mk index 1cb0d1d8..2a3fbb6a 100644 --- a/Makefile.plugins.mk +++ b/Makefile.plugins.mk @@ -452,7 +452,7 @@ SYMBOLS_LADSPA = -sEXPORTED_FUNCTIONS="['ladspa_descriptor']" SYMBOLS_LV2 = -sEXPORTED_FUNCTIONS="['lv2_descriptor','lv2_generate_ttl','lv2ui_descriptor']" SYMBOLS_LV2DSP = -sEXPORTED_FUNCTIONS="['lv2_descriptor','lv2_generate_ttl']" SYMBOLS_LV2UI = -sEXPORTED_FUNCTIONS="['lv2ui_descriptor']" -SYMBOLS_MAPI = -sEXPORTED_FUNCTIONS="['_malloc','_free','_mapi_create','_mapi_process','_mapi_set_parameter','_mapi_set_state','_mapi_destroy']" +SYMBOLS_MAPI = -sEXPORTED_FUNCTIONS="['_malloc','_free','_mapi_create','_mapi_process','_mapi_get_parameter','_mapi_set_parameter','_mapi_set_state','_mapi_destroy']" SYMBOLS_VST2 = -sEXPORTED_FUNCTIONS="['VSTPluginMain']" SYMBOLS_VST3 = -sEXPORTED_FUNCTIONS="['GetPluginFactory','ModuleEntry','ModuleExit']" else ifeq ($(WINDOWS),true) diff --git a/distrho/src/DistrhoPluginMAPI.cpp b/distrho/src/DistrhoPluginMAPI.cpp index 9de50881..e1defb25 100644 --- a/distrho/src/DistrhoPluginMAPI.cpp +++ b/distrho/src/DistrhoPluginMAPI.cpp @@ -64,6 +64,11 @@ public: updateParameterOutputsAndTriggers(); } + float getParameter(unsigned int index) const + { + return fPlugin.getParameterValue(index); + } + void setParameter(unsigned int index, float value) { fPlugin.setParameterValue(index, fPlugin.getParameterRanges(index).getFixedValue(value)); @@ -135,6 +140,12 @@ void mapi_process(mapi_handle_t handle, static_cast(handle)->process(ins, outs, frames); } +MAPI_EXPORT +float mapi_get_parameter(mapi_handle_t handle, unsigned int index) +{ + return static_cast(handle)->getParameter(index); +} + MAPI_EXPORT void mapi_set_parameter(mapi_handle_t handle, unsigned int index, float value) { diff --git a/distrho/src/mapi/mapi.h b/distrho/src/mapi/mapi.h index 88c3aa80..4bb8af54 100644 --- a/distrho/src/mapi/mapi.h +++ b/distrho/src/mapi/mapi.h @@ -43,6 +43,15 @@ void mapi_process(mapi_handle_t handle, float** outs, unsigned int frames); +/** + Get an effect parameter. + @param handle A previously created effect. + @param index A known index for this effect. + @return value A full-ranged value. +*/ +MAPI_EXPORT +float mapi_get_parameter(mapi_handle_t handle, unsigned int index); + /** Set an effect parameter. @param handle A previously created effect.