summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-02-18 16:12:59 +0100
committerRobin Gareus <robin@gareus.org>2017-02-18 16:12:59 +0100
commit1ab3d33df7b86cab5e168ae0a22f7c0de117141e (patch)
tree658e0af6d3fd247172687688d0f95a59cc81a2cf /scripts
parent4755c703f4b01cd7de01bda0c72686b93e34e120 (diff)
Some more EditorAction icons & color API update
Diffstat (limited to 'scripts')
-rw-r--r--scripts/delete_xrun_markers.lua31
-rw-r--r--scripts/preare_record_example.lua2
-rw-r--r--scripts/split_all_markers.lua8
-rw-r--r--scripts/tomsloop.lua39
-rw-r--r--scripts/vamp_audio_to_midi.lua9
5 files changed, 86 insertions, 3 deletions
diff --git a/scripts/delete_xrun_markers.lua b/scripts/delete_xrun_markers.lua
index 2530ec2a8e..5512e653b6 100644
--- a/scripts/delete_xrun_markers.lua
+++ b/scripts/delete_xrun_markers.lua
@@ -7,3 +7,34 @@ function factory () return function ()
end
end
end end
+
+function icon (params) return function (ctx, width, height, fg)
+ local mh = height - 3.5;
+ local m3 = width / 3;
+ local m6 = width / 6;
+
+ ctx:set_line_width (.5)
+
+ ctx:set_source_rgba (.8, .2, .2, 1.0)
+ ctx:move_to (width / 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_preserve ()
+ ctx:set_source_rgba (.0, .0, .0, 1.0)
+ ctx:stroke ()
+
+ ctx:set_source_rgba (ARDOUR.LuaAPI.color_to_rgba (fg))
+ ctx:set_line_width (1)
+
+ ctx:move_to (width * .2, height * .2)
+ ctx:line_to (width * .8, height * .8)
+ ctx:stroke ()
+
+ ctx:move_to (width * .8, height * .2)
+ ctx:line_to (width * .2, height * .8)
+ ctx:stroke ()
+
+end end
diff --git a/scripts/preare_record_example.lua b/scripts/preare_record_example.lua
index 92ee8847f3..48e063d326 100644
--- a/scripts/preare_record_example.lua
+++ b/scripts/preare_record_example.lua
@@ -67,7 +67,7 @@ function icon (params) return function (ctx, width, height)
local r = math.min (x, y) * .55
ctx:arc (x, y, r, 0, 2 * math.pi)
- ctx:set_source_rgba (9, .3, .3, 1.)
+ ctx:set_source_rgba (.9, .3, .3, 1.)
ctx:fill_preserve ()
ctx:set_source_rgba (0, 0, 0, .8)
ctx:set_line_width (1)
diff --git a/scripts/split_all_markers.lua b/scripts/split_all_markers.lua
index 64aeea7f5a..967743e56a 100644
--- a/scripts/split_all_markers.lua
+++ b/scripts/split_all_markers.lua
@@ -82,6 +82,8 @@ function icon (params) return function (ctx, width, height, fg)
local m3 = width / 3;
local m6 = width / 6;
+ ctx:set_line_width (.5)
+
-- compare to gtk2_ardour/marker.cc "Marker"
ctx:set_source_rgba (.8, .8, .2, 1.0)
ctx:move_to (width / 2 - m6, 2)
@@ -90,10 +92,12 @@ function icon (params) return function (ctx, width, height, fg)
ctx:rel_line_to (-m6, mh * 0.6)
ctx:rel_line_to (-m6, -mh * 0.6)
ctx:close_path ()
- ctx:fill ()
+ ctx:fill_preserve ()
+ ctx:set_source_rgba (.0, .0, .0, 1.0)
+ ctx:stroke ()
-- draw an arrow <--|--> on top, using the foreground color
- ctx:set_source_rgba (LuaCairo.color_to_rgba (fg))
+ ctx:set_source_rgba (ARDOUR.LuaAPI.color_to_rgba (fg))
ctx:set_line_width (1)
ctx:move_to (width * .5, height * .4)
diff --git a/scripts/tomsloop.lua b/scripts/tomsloop.lua
index 56fec4262f..6b643506d4 100644
--- a/scripts/tomsloop.lua
+++ b/scripts/tomsloop.lua
@@ -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
diff --git a/scripts/vamp_audio_to_midi.lua b/scripts/vamp_audio_to_midi.lua
index 79fc32ac83..5792e8f115 100644
--- a/scripts/vamp_audio_to_midi.lua
+++ b/scripts/vamp_audio_to_midi.lua
@@ -68,3 +68,12 @@ function factory () return function ()
end
end
end end
+
+function icon (params) return function (ctx, width, height, fg)
+ local txt = Cairo.PangoLayout (ctx, "ArdourMono ".. math.ceil(width * .7) .. "px")
+ txt:set_text ("\u{2669}") -- quarter note symbol UTF8
+ local tw, th = txt:get_pixel_size ()
+ ctx:set_source_rgba (ARDOUR.LuaAPI.color_to_rgba (fg))
+ ctx:move_to (.5 * (width - tw), .5 * (height - th))
+ txt:show_in_cairo_context (ctx)
+end end