本文整理汇总了Python中OSC.OSCMessage.getBinary方法的典型用法代码示例。如果您正苦于以下问题:Python OSCMessage.getBinary方法的具体用法?Python OSCMessage.getBinary怎么用?Python OSCMessage.getBinary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OSC.OSCMessage
的用法示例。
在下文中一共展示了OSCMessage.getBinary方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sendMsg
# 需要导入模块: from OSC import OSCMessage [as 别名]
# 或者: from OSC.OSCMessage import getBinary [as 别名]
def sendMsg(self,msg,*args):
packetNumber = self.getPacketNumber()
print "Sending %r (#%i)..." % (msg,packetNumber)
omcall = Call()
omcall.result = None
omcall.done = False
self.calls[packetNumber] = omcall
message = OSCMessage()
message.setAddress(msg)
message.append(packetNumber)
for arg in args:
message.append(arg)
self.transport.write(message.getBinary())
time.sleep(0.01)
return True
示例2: sendMsgBlocking
# 需要导入模块: from OSC import OSCMessage [as 别名]
# 或者: from OSC.OSCMessage import getBinary [as 别名]
def sendMsgBlocking(self,msg,*args):
packetNumber = self.getPacketNumber()
print "Sending %r (#%i)..." % (msg,packetNumber)
omcall = Call()
omcall.result = None
omcall.done = False
self.calls[packetNumber] = omcall
message = OSCMessage()
message.setAddress(msg)
message.append(packetNumber)
for arg in args:
message.append(arg)
self.transport.write(message.getBinary())
now = time.time()
while not omcall.done:
time.sleep(INGEN_CALL_POLLTIME)
distance = time.time() - now
if distance > INGEN_CALL_TIMEOUT:
print "timeout"
break
del self.calls[packetNumber]
return omcall.result