本文整理汇总了Python中OSC.OSCServer.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python OSCServer.__init__方法的具体用法?Python OSCServer.__init__怎么用?Python OSCServer.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OSC.OSCServer
的用法示例。
在下文中一共展示了OSCServer.__init__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from OSC import OSCServer [as 别名]
# 或者: from OSC.OSCServer import __init__ [as 别名]
def __init__(self, id, address):
OSCServer.__init__(self, ('', 0))
self.client.connect(address)
host, port = self.client.socket.getsockname()
self.id = id
self.focused = False
self.prefix = GRIDDLE_PREFIX
self.addMsgHandler('default', self.waffle_handler)
self.addMsgHandler('/sys/info', self.sys_misc)
self.addMsgHandler('/sys/connect', self.sys_misc)
self.addMsgHandler('/sys/disconnect', self.sys_misc)
self.addMsgHandler('/sys/id', self.sys_misc)
self.addMsgHandler('/sys/size', self.sys_size)
self.addMsgHandler('/sys/host', self.sys_host)
self.addMsgHandler('/sys/port', self.sys_port)
self.addMsgHandler('/sys/prefix', self.sys_prefix)
self.addMsgHandler('/sys/rotation', self.sys_misc)
self.waffle_send('/sys/host', host)
self.waffle_send('/sys/port', port)
self.waffle_send('/sys/info', host, self.server_address[1])
self.app_callback = None
示例2: __init__
# 需要导入模块: from OSC import OSCServer [as 别名]
# 或者: from OSC.OSCServer import __init__ [as 别名]
def __init__(self, address):
OSCServer.__init__(self, ('', 0))
self.client.connect(address)
host, port = self.client.socket.getsockname()
# print "I believe we have an OSC Server listening on: ",host," ",port
print port
self.focused = False
#self.server_host = host
#self.server_port = port
self.prefix = DEFAULT_PREFIX
self.addMsgHandler('default', self.monome_handler)
self.addMsgHandler('/sys/connect', self.sys_misc)
self.addMsgHandler('/sys/disconnect', self.sys_misc)
self.addMsgHandler('/sys/id', self.sys_misc)
self.addMsgHandler('/sys/size', self.sys_size)
self.addMsgHandler('/sys/host', self.sys_host)
self.addMsgHandler('/sys/port', self.sys_port)
self.addMsgHandler('/sys/prefix', self.sys_prefix)
self.addMsgHandler('/sys/rotation', self.sys_misc)
# handshake
msg = OSCMessage("/sys/host")
msg.append(host)
self.client.send(msg)
msg = OSCMessage("/sys/port")
msg.append(port)
self.client.send(msg)
msg = OSCMessage("/sys/info")
self.client.send(msg)
示例3: __init__
# 需要导入模块: from OSC import OSCServer [as 别名]
# 或者: from OSC.OSCServer import __init__ [as 别名]
def __init__(self, port, gui):
OSCServer.__init__(self, ('localhost', port))
self.app_port = 8000
self.app_host = "localhost"
self.prefix = "/monome"
self.rotation = 0 # FIXME
self.gui = gui
self.register_syscallbacks()
self.register_callbacks(self.prefix)
示例4: __init__
# 需要导入模块: from OSC import OSCServer [as 别名]
# 或者: from OSC.OSCServer import __init__ [as 别名]
def __init__(self, *args, **kwargs):
OSCServer.__init__(self, *args, **kwargs)
self.observers = defaultdict(list)
self.addMsgHandler('default', self.dispatch)
示例5: __init__
# 需要导入模块: from OSC import OSCServer [as 别名]
# 或者: from OSC.OSCServer import __init__ [as 别名]
def __init__(self, address=None, recv_port=default_recv_port):
if address is None:
address = '0.0.0.0'
OSCServer.__init__(self, (address, recv_port))
print('Starting OSC Server at %s on port %s' % (address, recv_port))