From cb69d2e1c7ced951cbf7a31ee286b0ed92cab8a8 Mon Sep 17 00:00:00 2001 From: rcoh Date: Fri, 18 Feb 2011 16:56:43 -0500 Subject: Adding Epydoc generated docs. --- html/SmootLight.behaviors.TouchOSC-pysrc.html | 233 ++++++++++++++++++++++++++ 1 file changed, 233 insertions(+) create mode 100644 html/SmootLight.behaviors.TouchOSC-pysrc.html (limited to 'html/SmootLight.behaviors.TouchOSC-pysrc.html') diff --git a/html/SmootLight.behaviors.TouchOSC-pysrc.html b/html/SmootLight.behaviors.TouchOSC-pysrc.html new file mode 100644 index 0000000..4137a70 --- /dev/null +++ b/html/SmootLight.behaviors.TouchOSC-pysrc.html @@ -0,0 +1,233 @@ + + + + + SmootLight.behaviors.TouchOSC + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Package SmootLight :: + Package behaviors :: + Module TouchOSC + + + + + + +
[hide private]
[frames] | no frames]
+
+

Source Code for Module SmootLight.behaviors.TouchOSC

+
+ 1  from operationscore.Behavior import *  
+ 2  from logger import main_log 
+ 3  #import util.ColorOps as color  
+ 4  import colorsys 
+ 5  import pdb 
+ 6  import util.ComponentRegistry as compReg 
+
7 -class TouchOSC(Behavior): +
8 - def behaviorInit(self): +
9 self.h=0 +10 self.s=0 +11 self.v=0 +12 self.xy = (-1,-1) +
13 - def processResponse(self, sensorInputs, recursiveInputs): +
14 ret = [] +15 if sensorInputs: +16 data = sensorInputs[-1]#for data in sensorInputs: +17 if data['Path'] == '/1/fader1': +18 try: +19 self.h = data['Value'][0] +20 except: +21 pdb.set_trace() +22 elif data['Path'] == '/1/fader2': +23 self.s = data['Value'][0] +24 elif data['Path'] == '/1/fader3': +25 self.v = data['Value'][0] +26 elif data['Path'] == '/1/xy': +27 val=data['Value'] +28 ssize = compReg.getComponent('Screen').getSize()[-2:] #896 x 310 +29 self.xy = (val[1]*ssize[0], (1.0-val[0])*ssize[1]) +30 else: +31 main_log.error('Sensor Inputs: ' + str(sensorInputs)) +32 ret.append({'Color':[i*255 for i in colorsys.hsv_to_rgb(self.h,self.s,self.v)],'Location':self.xy}) +33 +34 return (ret, []) +
35 +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + -- cgit v1.2.3