ladish_control: when dumping vgraphs, show port type and direction

This commit is contained in:
Nedko Arnaudov 2010-12-27 06:29:24 +02:00
parent 4f7b78388f
commit 3a5b7037d8
1 changed files with 17 additions and 1 deletions

View File

@ -147,7 +147,23 @@ def dump_graph(obj):
for client in graph[1]:
print '"%s"' % client[1]
for port in client[2]:
print ' "%s"' % port[1]
port_flags = port[2]
if (port_flags & 1) != 0:
port_flags = "input"
elif (port_flags & 2) != 0:
port_flags = "output"
else:
port_flags = "unknown"
port_type = port[3]
if port_type == 0:
port_type = "audio"
elif port_type == 1:
port_type = "midi"
else:
port_type = "unknown"
print ' "%s" [%s %s]' % (port[1], port_flags, port_type)
print
if len(graph[2]):
if len(graph[2]) == 1: