|
@@ -1,8 +1,74 @@
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
+class ValueBuffer():
|
|
|
+ def __init__(self,val=2,_min=0,_max=255,_inc=1):
|
|
|
+ self._value = val
|
|
|
+ self._on = _inc
|
|
|
+ self._inc = 0.1
|
|
|
+ self._min=_min
|
|
|
+ self._max=_max
|
|
|
+ print(self,val)
|
|
|
+ def check(self):
|
|
|
+ print(":::",self,self._value,self._min,self._max)
|
|
|
+ if self._value < self._min:
|
|
|
+ self._value = self._min
|
|
|
+ print(self,"MIN !")
|
|
|
+ if self._value > self._max:
|
|
|
+ self._value = self._max
|
|
|
+ print(self,"MAX !")
|
|
|
+
|
|
|
+ def dec(self,value=None):
|
|
|
+ if value is None:
|
|
|
+ value = self._inc
|
|
|
+ if type(value) is float:
|
|
|
+ value = round(value,4)
|
|
|
+ self._value -= value
|
|
|
+ self.check()
|
|
|
+ return self._value
|
|
|
+
|
|
|
+ def inc(self,value=None):
|
|
|
+ if value is None:
|
|
|
+ value = self._inc
|
|
|
+ if type(value) is float:
|
|
|
+ value = round(value,4)
|
|
|
+ self._value += value
|
|
|
+ self.check()
|
|
|
+ return self._value
|
|
|
+
|
|
|
+ def val(self,value=None):
|
|
|
+ if value is None:
|
|
|
+ return float(self._value)
|
|
|
+
|
|
|
+ if type(value) is float:
|
|
|
+ self._value = round(value,4)
|
|
|
+ self._value = value
|
|
|
+ self.check()
|
|
|
+ return float(self._value)
|
|
|
+
|
|
|
+ def on(self):
|
|
|
+ self._on = 1
|
|
|
+
|
|
|
+ def off(self):
|
|
|
+ self._on = 0
|
|
|
+
|
|
|
+ def _is(self):
|
|
|
+ if self._on:
|
|
|
+ return 1
|
|
|
+ return 0
|
|
|
+
|
|
|
+FADE = ValueBuffer(val=2) #2 #0.1 #1.13
|
|
|
+DELAY = ValueBuffer(val=0.2,_min=-10,_max=10,_inc=0.1)
|
|
|
+DELAY.off()
|
|
|
+
|
|
|
+FADE_move = ValueBuffer(val=4.0) #2 #0.1 #1.13
|
|
|
+FADE_move_delay = ValueBuffer(val=0) #2 #0.1 #1.13
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
class Elem_Container():
|
|
|
def __init__(self):
|
|
|
- self.commands = []
|
|
|
+ #self.commands = []
|
|
|
+ self.labels = []
|
|
|
self.val = {}
|
|
|
self.elem = {}
|
|
|
|
|
@@ -10,7 +76,7 @@ fx_prm_main = {}
|
|
|
fx_prm_move = {"SIZE":40,"SPEED":8,"OFFSET":100,"BASE":"0","START":0,"MODE":0,"MO":0,"DIR":1,"INVERT":0,"WING":2,"WIDTH":100}
|
|
|
fx_prm_3 = {"SIZE":40,"SPEED":8,"OFFSET":100,"BASE":"0","START":0,"MODE":0,"MO":0,"DIR":1,"INVERT":0,"WING":2,"WIDTH":100}
|
|
|
|
|
|
-fx_color = {"A":"red","B":"blue"}
|
|
|
+#fx_color = {"A":"red","B":"blue"}
|
|
|
fx_prm = {"SIZE":255,"SPEED":10,"OFFSET":100,"BASE":"-","START":0,"MODE":0,"MO":0,"DIR":1,"INVERT":1,"SHUFFLE":0,"WING":2,"WIDTH":25,"2D-X":1,"2D:MODE":0}
|
|
|
fx_x_modes = ["spiral","left","right","up","down","left_right","up_down"]
|
|
|
|
|
@@ -20,18 +86,18 @@ fx_mo = ["fade","on","rnd","ramp","ramp2","cosinus","sinus","static"]
|
|
|
|
|
|
# MASTER --------
|
|
|
setup = Elem_Container()
|
|
|
-setup.commands = ["SAVE\nSHOW","LOAD\nSHOW","NEW\nSHOW","SAVE\nSHOW AS","SAVE &\nRESTART","DRAW\nGUI","PRO\nMODE"]
|
|
|
-setup.commands = ["SAVE\nSHOW","LOAD\nSHOW","NEW\nSHOW","SAVE\nSHOW AS","SAVE &\nRESTART","PRO\nMODE"]
|
|
|
+#setup.labels = ["SAVE\nSHOW","LOAD\nSHOW","NEW\nSHOW","SAVE\nSHOW AS","SAVE &\nRESTART","DRAW\nGUI","PRO\nMODE"]
|
|
|
+setup.labels = ["SAVE\nSHOW","LOAD\nSHOW","NEW\nSHOW","SAVE\nSHOW AS","SAVE &\nRESTART","PRO\nMODE"]
|
|
|
|
|
|
fx_main = Elem_Container()
|
|
|
-fx_main.commands =["REC-FX","FX OFF","\n"]
|
|
|
+fx_main.labels =["REC-FX","FX OFF","\n"]
|
|
|
fx_moves = Elem_Container()
|
|
|
-fx_moves.commands =[
|
|
|
+fx_moves.labels =[
|
|
|
"FX:CIR","FX:PAN","FX:TILT", "WIDTH:\n100","DIR:\n0","INVERT:\n0","\n",
|
|
|
"SHUFFLE:\n0","SIZE:\n","SPEED:\n","START:\n","OFFSET:\n","\n"
|
|
|
]
|
|
|
fx_3 = Elem_Container()
|
|
|
-fx_3.commands =[
|
|
|
+fx_3.labels =[
|
|
|
"FX:ATTR","PAN","TILT","ATTR3","ATTR4","\n",
|
|
|
"TYPE:","SIN","COS"," "," ","\n",
|
|
|
"WIDTH:","25","25","25","25","\n",
|
|
@@ -50,19 +116,19 @@ fx_3.commands =[
|
|
|
]
|
|
|
#, "FX:SIN","FX:COS","FX:RAMP","FX:RAMP2","FX:FD","FX:ON","BASE:\n-"] #,"FX:RND" ]
|
|
|
|
|
|
-fx = Elem_Container()
|
|
|
-fx.commands =[
|
|
|
+fx_cfg = Elem_Container()
|
|
|
+fx_cfg.labels =[
|
|
|
"FX:DIM"," ", "WIDTH:\n25","WING:\n2","DIR:\n1","INVERT:\n1","\n","SHUFFLE:\n0"
|
|
|
,"SIZE:\n","SPEED:\n","START:\n","OFFSET:\n","BASE:\n-","2D-X:\n-","2D:MODE"
|
|
|
]
|
|
|
fx_generic = Elem_Container()
|
|
|
-fx_generic.commands =["FX:SIN","FX:COS","FX:RAMP","FX:RAMP2","FX:FD","FX:ON","FX:STATIC"]
|
|
|
+fx_generic.labels =["FX:SIN","FX:COS","FX:RAMP","FX:RAMP2","FX:FD","FX:ON","FX:STATIC"]
|
|
|
|
|
|
fx_color = Elem_Container()
|
|
|
-fx_color.commands =["FX:RED","FX-C:A","FX-C:B"]
|
|
|
+fx_color.labels =["FX:RED","FX-C:A","FX-C:B"]
|
|
|
|
|
|
commands = Elem_Container()
|
|
|
-commands.commands =["\n","ESC","CFG-BTN","LABEL","-","DEL","-","\n"
|
|
|
+commands.labels =["\n","ESC","CFG-BTN","LABEL","-","DEL","-","\n"
|
|
|
,"SELECT","FLASH","GO","-","MOVE","S-KEY","\n"
|
|
|
,"BLIND","CLEAR","REC","EDIT","COPY",".","\n"
|
|
|
]
|