1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
|
.. module:: liblo
##############################
pyliblo 0.10 API Documentation
##############################
Homepage: http://das.nasophon.de/pyliblo/
The latest version of this manual can be found at
http://dsacre.github.io/pyliblo/doc/.
For the most part, pyliblo is just a thin wrapper around
`liblo <http://liblo.sourceforge.net/>`_, which does
all the real work.
For questions not answered here, also see the
`liblo documentation <http://liblo.sourceforge.net/docs/modules.html>`_
and the `OSC spec <http://opensoundcontrol.org/spec-1_0>`_.
Module-level Functions
======================
.. autofunction:: send
.. autofunction:: time
OSC Server Classes
==================
.. autoclass:: Server
:no-members:
.. automethod:: __init__
.. automethod:: recv
.. automethod:: send
.. automethod:: add_method
.. automethod:: del_method
.. automethod:: register_methods
.. automethod:: add_bundle_handlers
.. autoattribute:: url
.. autoattribute:: port
.. autoattribute:: protocol
.. automethod:: fileno
.. automethod:: free
-------
.. autoclass:: ServerThread
:no-members:
.. automethod:: __init__
.. automethod:: start
.. automethod:: stop
.. autoclass:: make_method
.. automethod:: __init__
Utility Classes
===============
.. autoclass:: Address
:no-members:
.. automethod:: __init__
.. autoattribute:: url
.. autoattribute:: hostname
.. autoattribute:: port
.. autoattribute:: protocol
-------
.. autoclass:: Message
.. automethod:: __init__
.. autoclass:: Bundle
.. automethod:: __init__
-------
.. autoexception:: ServerError
.. autoexception:: AddressError
Mapping between OSC and Python data types
=========================================
When constructing a message, pyliblo automatically converts
arguments to an appropriate OSC data type.
To explicitly specify the OSC data type to be transmitted, pass a
``(typetag, data)`` tuple instead. Some types can't be unambiguously
recognized, so they can only be sent that way.
The mapping between OSC and Python data types is shown in the following table:
========= =============== ====================================================
typetag OSC data type Python data type
========= =============== ====================================================
``'i'`` int32 :class:`int`
``'h'`` int64 :class:`long` (Python 2.x), :class:`int` (Python 3.x)
``'f'`` float :class:`float`
``'d'`` double :class:`float`
``'c'`` char :class:`str` (single character)
``'s'`` string :class:`str`
``'S'`` symbol :class:`str`
``'m'`` midi :class:`tuple` of four :class:`int`\ s
``'t'`` timetag :class:`float`
``'T'`` true
``'F'`` false
``'N'`` nil
``'I'`` infinitum
``'b'`` blob :class:`list` of :class:`int`\ s (Python 2.x), :class:`bytes` (Python 3.x)
========= =============== ====================================================
|