Logo Search packages:      
Sourcecode: scenic version File versions  Download package

def scenic::gui::Gui::update_v4l2_inputs_size_and_norm (   self )
Called when : 
 * user chooses a different video source.
If the selected is not a V4L2, disables the input and norm widgets.

Definition at line 1394 of file gui.py.

                                              :
        """
        Called when : 
         * user chooses a different video source.
        If the selected is not a V4L2, disables the input and norm widgets.
        """
        value = _get_combobox_value(self.video_source_widget)
        self._widgets_changed_by_user = False
        # change choices and value:
        if value == VIDEO_TEST_INPUT:
            # INPUTS:
            self.v4l2_input_widget.set_sensitive(False)
            self.v4l2_input_widget.set_active(-1)
            # STANDARD:
            self.v4l2_standard_widget.set_sensitive(False)
            self.v4l2_standard_widget.set_active(-1)
            # SIZE:
            _set_combobox_choices(self.video_capture_size_widget, ALL_SUPPORTED_SIZE)
        else:
            # INPUTS:
            current_camera_name = _get_combobox_value(self.video_source_widget)
            cam = self.app.parse_v4l2_device_name(current_camera_name)
            if cam is None:
                log.warning("v4l2 device is none !! %s" % (current_camera_name))
                # INPUTS:
                self.v4l2_input_widget.set_sensitive(False)
                self.v4l2_input_widget.set_active(-1)
                # STANDARD:
                self.v4l2_standard_widget.set_sensitive(False)
                self.v4l2_standard_widget.set_active(-1)
                # SIZE:
                _set_combobox_choices(self.video_capture_size_widget, ALL_SUPPORTED_SIZE)
            else:
                current_input = cam["input"]
                if current_input is not None: # check if device has many inputs
                    self.v4l2_input_widget.set_sensitive(True)
                    _set_combobox_choices(self.v4l2_input_widget, cam["inputs"])
                    _set_combobox_value(self.v4l2_input_widget, cam["inputs"][current_input]) # which in turn calls on_v4l2_input_changed
                else:
                    self.v4l2_input_widget.set_sensitive(False)
                    self.v4l2_input_widget.set_active(-1)
                
                # STANDARD: 
                current_standard = cam["standard"]
                if current_standard is not None: # check if device supports different standards
                    self.v4l2_standard_widget.set_sensitive(True)
                    _set_combobox_choices(self.v4l2_standard_widget, VIDEO_STANDARDS)
                    _set_combobox_value(self.v4l2_standard_widget, cam["standard"]) # which in turn calls on_v4l2_standard_changed
                else:
                    self.v4l2_standard_widget.set_sensitive(False)
                    self.v4l2_standard_widget.set_active(-1)
                #self.v4l2_standard_widget.set_sensitive(True)
                # SIZE:
                log.debug("supported sizes: %s" % (cam["supported_sizes"]))
                _set_combobox_choices(self.video_capture_size_widget, cam["supported_sizes"]) # TODO: more test sizes
        # once done:
        self._widgets_changed_by_user = True
            

Generated by  Doxygen 1.6.0   Back to index