comparison bin/keyboardcomposer @ 1633:eccbc249fee7

fix KC launch bug. log corrupt settings and move on. Ignore-this: 343e3a38e37b281cf807172f75aece87
author Drew Perttula <drewp@bigasterisk.com>
date Sat, 10 Jun 2017 03:11:57 +0000
parents 0e746743dd0f
children 5849146f4eb4
comparison
equal deleted inserted replaced
1632:a0fc6f957323 1633:eccbc249fee7
19 from light9.tkdnd import initTkdnd, dragSourceRegister, dropTargetRegister 19 from light9.tkdnd import initTkdnd, dragSourceRegister, dropTargetRegister
20 from light9.rdfdb import clientsession 20 from light9.rdfdb import clientsession
21 from light9.rdfdb.syncedgraph import SyncedGraph 21 from light9.rdfdb.syncedgraph import SyncedGraph
22 from light9.effect.sequencer import CodeWatcher 22 from light9.effect.sequencer import CodeWatcher
23 import light9.effect.effecteval 23 import light9.effect.effecteval
24 from light9.effect.settings import DeviceSettings
24 25
25 from bcf2000 import BCF2000 26 from bcf2000 import BCF2000
26 27
27 nudge_keys = { 28 nudge_keys = {
28 'up' : list('qwertyui'), 29 'up' : list('qwertyui'),
67 self.session = session 68 self.session = session
68 self.col, self.row = col, row 69 self.col, self.row = col, row
69 bg = self.graph.value(sub, L9.color, default='#000000') 70 bg = self.graph.value(sub, L9.color, default='#000000')
70 rgb = webcolors.hex_to_rgb(bg) 71 rgb = webcolors.hex_to_rgb(bg)
71 hsv = colorsys.rgb_to_hsv(*[x/255 for x in rgb]) 72 hsv = colorsys.rgb_to_hsv(*[x/255 for x in rgb])
72 darkBg = webcolors.rgb_to_hex(tuple([x * 255 for x in colorsys.hsv_to_rgb( 73 darkBg = webcolors.rgb_to_hex(tuple([int(x * 255) for x in colorsys.hsv_to_rgb(
73 hsv[0], hsv[1], .2)])) 74 hsv[0], hsv[1], .2)]))
74 tk.Frame.__init__(self, master, bd=1, relief='raised', bg=bg) 75 tk.Frame.__init__(self, master, bd=1, relief='raised', bg=bg)
75 self.name = self.graph.label(sub) 76 self.name = self.graph.label(sub)
76 self.slider_var = tk.DoubleVar() 77 self.slider_var = tk.DoubleVar()
77 self.pauseTrace = False 78 self.pauseTrace = False
455 for setting in graph.objects(self.session, L9['subSetting']): 456 for setting in graph.objects(self.session, L9['subSetting']):
456 effect = graph.value(setting, L9['sub']) 457 effect = graph.value(setting, L9['sub'])
457 strength = graph.value(setting, L9['level']) 458 strength = graph.value(setting, L9['level'])
458 if strength: 459 if strength:
459 now = time.time() 460 now = time.time()
460 outputSettings.extend( 461 outputSettings.append(
461 self.effectEval[effect].outputFromEffect( 462 self.effectEval[effect].outputFromEffect(
462 [(L9['strength'], strength)], 463 [(L9['strength'], strength)],
463 songTime=now, 464 songTime=now,
464 # should be counting from when you bumped up from 0 465 # should be counting from when you bumped up from 0
465 noteTime=now)) 466 noteTime=now))
466 467
467 return outputSettings 468 return DeviceSettings.fromList(graph, outputSettings)
468 469
469 def save_current_stage(self, subname): 470 def save_current_stage(self, subname):
470 raise NotImplementedError 471 raise NotImplementedError
471 log.info("saving current levels as %s", subname) 472 log.info("saving current levels as %s", subname)
472 with self.graph.currentState() as current: 473 with self.graph.currentState() as current: