From 24f070610c0f619f7f778eeba4fbb2e08b3f9cf8 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 24 Feb 2017 14:11:56 +0100 Subject: Save Lua script origin (for later updates) -- DSP plugin --- libs/ardour/luaproc.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libs/ardour/luaproc.cc') diff --git a/libs/ardour/luaproc.cc b/libs/ardour/luaproc.cc index 9b51565b9c..bae1bd6d3d 100644 --- a/libs/ardour/luaproc.cc +++ b/libs/ardour/luaproc.cc @@ -87,6 +87,7 @@ LuaProc::LuaProc (const LuaProc &other) #endif , _lua_dsp (0) , _script (other.script ()) + , _origin (other._origin) , _lua_does_channelmapping (false) , _lua_has_inline_display (false) , _designated_bypass_port (UINT32_MAX) @@ -763,6 +764,7 @@ LuaProc::add_state (XMLNode* root) const g_free (b64); XMLNode* script_node = new XMLNode (X_("script")); script_node->add_property (X_("lua"), LUA_VERSION); + script_node->add_property (X_("origin"), _origin); script_node->add_content (b64s); root->add_child_nocopy (*script_node); @@ -787,6 +789,10 @@ LuaProc::set_script_from_state (const XMLNode& node) } if ((child = node.child (X_("script"))) != 0) { + XMLProperty const* prop; + if ((prop = node.property ("origin")) != 0) { + _origin = prop->value(); + } for (XMLNodeList::const_iterator n = child->children ().begin (); n != child->children ().end (); ++n) { if (!(*n)->is_content ()) { continue; } gsize size; @@ -1242,7 +1248,9 @@ LuaPluginInfo::load (Session& session) } try { - PluginPtr plugin (new LuaProc (session.engine (), session, script)); + LuaProc* lp = new LuaProc (session.engine (), session, script); + lp->set_origin (path); + PluginPtr plugin (lp); return plugin; } catch (failed_constructor& err) { ; -- cgit v1.2.3