summaryrefslogtreecommitdiff
path: root/scripts/remove_unknown_procs.lua
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-02-20 03:58:52 +0100
committerRobin Gareus <robin@gareus.org>2017-02-20 03:58:52 +0100
commit120e75b420a4c756c71ce42bd0eea2565cde06ce (patch)
treee717c80b8570fce9860185af43b232ec081768b3 /scripts/remove_unknown_procs.lua
parent0aa631b6afd07e749a1492c55367461459d34108 (diff)
And some more action-script icons
Diffstat (limited to 'scripts/remove_unknown_procs.lua')
-rw-r--r--scripts/remove_unknown_procs.lua23
1 files changed, 22 insertions, 1 deletions
diff --git a/scripts/remove_unknown_procs.lua b/scripts/remove_unknown_procs.lua
index 0461e88567..044e85b3b8 100644
--- a/scripts/remove_unknown_procs.lua
+++ b/scripts/remove_unknown_procs.lua
@@ -5,10 +5,11 @@ ardour { ["type"] = "EditorAction", name = "Remove Unknown Plugins",
}
function factory (params) return function ()
- -- iterate over all tracks and busses
+ -- iterate over all tracks and busses (aka routes)
for route in Session:get_routes ():iter () do
-- route is-a http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:Route
local i = 0;
+ -- we need to iterate one-by one, removing a processor invalidates the list
repeat
proc = route:nth_processor (i)
-- proc is a http://manual.ardour.org/lua-scripting/class_reference/#ARDOUR:Processor
@@ -21,3 +22,23 @@ function factory (params) return function ()
until proc:isnil ()
end
end end
+
+
+function icon (params) return function (ctx, width, height, fg)
+ local txt = Cairo.PangoLayout (ctx, "ArdourMono ".. math.ceil (math.min (width, height) * .5) .. "px")
+ txt:set_text ("Fx")
+ local tw, th = txt:get_pixel_size ()
+ ctx:move_to (.5 * (width - tw), .5 * (height - th))
+ txt:layout_cairo_path (ctx)
+
+ ctx:set_source_rgba (ARDOUR.LuaAPI.color_to_rgba (fg))
+ ctx:set_line_width (3)
+ ctx:stroke_preserve ()
+
+ ctx:set_source_rgba (.8, .2, .2, 1)
+ ctx:set_line_width (2)
+ ctx:stroke_preserve ()
+
+ ctx:set_source_rgba (0, 0, 0, 1)
+ ctx:fill ()
+end end