diff options
author | MaZderMind <git@mazdermind.de> | 2015-11-15 14:43:14 +0100 |
---|---|---|
committer | MaZderMind <git@mazdermind.de> | 2015-11-15 14:45:30 +0100 |
commit | 1d4604a089e0715ca438235fec5088ce93821614 (patch) | |
tree | 1a3e80aa04ba7a74d366d1294c59373fd0d7ea94 /voctocore | |
parent | d61571d7f81b867625ad0dfc62c410ba5bad06af (diff) |
Add a Command to set video-sources and composition-mode at the same time, #11
Diffstat (limited to 'voctocore')
-rw-r--r-- | voctocore/README.md | 4 | ||||
-rw-r--r-- | voctocore/lib/commands.py | 21 |
2 files changed, 25 insertions, 0 deletions
diff --git a/voctocore/README.md b/voctocore/README.md index 2354f94..a15fead 100644 --- a/voctocore/README.md +++ b/voctocore/README.md @@ -91,6 +91,10 @@ When another Client issues a Command and the Server executed it successfully, th < set_composite 0 > composite_mode fullscreen +< set_videos_and_composite grabber * fullscreen +> video_status grabber cam1 +> composite_mode fullscreen + < get_video > video_status cam2 cam1 diff --git a/voctocore/lib/commands.py b/voctocore/lib/commands.py index 10fb90c..21b8de8 100644 --- a/voctocore/lib/commands.py +++ b/voctocore/lib/commands.py @@ -119,6 +119,27 @@ class ControlServerCommands(object): status = self._get_composite_status() return NotifyResponse('composite_mode', status) + def set_videos_and_composite(self, src_a_name_or_id, src_b_name_or_id, mode_name_or_id): + if src_a_name_or_id != '*': + src_a_id = decodeName(self.sources, src_a_name_or_id) + self.pipeline.vmix.setVideoSourceA(src_a_id) + + if src_b_name_or_id != '*': + src_b_id = decodeName(self.sources, src_b_name_or_id) + self.pipeline.vmix.setVideoSourceB(src_b_id) + + if mode_name_or_id != '*': + mode = decodeEnumName(CompositeModes, mode_name_or_id) + self.pipeline.vmix.setCompositeMode(mode) + + composite_status = self._get_composite_status() + video_status = self._get_video_status() + + return [ + NotifyResponse('composite_mode', composite_status), + NotifyResponse('video_status', *video_status) + ] + def _get_stream_status(self): blankSource = self.pipeline.streamblanker.blankSource |