@@ -701,6 +701,53 @@ public: | |||
case kEngineControlEventTypeParameter: | |||
{ | |||
// Control backend stuff | |||
if (event.channel == kData->ctrlChannel) | |||
{ | |||
float value; | |||
if (MIDI_IS_CONTROL_BREATH_CONTROLLER(ctrlEvent.param) && (fHints & PLUGIN_CAN_DRYWET) > 0) | |||
{ | |||
value = ctrlEvent.value; | |||
setDryWet(value, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_DRYWET, 0, value); | |||
} | |||
if (MIDI_IS_CONTROL_CHANNEL_VOLUME(ctrlEvent.param) && (fHints & PLUGIN_CAN_VOLUME) > 0) | |||
{ | |||
value = ctrlEvent.value*127.0f/100.0f; | |||
setVolume(value, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_VOLUME, 0, value); | |||
} | |||
if (MIDI_IS_CONTROL_BALANCE(ctrlEvent.param) && (fHints & PLUGIN_CAN_BALANCE) > 0) | |||
{ | |||
float left, right; | |||
value = ctrlEvent.value/0.5f - 1.0f; | |||
if (value < 0.0f) | |||
{ | |||
left = -1.0f; | |||
right = (value*2.0f)+1.0f; | |||
} | |||
else if (value > 0.0f) | |||
{ | |||
left = (value*2.0f)-1.0f; | |||
right = 1.0f; | |||
} | |||
else | |||
{ | |||
left = -1.0f; | |||
right = 1.0f; | |||
} | |||
setBalanceLeft(left, false, false); | |||
setBalanceRight(right, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_BALANCE_LEFT, 0, left); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_BALANCE_RIGHT, 0, right); | |||
} | |||
} | |||
// Control plugin parameters | |||
for (k=0; k < kData->param.count; ++k) | |||
{ | |||
@@ -1128,7 +1128,6 @@ public: | |||
value = ctrlEvent.value; | |||
setDryWet(value, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_DRYWET, 0, value); | |||
continue; | |||
} | |||
if (MIDI_IS_CONTROL_CHANNEL_VOLUME(ctrlEvent.param) && (fHints & PLUGIN_CAN_VOLUME) > 0) | |||
@@ -1136,7 +1135,6 @@ public: | |||
value = ctrlEvent.value*127.0f/100.0f; | |||
setVolume(value, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_VOLUME, 0, value); | |||
continue; | |||
} | |||
if (MIDI_IS_CONTROL_BALANCE(ctrlEvent.param) && (fHints & PLUGIN_CAN_BALANCE) > 0) | |||
@@ -1164,7 +1162,6 @@ public: | |||
setBalanceRight(right, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_BALANCE_LEFT, 0, left); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_BALANCE_RIGHT, 0, right); | |||
continue; | |||
} | |||
} | |||
#endif | |||
@@ -1198,6 +1195,7 @@ public: | |||
setParameterValue(k, value, false, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, static_cast<int32_t>(k), 0, value); | |||
} | |||
break; | |||
} | |||
@@ -1122,7 +1122,6 @@ public: | |||
value = ctrlEvent.value; | |||
setDryWet(value, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_DRYWET, 0, value); | |||
continue; | |||
} | |||
if (MIDI_IS_CONTROL_CHANNEL_VOLUME(ctrlEvent.param) && (fHints & PLUGIN_CAN_VOLUME) > 0) | |||
@@ -1130,7 +1129,6 @@ public: | |||
value = ctrlEvent.value*127.0f/100.0f; | |||
setVolume(value, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_VOLUME, 0, value); | |||
continue; | |||
} | |||
if (MIDI_IS_CONTROL_BALANCE(ctrlEvent.param) && (fHints & PLUGIN_CAN_BALANCE) > 0) | |||
@@ -1158,7 +1156,6 @@ public: | |||
setBalanceRight(right, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_BALANCE_LEFT, 0, left); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_BALANCE_RIGHT, 0, right); | |||
continue; | |||
} | |||
} | |||
#endif | |||
@@ -934,7 +934,6 @@ public: | |||
value = ctrlEvent.value; | |||
setDryWet(value, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_DRYWET, 0, value); | |||
continue; | |||
} | |||
if (MIDI_IS_CONTROL_CHANNEL_VOLUME(ctrlEvent.param) && (fHints & PLUGIN_CAN_VOLUME) > 0) | |||
@@ -942,7 +941,6 @@ public: | |||
value = ctrlEvent.value*127.0f/100.0f; | |||
setVolume(value, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_VOLUME, 0, value); | |||
continue; | |||
} | |||
if (MIDI_IS_CONTROL_BALANCE(ctrlEvent.param) && (fHints & PLUGIN_CAN_BALANCE) > 0) | |||
@@ -970,7 +968,6 @@ public: | |||
setBalanceRight(right, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_BALANCE_LEFT, 0, left); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_BALANCE_RIGHT, 0, right); | |||
continue; | |||
} | |||
} | |||
#endif | |||
@@ -626,50 +626,47 @@ public: | |||
// Control backend stuff | |||
if (event.channel == kData->ctrlChannel) | |||
{ | |||
double value; | |||
float value; | |||
if (MIDI_IS_CONTROL_BREATH_CONTROLLER(ctrlEvent.param) && (fHints & PLUGIN_CAN_DRYWET) > 0) | |||
{ | |||
value = ctrlEvent.value; | |||
setDryWet(value, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_DRYWET, 0, value); | |||
continue; | |||
} | |||
if (MIDI_IS_CONTROL_CHANNEL_VOLUME(ctrlEvent.param) && (fHints & PLUGIN_CAN_VOLUME) > 0) | |||
{ | |||
value = ctrlEvent.value*127/100; | |||
value = ctrlEvent.value*127.0f/100.0f; | |||
setVolume(value, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_VOLUME, 0, value); | |||
continue; | |||
} | |||
if (MIDI_IS_CONTROL_BALANCE(ctrlEvent.param) && (fHints & PLUGIN_CAN_BALANCE) > 0) | |||
{ | |||
double left, right; | |||
value = ctrlEvent.value/0.5 - 1.0; | |||
float left, right; | |||
value = ctrlEvent.value/0.5f - 1.0f; | |||
if (value < 0.0) | |||
if (value < 0.0f) | |||
{ | |||
left = -1.0; | |||
right = (value*2)+1.0; | |||
left = -1.0f; | |||
right = (value*2.0f)+1.0f; | |||
} | |||
else if (value > 0.0) | |||
else if (value > 0.0f) | |||
{ | |||
left = (value*2)-1.0; | |||
right = 1.0; | |||
left = (value*2.0f)-1.0f; | |||
right = 1.0f; | |||
} | |||
else | |||
{ | |||
left = -1.0; | |||
right = 1.0; | |||
left = -1.0f; | |||
right = 1.0f; | |||
} | |||
setBalanceLeft(left, false, false); | |||
setBalanceRight(right, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_BALANCE_LEFT, 0, left); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_BALANCE_RIGHT, 0, right); | |||
continue; | |||
} | |||
} | |||
#endif | |||
@@ -20,7 +20,7 @@ | |||
#ifdef WANT_LV2 | |||
#include "CarlaPluginGui.hpp" | |||
#include "CarlaEngineOsc.hpp" | |||
#include "../engine/CarlaEngineOsc.hpp" | |||
#include "CarlaLv2Utils.hpp" | |||
#include "Lv2AtomQueue.hpp" | |||
@@ -2697,7 +2697,6 @@ public: | |||
value = ctrlEvent.value; | |||
setDryWet(value, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_DRYWET, 0, value); | |||
continue; | |||
} | |||
if (MIDI_IS_CONTROL_CHANNEL_VOLUME(ctrlEvent.param) && (fHints & PLUGIN_CAN_VOLUME) > 0) | |||
@@ -2705,7 +2704,6 @@ public: | |||
value = ctrlEvent.value*127.0f/100.0f; | |||
setVolume(value, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_VOLUME, 0, value); | |||
continue; | |||
} | |||
if (MIDI_IS_CONTROL_BALANCE(ctrlEvent.param) && (fHints & PLUGIN_CAN_BALANCE) > 0) | |||
@@ -2733,7 +2731,6 @@ public: | |||
setBalanceRight(right, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_BALANCE_LEFT, 0, left); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_BALANCE_RIGHT, 0, right); | |||
continue; | |||
} | |||
} | |||
#endif | |||
@@ -8,7 +8,7 @@ include ../Makefile.mk | |||
# -------------------------------------------------------------- | |||
BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo) -I../engine | |||
BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo) | |||
ifeq ($(HAVE_QT5),true) | |||
BUILD_CXX_FLAGS += $(shell pkg-config --cflags Qt5Core Qt5Xml Qt5Widgets) | |||
@@ -1430,7 +1430,6 @@ public: | |||
value = ctrlEvent.value; | |||
setDryWet(value, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_DRYWET, 0, value); | |||
continue; | |||
} | |||
if (MIDI_IS_CONTROL_CHANNEL_VOLUME(ctrlEvent.param) && (fHints & PLUGIN_CAN_VOLUME) > 0) | |||
@@ -1438,7 +1437,6 @@ public: | |||
value = ctrlEvent.value*127.0f/100.0f; | |||
setVolume(value, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_VOLUME, 0, value); | |||
continue; | |||
} | |||
if (MIDI_IS_CONTROL_BALANCE(ctrlEvent.param) && (fHints & PLUGIN_CAN_BALANCE) > 0) | |||
@@ -1466,7 +1464,6 @@ public: | |||
setBalanceRight(right, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_BALANCE_LEFT, 0, left); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_BALANCE_RIGHT, 0, right); | |||
continue; | |||
} | |||
} | |||
#endif | |||
@@ -1211,7 +1211,6 @@ public: | |||
value = ctrlEvent.value; | |||
setDryWet(value, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_DRYWET, 0, value); | |||
continue; | |||
} | |||
if (MIDI_IS_CONTROL_CHANNEL_VOLUME(ctrlEvent.param) && (fHints & PLUGIN_CAN_VOLUME) > 0) | |||
@@ -1219,7 +1218,6 @@ public: | |||
value = ctrlEvent.value*127.0f/100.0f; | |||
setVolume(value, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_VOLUME, 0, value); | |||
continue; | |||
} | |||
if (MIDI_IS_CONTROL_BALANCE(ctrlEvent.param) && (fHints & PLUGIN_CAN_BALANCE) > 0) | |||
@@ -1247,7 +1245,6 @@ public: | |||
setBalanceRight(right, false, false); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_BALANCE_LEFT, 0, left); | |||
postponeRtEvent(kPluginPostRtEventParameterChange, PARAMETER_BALANCE_RIGHT, 0, right); | |||
continue; | |||
} | |||
} | |||
#endif | |||