From 721f4eaf250120452f1a4c0658b960b43634f503 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 30 Jan 2020 16:54:30 -0500 Subject: [PATCH] VST3 CC controls still subtle; fix for Live (#1536) the VST3 CC controls send a specious first beginEdit which maps to a negative ID which Reaper is immune to but which confuses Live and which we should supress anyway, so here we do. Addresses #1531 --- src/vst3/SurgeVst3Processor.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/vst3/SurgeVst3Processor.cpp b/src/vst3/SurgeVst3Processor.cpp index 865846ba42a..20596b99a97 100644 --- a/src/vst3/SurgeVst3Processor.cpp +++ b/src/vst3/SurgeVst3Processor.cpp @@ -33,7 +33,8 @@ using namespace Steinberg::Vst; } SurgeVst3Processor::SurgeVst3Processor() : blockpos(0), surgeInstance() -{} +{ +} SurgeVst3Processor::~SurgeVst3Processor() { @@ -531,7 +532,7 @@ tresult SurgeVst3Processor::beginEdit(ParamID id) { mappedId = id; } - else if (id >= getParameterCount()) + else if (id >= getParameterCount() || mappedId < 0 ) { return kInvalidArgument; } @@ -543,6 +544,7 @@ tresult SurgeVst3Processor::beginEdit(ParamID id) if( beginEditGuard[id] == 1 ) { + // std::cout << "BeginEdit " << mappedId << std::endl; return Steinberg::Vst::SingleComponentEffect::beginEdit(mappedId); } else @@ -560,7 +562,7 @@ tresult SurgeVst3Processor::performEdit(ParamID id, Steinberg::Vst::ParamValue v { mappedId = id; } - else if (id >= getParameterCount()) + else if (id >= getParameterCount() || mappedId < 0 ) { return kInvalidArgument; } @@ -569,6 +571,8 @@ tresult SurgeVst3Processor::performEdit(ParamID id, Steinberg::Vst::ParamValue v return kResultOk; } + // std::cout << "PerformEdit " << mappedId << std::endl; + return Steinberg::Vst::SingleComponentEffect::performEdit(mappedId, valueNormalized); } @@ -581,7 +585,7 @@ tresult SurgeVst3Processor::endEdit(ParamID id) { mappedId = id; } - else if (id >= getParameterCount()) + else if (id >= getParameterCount() && mappedId < 0 ) { return kInvalidArgument; } @@ -605,6 +609,7 @@ tresult SurgeVst3Processor::endEdit(ParamID id) if( endcount == 0 ) { + // std::cout << "EndEdit " << mappedId << std::endl; return Steinberg::Vst::SingleComponentEffect::endEdit(mappedId); } else