MCPcopy Create free account
hub / github.com/DISTRHO/DPF / updateParametersFromProcessing

Function updateParametersFromProcessing

distrho/src/DistrhoPluginVST3.cpp:2881–2955  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2879 // helper functions called during process, cannot block
2880
2881 void updateParametersFromProcessing(v3_param_changes** const outparamsptr, const int32_t offset)
2882 {
2883 DISTRHO_SAFE_ASSERT_RETURN(outparamsptr != nullptr,);
2884
2885 float curValue, defValue;
2886 double normalized;
2887
2888 #if DPF_VST3_USES_SEPARATE_CONTROLLER
2889 for (v3_param_id i=kVst3InternalParameterBufferSize; i<=kVst3InternalParameterSampleRate; ++i)
2890 {
2891 if (! fParameterValuesChangedDuringProcessing[i])
2892 continue;
2893
2894 normalized = plainParameterToNormalized(i, fCachedParameterValues[i]);
2895 fParameterValuesChangedDuringProcessing[i] = false;
2896 addParameterDataToHostOutputEvents(outparamsptr, i, normalized);
2897 }
2898 #endif
2899
2900 for (uint32_t i=0; i<fParameterCount; ++i)
2901 {
2902 if (fPlugin.isParameterOutput(i))
2903 {
2904 // NOTE: no output parameter support in VST3, simulate it here
2905 curValue = fPlugin.getParameterValue(i);
2906
2907 if (d_isEqual(curValue, fCachedParameterValues[kVst3InternalParameterBaseCount + i]))
2908 continue;
2909 }
2910 else if (fPlugin.isParameterTrigger(i))
2911 {
2912 // NOTE: no trigger parameter support in VST3, simulate it here
2913 defValue = fPlugin.getParameterDefault(i);
2914 curValue = fPlugin.getParameterValue(i);
2915
2916 if (d_isEqual(curValue, defValue))
2917 continue;
2918
2919 curValue = defValue;
2920 fPlugin.setParameterValue(i, curValue);
2921 }
2922 else if (fParameterValuesChangedDuringProcessing[kVst3InternalParameterBaseCount + i])
2923 {
2924 fParameterValuesChangedDuringProcessing[kVst3InternalParameterBaseCount + i] = false;
2925 curValue = fPlugin.getParameterValue(i);
2926 }
2927 else
2928 {
2929 continue;
2930 }
2931
2932 fCachedParameterValues[kVst3InternalParameterBaseCount + i] = curValue;
2933 #if DISTRHO_PLUGIN_HAS_UI
2934 fParameterValueChangesForUI[kVst3InternalParameterBaseCount + i] = true;
2935 #endif
2936
2937 normalized = _getNormalizedParameterValue(i, curValue);
2938

Callers 1

processFunction · 0.85

Calls 7

d_isEqualFunction · 0.85
getLatencyMethod · 0.80
getParameterValueMethod · 0.45
setParameterValueMethod · 0.45

Tested by

no test coverage detected