Add a script to list all plugins in the session
authorRobin Gareus <robin@gareus.org>
Sun, 30 Dec 2018 21:39:20 +0000 (22:39 +0100)
committerRobin Gareus <robin@gareus.org>
Sun, 30 Dec 2018 21:42:16 +0000 (22:42 +0100)
scripts/_dump_plugins.lua [new file with mode: 0644]

diff --git a/scripts/_dump_plugins.lua b/scripts/_dump_plugins.lua
new file mode 100644 (file)
index 0000000..5d265b2
--- /dev/null
@@ -0,0 +1,44 @@
+ardour { ["type"] = "Snippet", name = "Dump Plugins",
+       license     = "MIT",
+       author      = "Ardour Team",
+}
+
+function factory () return function ()
+       local all_plugs = {}
+
+       for r in Session:get_routes ():iter () do
+               if r:is_monitor () or r:is_auditioner () then goto nextroute end -- skip special routes
+               local i = 0
+               while true do
+                       local proc = r:nth_plugin (i)
+                       if proc:isnil () then break end
+                       local pi = proc:to_insert () -- we know it's a plugin-insert (we asked for nth_plugin)
+                       local pp = pi:plugin (0)
+                       local id = pi:type() .. "-" .. pp:unique_id()
+                       local cnt = 0
+                       if all_plugs[id] then cnt = all_plugs[id]['cnt'] end
+                       all_plugs[id] = { name = proc:name(), ["type"] = pi:type(), id = pp:unique_id(), cnt = (cnt + 1) }
+                       i = i + 1
+               end
+               ::nextroute::
+       end
+
+       function plugintypestr (t)
+               if (t == ARDOUR.PluginType.LADSPA) then  return "LADSPA" end
+               if (t == ARDOUR.PluginType.LV2) then return "LV2" end
+               if (t == ARDOUR.PluginType.AudioUnit) then return "AU" end
+               if (t == ARDOUR.PluginType.Windows_VST) then return "VST" end
+               if (t == ARDOUR.PluginType.LXVST) then return "VST" end
+               if (t == ARDOUR.PluginType.MacVST) then return "VST" end
+               if (t == ARDOUR.PluginType.Lua) then return "Lua" end
+               return "??"
+       end
+
+       for k,v in pairs (all_plugs) do
+               print (string.format ("%2d * %-6s %-30s (%s)", v['cnt'], plugintypestr(v['type']), v['name'], v['id']))
+       end
+
+       all_plugs = nil
+       collectgarbage ();
+
+end end