mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-12 01:26:31 +01:00
re-map lv2-port (symbol) with Controllable ID
LV2 plugin port indices can change, so we need to save the symbol name with the controllable and look up the port-index on load.
This commit is contained in:
parent
9e3299f97d
commit
1e5bcc4f76
1 changed files with 20 additions and 2 deletions
|
|
@ -976,8 +976,20 @@ PluginInsert::set_control_ids (const XMLNode& node, int version)
|
||||||
if ((*iter)->name() == Controllable::xml_node_name) {
|
if ((*iter)->name() == Controllable::xml_node_name) {
|
||||||
const XMLProperty* prop;
|
const XMLProperty* prop;
|
||||||
|
|
||||||
if ((prop = (*iter)->property (X_("parameter"))) != 0) {
|
uint32_t p = (uint32_t)-1;
|
||||||
uint32_t p = atoi (prop->value());
|
#ifdef LV2_SUPPORT
|
||||||
|
if ((prop = (*iter)->property (X_("symbol"))) != 0) {
|
||||||
|
boost::shared_ptr<LV2Plugin> lv2plugin = boost::dynamic_pointer_cast<LV2Plugin> (_plugins[0]);
|
||||||
|
if (lv2plugin) {
|
||||||
|
p = lv2plugin->port_index(prop->value().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (p == (uint32_t)-1 && (prop = (*iter)->property (X_("parameter"))) != 0) {
|
||||||
|
p = atoi (prop->value());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (p != (uint32_t)-1) {
|
||||||
|
|
||||||
/* this may create the new controllable */
|
/* this may create the new controllable */
|
||||||
|
|
||||||
|
|
@ -1375,6 +1387,12 @@ PluginInsert::PluginControl::get_state ()
|
||||||
XMLNode& node (AutomationControl::get_state());
|
XMLNode& node (AutomationControl::get_state());
|
||||||
ss << parameter().id();
|
ss << parameter().id();
|
||||||
node.add_property (X_("parameter"), ss.str());
|
node.add_property (X_("parameter"), ss.str());
|
||||||
|
#ifdef LV2_SUPPORT
|
||||||
|
boost::shared_ptr<LV2Plugin> lv2plugin = boost::dynamic_pointer_cast<LV2Plugin> (_plugin->_plugins[0]);
|
||||||
|
if (lv2plugin) {
|
||||||
|
node.add_property (X_("symbol"), lv2plugin->port_symbol (parameter().id()));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue