Add DiskIOProc & Latency related Lua bindings & scripts

This commit is contained in:
Robin Gareus 2017-09-28 04:25:50 +02:00
parent 2b20f30d81
commit 1339d42c78
3 changed files with 106 additions and 15 deletions

View file

@ -1,12 +1,14 @@
ardour { ["type"] = "Snippet", name = "portengine" }
function factory () return function ()
a = Session:engine()
local a = Session:engine()
print ("----- Port objects from Ardour's engine ----");
_, t = a:get_ports (ARDOUR.DataType("audio"), ARDOUR.PortList())
-- table 't' holds argument references. t[2] is the PortList
for p in t[2]:iter() do
print (p:name())
local lp = p:get_connected_latency_range (ARDOUR.LatencyRange(), true)
local lc = p:get_connected_latency_range (ARDOUR.LatencyRange(), false)
print (p:name(), " -- Play lat.", lp[1].min, lp[1].max, "Capt lat.", lc[1].min, lc[1].max)
end
print ("----- Port names queries from the backend ----");
@ -20,7 +22,7 @@ function factory () return function ()
_, t = a:get_backend_ports ("", ARDOUR.DataType("audio"), ARDOUR.PortFlags.IsOutput, C.StringVector())
for n in t[4]:iter() do
local printed_name = false;
_, ct = a:get_connections (n, C.StringVector())
local _, ct = a:get_connections (n, C.StringVector())
for c in ct[2]:iter() do
if (not printed_name) then
printed_name = true;