コード例 #1
0
ファイル: move_mouse.py プロジェクト: honnet/twiz-move-mouse
def main():
    init()
    oscid = listen(port=10001)
    bind(oscid, update_mouse, '/update')

    while True:
        readQueue(oscid)
コード例 #2
0
    def __init__(self, mbHost="localhost",
                 oscOutHost="localhost", oscOutPort=9000,
                 oscInPort=9001,
                 mbPattern=None):
	MessageBoard.SimpleMessageHandler.__init__(self)
        oscAPI.init()
	self.oscInPort = oscInPort
	self.oscOutPort = oscOutPort
	self.oscOutHost = oscOutHost
        self.mbPortal = MessageBoard.MessageClient(mbHost)
	self.oscInSocket = createListener("localhost", oscInPort)
	if mbPattern:
	    self.mbPortal.registerMessageHandler(self, mbPattern)
	else:
	    self.mbPortal.registerMessageHandler(self)
コード例 #3
0
import oscAPI


def sendMessageToOSC(msg, host="localhost", port=9000):
    args = []
    for key in msg.keys():
        args.append(key)
        args.append(msg[key])
    print "args:", args
    oscAPI.sendMsg("/messageBoardGateway", args, host, port)


if __name__ == "__main__":
    oscAPI.init()
    msg = {"msgType": "test.type1", "num": 3}
    sendMessageToOSC(msg, "localhost", 9001)