stereo bug: more testing
[calf.git] / bigbull / inspect.py
blob24606234e41748436f4d0e427a0e357fbfd5333c
1 #!/usr/bin/env python
2 import os
3 import sys
4 import fakeserv
5 import lv2
6 import client
8 fakeserv.start()
10 db = lv2.LV2DB()
11 plugins = db.getPluginList()
13 for uri in plugins:
14 plugin = db.getPluginInfo(uri)
15 if plugin == None:
16 continue
17 print "Plugin: %s" % plugin.name
18 if plugin.microname != None: print "Tiny name: %s" % plugin.microname
19 print "License: %s" % plugin.license
20 print "Classes: %s" % plugin.classes
21 print "Required features: %s" % list(plugin.requiredFeatures)
22 print "Optional features: %s" % list(plugin.optionalFeatures)
23 print "Ports:"
24 types = ["Audio", "Control", "Event", "Input", "Output", "String", "LarslMidi"]
25 for port in plugin.ports:
26 extra = []
27 for type in types:
28 if port.__dict__["is" + type]:
29 extra.append(type)
30 for sp in ["defaultValue", "minimum", "maximum", "microname"]:
31 if port.__dict__[sp] != None:
32 extra.append("%s=%s" % (sp, repr(port.__dict__[sp])))
33 if len(port.events):
34 s = list()
35 for evt in port.events:
36 if evt in lv2.event_type_names:
37 s.append(lv2.event_type_names[evt])
38 else:
39 s.append(evt)
40 extra.append("events=%s" % ",".join(s))
42 print "%4s %-20s %-40s %s" % (port.index, port.symbol, port.name, ", ".join(extra))
43 splist = port.scalePoints
44 splist.sort(lambda x, y: cmp(x[1], y[1]))
45 if len(splist):
46 for sp in splist:
47 print " Scale point %s: %s" % (sp[1], sp[0])
48 #print port
49 print