commit 94428d3603e155761787cf5b74cf3fdc4b65c6dd
parent 50ba9251fedc4bc98d77bc7530f62081b7058edf
Author: falkTX <falktx@falktx.com>
Date: Tue, 6 Sep 2022 16:10:52 +0100
Make sure to tell plugin about CLAP UI param changes
Diffstat:
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/Makefile.plugins.mk b/Makefile.plugins.mk
@@ -544,6 +544,12 @@ endif
# ---------------------------------------------------------------------------------------------------------------------
# CLAP
+ifeq ($(HAIKU_OR_MACOS_OR_WASM_OR_WINDOWS),true)
+ifeq ($(HAVE_DGL),true)
+CLAP_LIBS = -lpthread
+endif
+endif
+
clap: $(clap) $(clapfiles)
ifeq ($(HAVE_DGL),true)
@@ -553,7 +559,7 @@ $(clap): $(OBJS_DSP) $(BUILD_DIR)/DistrhoPluginMain_CLAP.cpp.o
endif
-@mkdir -p $(shell dirname $@)
@echo "Creating CLAP plugin for $(NAME)"
- $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(EXTRA_LIBS) $(DGL_LIBS) $(SHARED) $(SYMBOLS_CLAP) -o $@
+ $(SILENT)$(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) $(EXTRA_LIBS) $(DGL_LIBS) $(CLAP_LIBS) $(SHARED) $(SYMBOLS_CLAP) -o $@
# ---------------------------------------------------------------------------------------------------------------------
# Shared
diff --git a/distrho/src/DistrhoPluginCLAP.cpp b/distrho/src/DistrhoPluginCLAP.cpp
@@ -45,6 +45,7 @@ struct ClapEventQueue
struct Event {
EventType type;
uint32_t index;
+ float plain;
double value;
};
@@ -346,7 +347,7 @@ private:
{
const ClapEventQueue::Event ev = {
started ? ClapEventQueue::kEventGestureBegin : ClapEventQueue::kEventGestureBegin,
- rindex, 0.0
+ rindex, 0.f, 0.0
};
fEventQueue.addEventFromUI(ev);
}
@@ -366,7 +367,7 @@ private:
const ClapEventQueue::Event ev = {
ClapEventQueue::kEventParamSet,
- rindex, value
+ rindex, plain, value
};
fEventQueue.addEventFromUI(ev);
}
@@ -513,6 +514,7 @@ public:
clapEvent.header.type = CLAP_EVENT_PARAM_VALUE;
clapEvent.param_id = event.index;
clapEvent.value = event.value;
+ fPlugin.setParameterValue(event.index, event.plain);
break;
default:
continue;