1 ardour { ["type"] = "EditorAction", name = "Remove Unknown Plugins",
3 author = "Ardour Team",
4 description = [[Remove all unknown plugins/processors from all tracks and busses]]
7 function factory (params) return function ()
8 -- iterate over all tracks and busses (aka routes)
9 for route in Session:get_routes ():iter () do
10 -- route is-a http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:Route
12 -- we need to iterate one-by one, removing a processor invalidates the list
14 proc = route:nth_processor (i)
15 -- proc is a http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:Processor
16 -- try cast it to http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:UnknownProcessor
17 if not proc:isnil () and not proc:to_unknownprocessor ():isnil () then
18 route:remove_processor (proc, nil, true)
27 function icon (params) return function (ctx, width, height, fg)
28 local txt = Cairo.PangoLayout (ctx, "ArdourMono ".. math.ceil (math.min (width, height) * .5) .. "px")
30 local tw, th = txt:get_pixel_size ()
31 ctx:move_to (.5 * (width - tw), .5 * (height - th))
32 txt:layout_cairo_path (ctx)
34 ctx:set_source_rgba (ARDOUR.LuaAPI.color_to_rgba (fg))
35 ctx:set_line_width (3)
36 ctx:stroke_preserve ()
38 ctx:set_source_rgba (.8, .2, .2, 1)
39 ctx:set_line_width (2)
40 ctx:stroke_preserve ()
42 ctx:set_source_rgba (0, 0, 0, 1)