summaryrefslogtreecommitdiff
path: root/scripts/split_all_markers.lua
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/split_all_markers.lua')
-rw-r--r--scripts/split_all_markers.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/split_all_markers.lua b/scripts/split_all_markers.lua
index b06ac5f70b..e67a7be51d 100644
--- a/scripts/split_all_markers.lua
+++ b/scripts/split_all_markers.lua
@@ -4,6 +4,28 @@ ardour { ["type"] = "EditorAction", name = "Marker Split",
description = [[Split regions on selected tracks at all locations markers]]
}
+function icon (params) return function (ctx, w, h, fg)
+ local mh = h - 3.5;
+ local m3 = w / 3;
+ local m6 = w / 6;
+ ctx:set_source_rgba (.8, .8, .2, 1.0)
+ ctx:move_to (w / 2 - m6, 2)
+ ctx:rel_line_to (m3, 0)
+ ctx:rel_line_to (0, mh * 0.4)
+ ctx:rel_line_to (-m6, mh * 0.6)
+ ctx:rel_line_to (-m6, -mh * 0.6)
+ ctx:close_path ()
+ ctx:fill ()
+ -- TODO: better draw a left/right arrow <--|-->
+ -- yet this is a handy text example, so..
+ local txt = Cairo.PangoLayout (ctx, "ArdourMono ".. (h - 7) .. "px")
+ ctx:set_source_rgba (1, 0, 0, 0.7)
+ txt:set_text ("S")
+ local tw, th = txt:get_pixel_size ()
+ ctx:move_to (.5 * (w - tw), 1)
+ txt:show_in_cairo_context (ctx)
+end end
+
function factory (params) return function ()
local loc = Session:locations () -- all marker locations