diff options
author | Robin Gareus <robin@gareus.org> | 2017-02-18 16:12:59 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-02-18 16:12:59 +0100 |
commit | 1ab3d33df7b86cab5e168ae0a22f7c0de117141e (patch) | |
tree | 658e0af6d3fd247172687688d0f95a59cc81a2cf /scripts/vamp_audio_to_midi.lua | |
parent | 4755c703f4b01cd7de01bda0c72686b93e34e120 (diff) |
Some more EditorAction icons & color API update
Diffstat (limited to 'scripts/vamp_audio_to_midi.lua')
-rw-r--r-- | scripts/vamp_audio_to_midi.lua | 9 |
1 files changed, 9 insertions, 0 deletions
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 |