Closed zonkmachine closed 12 months ago
In #6419 we implemented this code:
void Lv2Proc::reload()
{
// save controls, which we want to keep
QDomDocument doc;
QDomElement controls = doc.createElement("controls");
saveValues(doc, controls);
// backup construction variables
const LilvPlugin* plugin = m_plugin;
Model* parent = Model::parentModel();
// destroy everything using RAII ...
this->~Lv2Proc();
// ... and reuse it ("placement new")
new (this) Lv2Proc(plugin, parent);
// reload the controls
loadValues(controls);
}
As can be seen, the whole Lv2 processor is being destroyed and re-inited, but before, we save the values of all the models (knobs, spinboxes, LEDs etc). However, the connections themselves are not saved - they are in the automation clips or controllers, which reference the corresponding models by ID. On reloading the knobs (AutomatableModel::loadSettings
), the models should get the same IDs as before (changeID( nodeElement.attribute( "id" ).toInt() );
). However, when reloading, the "object" reference in the automation clip to those models gets deleted, too:
<automationclip pos="0" len="384" mute="0" tens="1" name="Cutoff" prog="1">
<time pos="0" outValue="1449.762" value="1449.762"/>
<time pos="192" outValue="7568.4004" value="7568.4004"/>
<time pos="384" outValue="15136.801" value="15136.801"/>
<object id="7357890"/>
</automationclip>
Here, <object id="7357890"/>
gets lost in the reloading process. We need to find out why...
Info: Still present with Lv2 Worker PR.
Bug Summary
Lv2 instruments looses control from Automation Track on export.
Steps to reproduce
Connect an LV2 plugin control to an Automation Track and make a distinct pattern. Make sure it works under lmms live with a distinct change in sound. Export it. The exported project sees no variation in the controller.
Here is a demo project using DISTRHO/DPF-Plugins Kars, automating the Release. lv2automationexport.mmp.zip
Issue introduced in f48dd0fb1f424e06cd7bff1cb3d4c37f5d9a11a7
Fixes #6401: Reload Lv2 plugin on SR change
@JohannesLorenz