Only show user-presets in favorite sidebar
[ardour.git] / scripts / delete_xrun_markers.lua
1 ardour { ["type"] = "EditorAction", name = "Delete xrun markers", author = "Ardour Team", description = [[Delete all xrun markers in the current session]] }
2
3 function factory () return function ()
4         for l in Session:locations():list():iter() do
5                 if l:is_mark() and string.find (l:name(), "^xrun%d*$") then
6                         Session:locations():remove (l);
7                 end
8         end
9 end end
10
11 function icon (params) return function (ctx, width, height, fg)
12         local mh = height - 3.5;
13         local m3 = width / 3;
14         local m6 = width / 6;
15
16         ctx:set_line_width (.5)
17
18         ctx:set_source_rgba (.8, .2, .2, 1.0)
19         ctx:move_to (width / 2 - m6, 2)
20         ctx:rel_line_to (m3, 0)
21         ctx:rel_line_to (0, mh * 0.4)
22         ctx:rel_line_to (-m6, mh * 0.6)
23         ctx:rel_line_to (-m6, -mh * 0.6)
24         ctx:close_path ()
25         ctx:fill_preserve ()
26         ctx:set_source_rgba (.0, .0, .0, 1.0)
27         ctx:stroke ()
28
29         ctx:set_source_rgba (ARDOUR.LuaAPI.color_to_rgba (fg))
30         ctx:set_line_width (1)
31
32         ctx:move_to (width * .2, height * .2)
33         ctx:line_to (width * .8, height * .8)
34         ctx:stroke ()
35
36         ctx:move_to (width * .8, height * .2)
37         ctx:line_to (width * .2, height * .8)
38         ctx:stroke ()
39
40 end end