commits 6001-6525 inclusive from 2.X applied to 3.0
[ardour.git] / libs / ardour / lv2_plugin.cc
index faaf41fd357de4734b8786a17cf8f24df8508d94..9ba453345616b62275222654f2b93ed03efad9bf 100644 (file)
@@ -352,7 +352,7 @@ LV2Plugin::has_editor() const
 }
 
 int
-LV2Plugin::set_state(const XMLNode& node, int /*version*/)
+LV2Plugin::set_state(const XMLNode& node, int version)
 {
        XMLNodeList nodes;
        XMLProperty *prop;
@@ -368,8 +368,12 @@ LV2Plugin::set_state(const XMLNode& node, int /*version*/)
                return -1;
        }
 
-       nodes = node.children ("Port");
-
+       if (version < 3000){
+               nodes = node.children ("port");
+       } else {
+               nodes = node.children ("Port");
+       }
+       
        for (iter = nodes.begin(); iter != nodes.end(); ++iter){
 
                child = *iter;
@@ -382,6 +386,7 @@ LV2Plugin::set_state(const XMLNode& node, int /*version*/)
                }
 
                map<string,uint32_t>::iterator i = _port_indices.find(sym);
+               
                if (i != _port_indices.end()) {
                        port_id = i->second;
                } else {
@@ -675,6 +680,7 @@ LV2PluginInfo::LV2PluginInfo (void* lv2_world, void* slv2_plugin)
        : _lv2_world(lv2_world)
        , _slv2_plugin(slv2_plugin)
 {
+        type = ARDOUR::LV2;
 }
 
 LV2PluginInfo::~LV2PluginInfo()