Skip to content

Commit dbf5ce3

Browse files
committed
Update MAPI to add mapi_get_parameter
Signed-off-by: falkTX <[email protected]>
1 parent 101141e commit dbf5ce3

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

Makefile.plugins.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ SYMBOLS_LADSPA = -sEXPORTED_FUNCTIONS="['ladspa_descriptor']"
452452
SYMBOLS_LV2 = -sEXPORTED_FUNCTIONS="['lv2_descriptor','lv2_generate_ttl','lv2ui_descriptor']"
453453
SYMBOLS_LV2DSP = -sEXPORTED_FUNCTIONS="['lv2_descriptor','lv2_generate_ttl']"
454454
SYMBOLS_LV2UI = -sEXPORTED_FUNCTIONS="['lv2ui_descriptor']"
455-
SYMBOLS_MAPI = -sEXPORTED_FUNCTIONS="['_malloc','_free','_mapi_create','_mapi_process','_mapi_set_parameter','_mapi_set_state','_mapi_destroy']"
455+
SYMBOLS_MAPI = -sEXPORTED_FUNCTIONS="['_malloc','_free','_mapi_create','_mapi_process','_mapi_get_parameter','_mapi_set_parameter','_mapi_set_state','_mapi_destroy']"
456456
SYMBOLS_VST2 = -sEXPORTED_FUNCTIONS="['VSTPluginMain']"
457457
SYMBOLS_VST3 = -sEXPORTED_FUNCTIONS="['GetPluginFactory','ModuleEntry','ModuleExit']"
458458
else ifeq ($(WINDOWS),true)

distrho/src/DistrhoPluginMAPI.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ class PluginMAPI
6464
updateParameterOutputsAndTriggers();
6565
}
6666

67+
float getParameter(unsigned int index) const
68+
{
69+
return fPlugin.getParameterValue(index);
70+
}
71+
6772
void setParameter(unsigned int index, float value)
6873
{
6974
fPlugin.setParameterValue(index, fPlugin.getParameterRanges(index).getFixedValue(value));
@@ -135,6 +140,12 @@ void mapi_process(mapi_handle_t handle,
135140
static_cast<PluginMAPI*>(handle)->process(ins, outs, frames);
136141
}
137142

143+
MAPI_EXPORT
144+
float mapi_get_parameter(mapi_handle_t handle, unsigned int index)
145+
{
146+
return static_cast<PluginMAPI*>(handle)->getParameter(index);
147+
}
148+
138149
MAPI_EXPORT
139150
void mapi_set_parameter(mapi_handle_t handle, unsigned int index, float value)
140151
{

distrho/src/mapi/mapi.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ void mapi_process(mapi_handle_t handle,
4343
float** outs,
4444
unsigned int frames);
4545

46+
/**
47+
Get an effect parameter.
48+
@param handle A previously created effect.
49+
@param index A known index for this effect.
50+
@return value A full-ranged value.
51+
*/
52+
MAPI_EXPORT
53+
float mapi_get_parameter(mapi_handle_t handle, unsigned int index);
54+
4655
/**
4756
Set an effect parameter.
4857
@param handle A previously created effect.

0 commit comments

Comments
 (0)