Fix LV2 state:StateChanged URI
[ardour.git] / libs / ardour / lv2_plugin.cc
index 0892d86c330b61691688c6074116ace71a6634b7..a7f8bfb20965f4e4a4c00bd8bba138040439edf8 100644 (file)
@@ -982,10 +982,16 @@ LV2Plugin::read_midnam () {
                std::stringstream ss;
                ss << (void*)this;
                ss << unique_id();
-               MIDI::Name::MidiPatchManager::instance().remove_custom_midnam (ss.str());
-               rv = MIDI::Name::MidiPatchManager::instance().add_custom_midnam (ss.str(), midnam);
+               rv = MIDI::Name::MidiPatchManager::instance().update_custom_midnam (ss.str(), midnam);
+       }
+#ifndef NDEBUG
+       if (rv) {
+               info << string_compose(_("LV2: update midnam for plugin '%1'"), name ()) << endmsg;
+       } else {
+               warning << string_compose(_("LV2: Failed to parse midnam of plugin '%1'"), name ()) << endmsg;
        }
-       free (midnam);
+#endif
+       _midname_interface->free (midnam);
        return rv;
 }
 
@@ -999,7 +1005,7 @@ LV2Plugin::midnam_model () {
        if (model) {
                rv = model;
        }
-       free (model);
+       _midname_interface->free (model);
        return rv;
 }
 #endif
@@ -2771,7 +2777,7 @@ LV2Plugin::connect_and_run(BufferSet& bufs,
                                        if (atom->type == _uri_map.urids.atom_Blank ||
                                            atom->type == _uri_map.urids.atom_Object) {
                                                LV2_Atom_Object* obj = (LV2_Atom_Object*)atom;
-                                               if (obj->body.otype == _uri_map.urids.state_Changed) {
+                                               if (obj->body.otype == _uri_map.urids.state_StateChanged) {
                                                        _session.set_dirty ();
                                                }
                                        }