AU: install latency listener
[ardour.git] / scripts / s_portengine.lua
1 ardour { ["type"] = "Snippet", name = "portengine" }
2 function factory () return function ()
3
4         a = Session:engine()
5         print ("----- Port objects from Ardour's engine ----");
6         _, t = a:get_ports (ARDOUR.DataType("audio"), ARDOUR.PortList())
7         -- table 't' holds argument references. t[2] is the PortList
8         for p in t[2]:iter() do
9                 print (p:name())
10         end
11
12         print ("----- Port names queries from the backend ----");
13         _, t = a:get_backend_ports ("", ARDOUR.DataType("audio"), 0, C.StringVector())
14         -- table 't' holds argument references. t[4] is the StringVector
15         for n in t[4]:iter() do
16                 print (n)
17         end
18
19         print ("----- Connections from the backend ----");
20         _, t = a:get_backend_ports ("", ARDOUR.DataType("audio"), ARDOUR.PortFlags.IsOutput, C.StringVector())
21         for n in t[4]:iter() do
22                 local printed_name = false;
23                 _, ct = a:get_connections (n, C.StringVector())
24                 for c in ct[2]:iter() do
25                         if (not printed_name) then
26                                 printed_name = true;
27                                 print (n)
28                         end
29                         print (" ->", c)
30                 end
31         end
32
33 end end