From e08c80370cfcadb7400b6f342b027b6c64ed3dd0 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 30 Oct 2016 21:24:26 +0100 Subject: Fix midnam replacement: Unloading before update may otherwise reset the patch to generic midi (when the current patch is no longer available) --- libs/ardour/lv2_plugin.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libs/ardour/lv2_plugin.cc') diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc index 94760dc336..eca7f0c0ef 100644 --- a/libs/ardour/lv2_plugin.cc +++ b/libs/ardour/lv2_plugin.cc @@ -982,9 +982,15 @@ 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; } +#endif _midname_interface->free (midnam); return rv; } -- cgit v1.2.3