diff options
author | MaZderMind <github@mazdermind.de> | 2015-06-16 16:59:04 +0200 |
---|---|---|
committer | MaZderMind <github@mazdermind.de> | 2015-06-16 16:59:04 +0200 |
commit | c69b7397171e49221a42c0c49154d29722d38af0 (patch) | |
tree | a2dd956c6d9e4597be70a4bd792e7356f8387f17 /voctocore/lib/commands.py | |
parent | 8e2359d8ed6b17fc6cad99d617c889c754eb44c1 (diff) |
Implement Stream-Blanker
Diffstat (limited to 'voctocore/lib/commands.py')
-rw-r--r-- | voctocore/lib/commands.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/voctocore/lib/commands.py b/voctocore/lib/commands.py index c16358b..f0b8011 100644 --- a/voctocore/lib/commands.py +++ b/voctocore/lib/commands.py @@ -10,6 +10,7 @@ class ControlServerCommands(): self.pipeline = pipeline self.sources = Config.getlist('mix', 'sources') + self.blankersources = Config.getlist('stream-blanker', 'sources') def decodeSourceName(self, src_name_or_id): if isinstance(src_name_or_id, str): @@ -21,6 +22,16 @@ class ControlServerCommands(): if src_name_or_id < 0 or src_name_or_id >= len(self.sources): raise IndexError("source %s unknown" % src_name_or_id) + def decodeBlankerSourceName(self, src_name_or_id): + if isinstance(src_name_or_id, str): + try: + return self.blankersources.index(src_name_or_id) + except Exception as e: + raise IndexError("source %s unknown" % src_name_or_id) + + if src_name_or_id < 0 or src_name_or_id >= len(self.blankersources): + raise IndexError("source %s unknown" % src_name_or_id) + def message(self, *args): return True @@ -48,3 +59,12 @@ class ControlServerCommands(): self.pipeline.vmix.setCompositeMode(mode) return True + + def set_stream_blank(self, src_name_or_id): + src_id = self.decodeBlankerSourceName(src_name_or_id) + self.pipeline.streamblanker.setBlankSource(src_id) + return True + + def set_stream_live(self): + self.pipeline.streamblanker.setBlankSource(None) + return True |