mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
VST3 Host: Send parameter changes to IEditController, even when process is not being called
Previously, all parameter changes were routed first into cachedParamValues. Then, on each audio callback, an update would be sent to the editor via the parameterDispatcher for each changed value in cachedParamValues. Now, parameter changes are immediately added to the parameterDispatcher, without needing to wait for an audio callback.
This commit is contained in:
parent
079c69aee7
commit
210ed82ca2
2 changed files with 3 additions and 7 deletions
|
|
@ -1261,7 +1261,7 @@ private:
|
|||
|
||||
const auto controlEvent = toVst3ControlEvent (msg);
|
||||
|
||||
if (! controlEvent.hasValue())
|
||||
if (! controlEvent.has_value())
|
||||
return false;
|
||||
|
||||
const auto controlParamID = midiMapping->getMapping (createSafeChannel (msg.getChannel()),
|
||||
|
|
@ -1561,7 +1561,7 @@ private:
|
|||
Steinberg::Vst::ParamValue paramValue;
|
||||
};
|
||||
|
||||
static Optional<Vst3MidiControlEvent> toVst3ControlEvent (const MidiMessage& msg)
|
||||
static std::optional<Vst3MidiControlEvent> toVst3ControlEvent (const MidiMessage& msg)
|
||||
{
|
||||
if (msg.isController())
|
||||
return Vst3MidiControlEvent { (Steinberg::Vst::CtrlNumber) msg.getControllerNumber(), msg.getControllerValue() / 127.0 };
|
||||
|
|
|
|||
|
|
@ -2211,6 +2211,7 @@ public:
|
|||
void setValue (float newValue) override
|
||||
{
|
||||
pluginInstance.cachedParamValues.set (vstParamIndex, newValue);
|
||||
pluginInstance.parameterDispatcher.push (vstParamIndex, newValue);
|
||||
}
|
||||
|
||||
/* If we're syncing the editor to the processor, the processor won't need to
|
||||
|
|
@ -2680,11 +2681,6 @@ public:
|
|||
inputParameterChanges->set (cachedParamValues.getParamID (index), value);
|
||||
});
|
||||
|
||||
inputParameterChanges->forEach ([&] (Steinberg::int32 index, float value)
|
||||
{
|
||||
parameterDispatcher.push (index, value);
|
||||
});
|
||||
|
||||
processor->process (data);
|
||||
|
||||
outputParameterChanges->forEach ([&] (Steinberg::int32 index, float value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue