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 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 prev_scene_cb(self, path, args): s = sorted(_engine.scenes().keys()) n = s.index(_engine.current_scene()) - 1 if n >= 0: _engine.switch_scene(s[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())
def next_scene_cb(self, path, args): s = sorted(_engine.scenes().keys()) n = s.index(_engine.current_scene()) + 1 if n < len(s): _engine.switch_scene(s[n])