summaryrefslogtreecommitdiff
path: root/share/scripts/_plot_graph.lua
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-02-23 20:48:02 +0100
committerRobin Gareus <robin@gareus.org>2020-02-23 20:48:02 +0100
commit180843f9bd28b191c7404245ba0a121107992511 (patch)
treec60312dc09f76c2f55ba2383245c427e15c38dea /share/scripts/_plot_graph.lua
parentbf649cd68ad46c34a656700aa6cb89416d648c64 (diff)
Also move Lua scripts to share subfolder
Diffstat (limited to 'share/scripts/_plot_graph.lua')
-rw-r--r--share/scripts/_plot_graph.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/share/scripts/_plot_graph.lua b/share/scripts/_plot_graph.lua
new file mode 100644
index 0000000000..9c8876dbbb
--- /dev/null
+++ b/share/scripts/_plot_graph.lua
@@ -0,0 +1,24 @@
+ardour {
+ ["type"] = "EditorAction",
+ name = "Plot Process Graph",
+ author = "Ardour Team",
+ description = [[Export process graph to a graphviz file, and launch xdot]]
+}
+
+function factory () return function ()
+ if Session:plot_process_graph ("/tmp/ardour_graph.gv") then
+ os.forkexec ("/bin/sh", "-c", "xdot /tmp/ardour_graph.gv")
+ end
+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, "Sans ".. math.ceil(height / 3) .. "px")
+ txt:set_alignment (Cairo.Alignment.Center);
+ txt:set_width (width);
+ txt:set_ellipsize (Cairo.EllipsizeMode.Middle);
+ txt:set_text ("plot\ngrph")
+ local tw, th = txt:get_pixel_size ()
+ ctx:move_to (0, .5 * (height - th))
+ txt:show_in_cairo_context (ctx)
+end end