1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

VST3 Host: Fix bug where MIDI CCs mapped to parameters would fail to update the host and editcontroller

This commit is contained in:
reuk 2024-11-25 16:45:01 +00:00
parent dfe4858e55
commit 3186522b0b
No known key found for this signature in database
2 changed files with 17 additions and 3 deletions

View file

@ -1430,7 +1430,7 @@ private:
controlEvent->controllerNumber);
if (controlParamID != Steinberg::Vst::kNoParamId)
callback (controlParamID, controlEvent->paramValue, msg.getTimeStamp());
callback (controlParamID, (float) controlEvent->paramValue, msg.getTimeStamp());
return true;
}

View file

@ -2593,6 +2593,11 @@ public:
return cachedInfo;
}
Steinberg::int32 getVstParamIndex() const
{
return vstParamIndex;
}
private:
Vst::ParameterInfo fetchParameterInfo() const
{
@ -3770,12 +3775,21 @@ private:
if (acceptsMidi())
{
const auto midiMessageCallback = [&] (auto controlID, auto paramValue, auto time)
const auto midiMessageCallback = [&] (auto controlID, float paramValue, auto time)
{
Steinberg::int32 queueIndex{};
if (auto* queue = inputParameterChanges->addParameterData (controlID, queueIndex))
queue->append ({ (Steinberg::int32) time, (float) paramValue });
queue->append ({ (Steinberg::int32) time, paramValue });
if (auto* param = getParameterForID (controlID))
{
// Send the parameter value to the editor
parameterDispatcher.push (param->getVstParamIndex(), paramValue);
// Update the host's view of the parameter value
param->setValueWithoutUpdatingProcessor (paramValue);
}
};
MidiEventList::hostToPluginEventList (*midiInputs,