Make ArdourDisplay a subclass of ArdourDropdown
[ardour.git] / scripts / remove_unknown_procs.lua
1 ardour { ["type"] = "EditorAction", name = "Remove Unknown Plugins",
2         license     = "MIT",
3         author      = "Ardour Team",
4         description = [[Remove all unknown plugins/processors from all tracks and busses]]
5 }
6
7 function factory (params) return function ()
8         -- iterate over all tracks and busses
9         for route in Session:get_routes ():iter () do
10                 -- route is-a http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:Route
11                 local i = 0;
12                 repeat
13                         proc = route:nth_processor (i)
14                         -- proc is a http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:Processor
15                         -- try cast it to http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:UnknownProcessor
16                         if not proc:isnil () and not proc:to_unknownprocessor ():isnil () then
17                                 route:remove_processor (proc, nil, true)
18                         else
19                                 i = i + 1
20                         end
21                 until proc:isnil ()
22         end
23 end end