htt-video/python/scenechanger.py

15 lines
318 B
Python
Raw Normal View History

2014-04-09 23:13:17 +02:00
#!/bin/env python2
2014-06-07 17:56:17 +02:00
class SceneChanger(object):
2014-04-09 23:13:17 +02:00
2014-06-07 17:56:17 +02:00
def __init__(self, socket):
2014-04-09 23:13:17 +02:00
self.cur_scene = 1
2014-06-07 17:56:17 +02:00
self.snowmix_socket = socket
2014-04-09 23:13:17 +02:00
def switch_to(self, next_scene):
if self.cur_scene != next_scene:
cmd = "Swap%d%d\n" % (self.cur_scene, next_scene)
self.snowmix_socket.send(cmd)
self.cur_scene = next_scene