X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=scripts%2Ftomsloop.lua;h=4c04d32fbddf333031039cddbfb25d7e8e647292;hb=9ea43bd5ad7ea3601fb0bda26094ebca21d97c17;hp=7087d3c2884d0b911e317ed62acaadbd57652438;hpb=9ada4fcc0f4f6d5b8724d5b731c6e720271e89cb;p=ardour.git diff --git a/scripts/tomsloop.lua b/scripts/tomsloop.lua index 7087d3c288..4c04d32fbd 100644 --- a/scripts/tomsloop.lua +++ b/scripts/tomsloop.lua @@ -248,7 +248,7 @@ function factory (params) return function () -- do the actual work local region = track:bounce_range (loop:start (), loop:_end (), itt, proc, false) - playlist:add_region (region, playhead, n_paste, false, 0) + playlist:add_region (region, playhead, n_paste, false, 0, 0, false) n_regions_created = n_regions_created + 1 @@ -278,3 +278,42 @@ function factory (params) return function () ::errorout:: end -- end of anonymous action script function end -- end of script factory + + +function icon (params) return function (ctx, width, height) + local x = width * .5 + local y = height * .5 + local r = math.min (x, y) + + ctx:set_line_width (1) + + function stroke_outline () + ctx:set_source_rgba (0, 0, 0, 1) + ctx:stroke_preserve () + ctx:set_source_rgba (1, 1, 1, 1) + ctx:fill () + end + + ctx:rectangle (x - r * .6, y - r * .05, r * .6, r * .3) + stroke_outline () + + ctx:arc (x, y, r * .61, math.pi, 0.2 * math.pi) + ctx:arc_negative (x, y, r * .35, 0.2 * math.pi, math.pi); + stroke_outline () + + function arc_arrow (rad, ang) + return x - rad * math.sin (ang * 2.0 * math.pi), y - rad * math.cos (ang * 2.0 * math.pi) + end + + ctx:move_to (arc_arrow (r * .36, .72)) + ctx:line_to (arc_arrow (r * .17, .72)) + ctx:line_to (arc_arrow (r * .56, .60)) + ctx:line_to (arc_arrow (r * .75, .72)) + ctx:line_to (arc_arrow (r * .62, .72)) + + ctx:set_source_rgba (0, 0, 0, 1) + ctx:stroke_preserve () + ctx:close_path () + ctx:set_source_rgba (1, 1, 1, 1) + ctx:fill () +end end