Package rats :: Module osc :: Class OscServer
[hide private]
[frames] | no frames]

Class OscServer

source code

object --+
         |
        OscServer

An OSC server listens for incoming OSC messages.

The programmer must register callbacks in order to do something with the incoming data.

Instance Methods [hide private]
 
__init__(self, port=1234, interval=0.01)
:param interval: duration in seconds to wait between each poll
source code
 
start(self)
Actually start the server.
source code
 
set_port(self, port)
Used to change the OSC port to listen to.
source code
 
add_callback(self, addr, types, callback, *args)
Adds a callback for an OSC message.
source code
 
_setup(self)
Called once it is time to start the server or change the port to listen to.
source code
 
_poll(self)
Called often by twisted.reactor to poll the OSC server.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, port=1234, interval=0.01)
(Constructor)

source code 

:param interval: duration in seconds to wait between each poll

Overrides: object.__init__

add_callback(self, addr, types, callback, *args)

source code 

Adds a callback for an OSC message.

:param addr: URL-like OSC address/pattern :param type: string that enumerates the OSC types the method accepts :param callback: pointer to a python function or method :param args: List of any number of user data.

What liblo does is to check for matching callbacks in the order they were registered, and when a match is found, the callback function is called immediately. This means that, if the fallback is to be called only when nothing else matches, it needs to be registered last.