diff options
Diffstat (limited to 'libs/ardour/plugin_insert.cc')
-rw-r--r-- | libs/ardour/plugin_insert.cc | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/libs/ardour/plugin_insert.cc b/libs/ardour/plugin_insert.cc index d92a758adb..502f581532 100644 --- a/libs/ardour/plugin_insert.cc +++ b/libs/ardour/plugin_insert.cc @@ -150,7 +150,6 @@ PluginInsert::set_count (uint32_t num) void PluginInsert::set_sinks (const ChanCount& c) { - bool changed = (_custom_sinks != c) && _custom_cfg; _custom_sinks = c; /* no signal, change will only be visible after re-config */ } @@ -2117,6 +2116,19 @@ PluginInsert::set_state(const XMLNode& node, int version) } #endif + if (plugin == 0 && type == ARDOUR::Lua) { + /* unique ID (sha1 of script) was not found, + * load the plugin from the serialized version in the + * session-file instead. + */ + boost::shared_ptr<LuaProc> lp (new LuaProc (_session.engine(), _session, "")); + XMLNode *ls = node.child (lp->state_node_name().c_str()); + if (ls && lp) { + lp->set_script_from_state (*ls); + plugin = lp; + } + } + if (plugin == 0) { error << string_compose( _("Found a reference to a plugin (\"%1\") that is unknown.\n" @@ -2126,15 +2138,6 @@ PluginInsert::set_state(const XMLNode& node, int version) return -1; } - if (type == ARDOUR::Lua) { - XMLNode *ls = node.child (plugin->state_node_name().c_str()); - // we need to load the script to set the name and parameters. - boost::shared_ptr<LuaProc> lp = boost::dynamic_pointer_cast<LuaProc>(plugin); - if (ls && lp) { - lp->set_script_from_state (*ls); - } - } - // The name of the PluginInsert comes from the plugin, nothing else _name = plugin->get_info()->name; |