当前位置: 首页>>代码示例>>Python>>正文


Python OSCMessage.insert方法代码示例

本文整理汇总了Python中OSC.OSCMessage.insert方法的典型用法代码示例。如果您正苦于以下问题:Python OSCMessage.insert方法的具体用法?Python OSCMessage.insert怎么用?Python OSCMessage.insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OSC.OSCMessage的用法示例。


在下文中一共展示了OSCMessage.insert方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: rotary1_callback

# 需要导入模块: from OSC import OSCMessage [as 别名]
# 或者: from OSC.OSCMessage import insert [as 别名]
def rotary1_callback(path, tags, args, source):
	print str(path) + " " + str(args[0])
	json.send({'command':'put', 'key':'rotary1', 'value':'%i' % int(args[0])})
	#create feedback for faders label:	
	msg = OSCMessage("/1/label_rotary1")
	msg.insert(0, int(args[0]))
	client.connect( (source[0], 9000) )
	client.send(msg)
开发者ID:Maadsch,项目名称:LEDita,代码行数:10,代码来源:LEDita_parseOSC.py

示例2: fader_callback

# 需要导入模块: from OSC import OSCMessage [as 别名]
# 或者: from OSC.OSCMessage import insert [as 别名]
def fader_callback(path, tags, args, source):
	global fader1Feedback
	if path=="/1/fader1":
		fader1Feedback = float(args[0])
		msg = OSCMessage("/1/label1")
		msg.insert(0, fader1Feedback)
		print "%i" % fader1Feedback
		json.send({'command':'put', 'key':'D13', 'value':'%i' % (fader1Feedback)})
		client.send(msg)
开发者ID:LeeHewitt,项目名称:TouchOSC-to-control-an-Arduino-Yun,代码行数:11,代码来源:touchosc.py

示例3: multiselectPalette_callback

# 需要导入模块: from OSC import OSCMessage [as 别名]
# 或者: from OSC.OSCMessage import insert [as 别名]
def multiselectPalette_callback(path, tags, args, source):
	print "received: " +repr(source)+ " " + str(path) 
	split = path.split("/")
	Palette = split.pop()
	Palette = split.pop()
	if args[0]==1:
		#requests.get("http://192.168.1.104/arduino/state/"+str(int(state)-1))
		json.send({'command':'put', 'key':'palette', 'value':'%i' % int(int(Palette)-1)})
		msg = OSCMessage(path)
		msg.insert(0, 1)
		client.connect( (source[0], 9000) )
		client.send(msg)
开发者ID:Maadsch,项目名称:LEDita,代码行数:14,代码来源:LEDita_parseOSC.py

示例4: fader2_callback

# 需要导入模块: from OSC import OSCMessage [as 别名]
# 或者: from OSC.OSCMessage import insert [as 别名]
def fader2_callback(path, tags, args, source):
    global fader2Feedback
    if path=="/1/fader2":
        fader2Feedback = int(args[0])
        msg = OSCMessage("/1/label2")
        msg.insert(0, fader2Feedback)
        print "Fader 2 %i" % fader2Feedback
        client.send(msg)
        arduino.write('Y')
        arduino.write('\n')
        arduino.write('%i' % fader2Feedback)
        arduino.write('\n')
开发者ID:christian79,项目名称:OSCar,代码行数:14,代码来源:OSCar.py

示例5: faderFPS_callback

# 需要导入模块: from OSC import OSCMessage [as 别名]
# 或者: from OSC.OSCMessage import insert [as 别名]
def faderFPS_callback(path, tags, args, source):
	global faderFPSFeedback
	if path=="/1/fps":
		#extract parameter:
		faderFPSFeedback = int(args[0])	
		#put parameter to the bridge:	
		json.send({'command':'put', 'key':'fps', 'value':'%i' % (faderFPSFeedback)})	
		#create feedback for faders label:	
		msg = OSCMessage("/1/label_fps")
		msg.insert(0, faderFPSFeedback)
		client.connect( (source[0], 9000) )
		client.send(msg)
		print "received: " +repr(source)+ " " + str(path) 
开发者ID:Maadsch,项目名称:LEDita,代码行数:15,代码来源:LEDita_parseOSC.py

示例6: faderLight_callback

# 需要导入模块: from OSC import OSCMessage [as 别名]
# 或者: from OSC.OSCMessage import insert [as 别名]
def faderLight_callback(path, tags, args, source):
	global faderLightFeedback
	if path=="/1/light":
		#extract parameter:
		faderLightFeedback = int(args[0])
		#put parameter to the bridge:
		json.send({'command':'put', 'key':'brightness', 'value':'%i' % (faderLightFeedback)})		
		print str(path) +" "+ str(faderLightFeedback)
		#create feedback for faders label:
		msg = OSCMessage("/1/label_light")		
		msg.insert(0, faderLightFeedback)
		client.connect( (source[0], 9000) )
		client.send(msg)
开发者ID:Maadsch,项目名称:LEDita,代码行数:15,代码来源:LEDita_parseOSC.py

示例7: fader_callback

# 需要导入模块: from OSC import OSCMessage [as 别名]
# 或者: from OSC.OSCMessage import insert [as 别名]
def fader_callback(path, tags, args, source):
    global fader1Feedback
    if path=="/1/fader1":
        fader1Feedback = int(args[0])
        msg = OSCMessage("/1/label1")
        msg.insert(0, fader1Feedback)
        print "Fader 1 %i" % fader1Feedback
        client.send(msg)
        if (fader1Feedback > 100):
            arduino.write('F')
            arduino.write('\n')
            arduino.write('%i' % fader1Feedback)
            arduino.write('\n')
        if (fader1Feedback < 90):
            arduino.write('B')
            arduino.write('\n')
            arduino.write('%i' % fader1Feedback)
            arduino.write('\n')
        elif ((fader1Feedback < 100) and (fader1Feedback > 90)):
            arduino.write('S')
            arduino.write('\n')
            arduino.write('%i' % fader1Feedback)
            arduino.write('\n')
开发者ID:christian79,项目名称:OSCar,代码行数:25,代码来源:OSCar.py


注:本文中的OSC.OSCMessage.insert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。