Add Action to save mixer screenshot
[ardour.git] / scripts / select_every_2nd_region.lua
index 4e6d156f5a5acca25d2dde5dabaa6886a2ae250b..b05efc1a46c7635d1a96358b6cc7e1d6b3916244 100644 (file)
@@ -29,7 +29,7 @@ function factory () return function ()
                        else
                                skip = true;
                                -- get RegionView (GUI object to be selected)
-                               local rv = Editor:get_regionview_from_region (region)
+                               local rv = Editor:regionview_from_region (region)
                                -- add it to the list of Objects to be selected
                                sl:push_back (rv);
                        end
@@ -40,3 +40,21 @@ function factory () return function ()
        -- set/replace current selection in the editor
        Editor:set_selection (sl, ArdourUI.SelectionOp.Set);
 end end
+
+function icon (params) return function (ctx, width, height, fg)
+       local wh = math.min (width, height) * .5
+
+       ctx:set_line_width (1)
+       ctx:rectangle (wh * .25, wh * .75, wh * 1.5 , .5 * wh)
+       ctx:set_source_rgba (0, 0, 0, 1)
+       ctx:stroke_preserve ()
+       ctx:set_source_rgba (.9, .9, .9, 1)
+       ctx:fill ()
+
+       ctx:set_source_rgba (1, 0, 0, 1)
+       ctx:rectangle (.5 + math.ceil(wh * 0.25), .5 + math.ceil(wh * .75), math.floor(wh * .5) - 1, math.floor(.5 * wh) - 1)
+       ctx:stroke_preserve ()
+
+       ctx:rectangle (.5 + math.ceil(wh * 1.25), .5 + math.ceil(wh * .75), math.floor(wh * .5) - 1, math.floor(.5 * wh) - 1)
+       ctx:stroke_preserve ()
+end end