def _setup_osc(self): self.host = socket.gethostbyname(socket.gethostname()) self._orchestra_queue = [] OscReceiver.__init__(self, port=self.options.port) self.add_method("/register", "i", self._handle_register) self.add_method("/visualizing", "i", self._handle, "_handle_visualizing_message") self.add_method("/set_listener_position", "ff", self._handle, "_handle_set_listener_position") self.add_method("/set_listener_orientation", "f", self._handle, "_handle_set_listener_orientation") self.add_method("/place_segment", "ifff", self._handle, "_handle_place_segment") self.add_method("/enable_smooth_movement", "", self._handle, "_handle_enable_smooth_movement") self.add_method("/start_segment_movement_from_peer", "if", self._handle, "_handle_start_segment_movement_from_peer") self.start() self._num_registered_visualizers = 0 server_thread = threading.Thread(target=self._serve_osc) server_thread.daemon = True server_thread.start()
def __init__(self, port=config.COLOUR_PORT): OscReceiver.__init__(self, port=port, proto=liblo.UDP) self.add_method("/colour", "fff", self._received_colour_message)