def button_cb(self, path, args): # Anti-rebond diff = time() * 1000 - self.timestamp if diff < self.timeout: return self.timestamp = time() * 1000 if _engine.current_subscene() == 9 and args[0] < 12: _engine.switch_scene(args[0]) _engine.switch_subscene(1) # if args[0] == 1: # Rustine car acte 0 sur screen 14 !!! # _engine.output_event(_event.ProgramEvent('PBseq24', _util.NoDataOffset(1), 127)) # else: # _engine.output_event(_event.ProgramEvent('PBseq24', _util.NoDataOffset(1), seq24PageMap[args[0]])) # _engine.output_event(_event.CtrlEvent('PBTapeutape', _util.NoDataOffset(0), 0, args[0]-1)) else: if args[0] == 12: _engine.switch_subscene(9) if args[0] < 12: _engine.output_event(_event.ProgramEvent('PBCtrlOut', _util.NoDataOffset(1), args[0])) if _engine.current_subscene() == 8 and args[0] > 17: _engine.switch_subscene(args[0]-17) else: if args[0] == 24: _engine.switch_subscene(8) if args[0] < 24 and args[0] > 12: _engine.output_event(_event.ProgramEvent('PBCtrlOut', _util.NoDataOffset(1), args[0]))
def button_cb(self, path, args): if args[0] == 12: _engine.switch_subscene(2) if args[0] == 11: _liblo.send(9999, '/video/freeze/toggle') if _engine.current_subscene() == 2: _engine.switch_scene(args[0]) _engine.switch_subscene(1) if _engine.current_subscene() == 1: if args[0] < 8: # Desactivation des boutons 7, 8, 9, 10 clip_number = args[0] + (_engine.current_scene() - 1) * 7 _liblo.send(9999, '/clip/select', clip_number) _liblo.send(9999, '/clip/goto', 1)
def button_cb(self, path, args): if args[0] == 12: _engine.switch_subscene(2) if args[0] == 11: _liblo.send(9999, '/video/freeze/toggle') if _engine.current_subscene() == 2: _engine.switch_scene(args[0]) _engine.switch_subscene(1) if _engine.current_subscene() == 1: if args[0] < 8: # Desactivation des boutons 7, 8, 9, 10 clip_number = args[0] + (_engine.current_scene()-1)*7 _liblo.send(9999, '/clip/select', clip_number) _liblo.send(9999, '/clip/goto', 1)
def on_exit(self): try: f = open(self.memo_file, 'w') f.write("%d %d\n" % (_engine.current_scene(), _engine.current_subscene())) except IOError as ex: print("couldn't store current scene:\n%s" % str(ex))
def next_subscene_cb(self, path, args): s = _engine.scenes()[_engine.current_scene()] n = _util.actual(_engine.current_subscene()) + 1 if len(s[1]) and len(args) and args[0]: n %= len(s[1]) if n < len(s[1]): _engine.switch_subscene(_util.offset(n))
def query_cb(self, path, args): self.send_config() for p in self.notify_ports: _liblo.send(p, '/mididings/current_scene', _engine.current_scene(), _engine.current_subscene())