示例#1
0
    def set_videos_and_composite(self, src_a_name, src_b_name, mode_name):
        """sets the A- and the B-source synchronously with the composition-mode
           all parametets can be set to "*" which will leave them unchanged."""
        if src_a_name != '*':
            src_a_id = self.sources.index(src_a_name)
            self.pipeline.vmix.setVideoSourceA(src_a_id)

        if src_b_name != '*':
            src_b_id = self.sources.index(src_b_name)
            self.pipeline.vmix.setVideoSourceB(src_b_id)

        if mode_name != '*':
            mode = CompositeModes[mode_name]
            called_with_source = \
                src_a_name != '*' or \
                src_b_name != '*'

            self.pipeline.vmix.setCompositeMode(
                mode, apply_default_source=not called_with_source)

        composite_status = self._get_composite_status()
        video_status = self._get_video_status()

        return [
            NotifyResponse('composite_mode', composite_status),
            NotifyResponse('video_status', *video_status),
            NotifyResponse('composite_mode_and_video_status', composite_status,
                           *video_status),
        ]
示例#2
0
    def set_composite_mode(self, mode_name_or_id):
        """sets the name of the id of the composite-mode"""
        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)
        ]
示例#3
0
    def set_composite_mode(self, mode_name):
        """sets the name of the id of the composite-mode"""
        mode = CompositeModes[mode_name]
        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),
            NotifyResponse('composite_mode_and_video_status', composite_status,
                           *video_status),
        ]
示例#4
0
    def set_audio(self, src_name):
        """sets the audio-source to the supplied source-name or source-id"""
        src_id = self.sources.index(src_name)
        self.pipeline.amix.setAudioSource(src_id)

        status = self._get_audio_status()
        return NotifyResponse('audio_status', status)
示例#5
0
        def set_stream_blank(self, source_name):
            """sets the streamblanker-status to blank with the specified
               blanker-source-name or -id"""
            src_id = self.blankerSources.index(source_name)
            self.pipeline.streamblanker.setBlankSource(src_id)

            status = self._get_stream_status()
            return NotifyResponse('stream_status', *status)
示例#6
0
 def store_value(self, key, *args):
     """stores a value from a user-defined script in voctomix' memory.
     setting a value triggers a 'value'-broadcast.
     the value can be later retrieved using fetch_value.
     does not change the state of the voctocore."""
     value = ' '.join(args)
     self.stored_values[key] = value
     return NotifyResponse('value', key, value)
示例#7
0
    def set_video_b(self, src_name):
        """sets the video-source B to the supplied source-name or source-id,
           swapping A and B if the supplied source is currently used as
           video-source A"""
        src_id = self.sources.index(src_name)
        self.pipeline.vmix.setVideoSourceB(src_id)

        status = self._get_video_status()
        return NotifyResponse('video_status', *status)
示例#8
0
    def set_video_a(self, src_name_or_id):
        """sets the video-source A to the supplied source-name or source-id,
           swapping A and B if the supplied source is currently used as
           video-source B"""
        src_id = decodeName(self.sources, src_name_or_id)
        self.pipeline.vmix.setVideoSourceA(src_id)

        status = self._get_video_status()
        return NotifyResponse('video_status', *status)
示例#9
0
    def set_audio_volume(self, src_name, volume):
        """sets the volume of the supplied source-name or source-id"""
        src_id = self.sources.index(src_name)
        volume = float(volume)
        if volume < 0.0:
            raise ValueError("volume must be positive")
        self.pipeline.amix.setAudioSourceVolume(src_id, volume)

        status = self._get_audio_status()
        return NotifyResponse('audio_status', status)
示例#10
0
    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)
        ]
示例#11
0
    def set_videos_and_composite(self, src_a_name_or_id, src_b_name_or_id,
                                 mode_name_or_id):
        """sets the A- and the B-source synchronously with the composition-mode
           all parametets can be set to "*" which will leave them unchanged."""
        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)
        ]
示例#12
0
    def set_stream_live(self):
        self.pipeline.streamblanker.setBlankSource(None)

        status = self._get_stream_status()
        return NotifyResponse('stream_status', *status)
示例#13
0
    def set_stream_blank(self, source_name_or_id):
        src_id = decodeName(self.blankerSources, source_name_or_id)
        self.pipeline.streamblanker.setBlankSource(src_id)

        status = self._get_stream_status()
        return NotifyResponse('stream_status', *status)
示例#14
0
    def set_composite_mode(self, mode_name_or_id):
        mode = decodeEnumName(CompositeModes, mode_name_or_id)
        self.pipeline.vmix.setCompositeMode(mode)

        status = self._get_composite_status()
        return NotifyResponse('composite_mode', status)
示例#15
0
    def set_audio(self, src_name_or_id):
        src_id = decodeName(self.sources, src_name_or_id)
        self.pipeline.amix.setAudioSource(src_id)

        status = self._get_audio_status()
        return NotifyResponse('audio_status', status)
示例#16
0
 def message(self, *args):
     return NotifyResponse('message', *args)
示例#17
0
    def set_video_b(self, src_name_or_id):
        src_id = decodeName(self.sources, src_name_or_id)
        self.pipeline.vmix.setVideoSourceB(src_id)

        status = self._get_video_status()
        return NotifyResponse('video_status', *status)
示例#18
0
 def message(self, *args):
     """sends a message through the control-server, which can be received by
     user-defined scripts. does not change the state of the voctocore."""
     return NotifyResponse('message', *args)