summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2018-01-28 12:58:35 +0100
committerRobin Gareus <robin@gareus.org>2018-01-28 12:58:35 +0100
commitc9042b095c9debeab55fb522af582db8cfd2380d (patch)
tree2d59a3f0a5a419b6fedbcbc3586073fca2083db9 /scripts
parent11d2077b4396640b087e6a153f583cf117018b82 (diff)
Add icon for MIDI sysex transmit script
Diffstat (limited to 'scripts')
-rw-r--r--scripts/_tx_raw_midi_from_file.lua18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/_tx_raw_midi_from_file.lua b/scripts/_tx_raw_midi_from_file.lua
index a5e8606b85..81f07f6df1 100644
--- a/scripts/_tx_raw_midi_from_file.lua
+++ b/scripts/_tx_raw_midi_from_file.lua
@@ -108,3 +108,21 @@ function factory () return function ()
rv = nil
collectgarbage ()
end end
+
+function icon (params) return function (ctx, width, height, fg)
+ ctx:set_source_rgba (ARDOUR.LuaAPI.color_to_rgba (fg))
+ local txt = Cairo.PangoLayout (ctx, "ArdourMono ".. math.ceil(math.min (width, height) * .5) .. "px")
+ txt:set_text ("S")
+ ctx:move_to (1, 1)
+ txt:show_in_cairo_context (ctx)
+
+ txt:set_text ("Y")
+ local tw, th = txt:get_pixel_size ()
+ ctx:move_to (.5 * (width - tw), .5 * (height - th))
+ txt:show_in_cairo_context (ctx)
+
+ txt:set_text ("X")
+ tw, th = txt:get_pixel_size ()
+ ctx:move_to ((width - tw - 1), (height - th -1))
+ txt:show_in_cairo_context (ctx)
+end end