end
end
end
+
+
+function icon (params) return function (ctx, width, height)
+ local wh = math.min (width, height) * .5
+ local x0 = math.ceil (wh * .4)
+ local x1 = math.floor (wh * 1.6)
+ ctx:rectangle (wh * .4, wh * .4, wh * 1.2, wh * 1.2)
+ ctx:set_source_rgba (.7, .7, .7, 1)
+ ctx:fill ()
+ ctx:set_line_width (1)
+ ctx:set_source_rgba (.0, .0, .0, 1)
+ ctx:move_to (x0, wh)
+ for x = x0, x1 do
+ ctx:line_to (x, wh - math.sin (2 * math.pi * (x-x0) / (x1-x0)) * wh * .5)
+ end
+ ctx:stroke ()
+end end
}\r
\r
function factory () return function ()\r
-\r
local names = {\r
"Kick",\r
"Snare",\r
end --foreach track\r
\r
end end -- function factory\r
+\r
+\r
+function icon (params) return function (ctx, width, height)\r
+ local x = width * .5\r
+ local y = height * .5\r
+ local r = math.min (x, y) * .7\r
+ ctx:save ()\r
+ ctx:translate (x, y)\r
+ ctx:scale (1, .5)\r
+ ctx:translate (-x, -y)\r
+ ctx:arc (x, y, r, 0, 2 * math.pi)\r
+ ctx:set_source_rgba (.9, .9, 1, 1)\r
+ ctx:fill ()\r
+ ctx:arc (x, y, r, 0, math.pi)\r
+ ctx:arc_negative (x, y * 1.6, r, math.pi, 0)\r
+ ctx:set_source_rgba (.7, .7, .7, 1)\r
+ ctx:fill ()\r
+ ctx:restore ()\r
+\r
+ ctx:set_source_rgba (.6, .4, .2, 1)\r
+ ctx:translate (x, y)\r
+ ctx:scale (.7, 1)\r
+ ctx:translate (-x, -y)\r
+ ctx:set_line_cap (Cairo.LineCap.Round)\r
+\r
+ function drumstick (xp, lr)\r
+ ctx:set_line_width (r * .3)\r
+ ctx:move_to (x * xp, y)\r
+ ctx:close_path ()\r
+ ctx:stroke ()\r
+ ctx:set_line_width (r * .2)\r
+ ctx:move_to (x * xp, y)\r
+ ctx:rel_line_to (lr * x, y)\r
+ ctx:stroke ()\r
+ end\r
+ drumstick (1.2, 1.2)\r
+ drumstick (0.7, -.5)\r
+end end\r
}
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
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