dvarrazzo/python-pulseaudio
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
These are simple ctypes bindings for pulseaudio.
Generated from pulseaudio 8.0 on 2017-12-18.
generation commands::
h2xml -I /usr/include -c -o pa.xml \
pulse/mainloop-api.h pulse/sample.h pulse/def.h pulse/operation.h \
pulse/context.h pulse/channelmap.h pulse/volume.h pulse/stream.h \
pulse/introspect.h pulse/subscribe.h pulse/scache.h pulse/version.h \
pulse/error.h pulse/xmalloc.h pulse/utf8.h pulse/thread-mainloop.h \
pulse/mainloop.h pulse/mainloop-signal.h pulse/util.h pulse/timeval.h \
pulse/simple.h
xml2py -k efstd -o lib_pulseaudio.py -l pulse -l pulse-simple -r '(pa|PA)_.+' pa.xml
Note that on Ubuntu 16.04 ctypeslib is buggy, resulting in blank compile errors
such as:
compile for syntax check ...
running: gccxml /tmp/tmpQSqY1_.cpp -I /usr/include/
CompilerError:
You will need:
sudo sed -i 's/"gccxml"/"gccxml.real"/g' \
/usr/lib/python2.7/dist-packages/ctypeslib/codegen/cparser.py
See https://bugs.launchpad.net/ubuntu/+source/python-ctypeslib/+bug/1657234
Also note that the same ctypeslib emits symbols in unstable orders, and items
in __all__ in stable but random order. The following patch creates a more
reasonable output:
--- ctypeslib/codegen/codegenerator.py.orig
+++ ctypeslib/codegen/codegenerator.py
@@ -757,6 +757,10 @@
self.generate(item)
def cmpitems(a, b):
+ NT = (typedesc.Variable, typedesc.EnumValue)
+ if isinstance(a, NT) and isinstance(b, NT):
+ return cmp(a.name, b.name)
+
a = getattr(a, "location", None)
b = getattr(b, "location", None)
if a is None: return -1
@@ -787,7 +791,8 @@
self.output.write("\n\n")
self.output.write(self.stream.getvalue())
- text = "__all__ = [%s]" % ", ".join([repr(str(n)) for n in self.names])
+ text = "__all__ = [%s]" % ", ".join(
+ sorted([repr(str(n)) for n in self.names], key=str.lower))
wrapper = textwrap.TextWrapper(break_long_words=False,
subsequent_indent=" ")