예제 #1
0
 def createAudioNoPreset(self, mgr):
     mgr.prependPreset(
         _("No preset"),
         {
             "depth": int(get_combo_value(self.sample_depth_combo)),
             "channels": int(get_combo_value(self.channels_combo)),
             "sample-rate": int(get_combo_value(self.sample_rate_combo)),
         },
     )
예제 #2
0
 def _addAudioPresetButtonClickedCb(self, button):
     preset_name = self._getUniquePresetName(self.audio_presets)
     self.audio_presets.addPreset(preset_name, {
         "channels": get_combo_value(self.channels_combo),
         "sample-rate": get_combo_value(self.sample_rate_combo),
         "depth": get_combo_value(self.sample_depth_combo)
     })
     self.audio_presets.restorePreset(preset_name)
     self._updateAudioPresetButtons()
예제 #3
0
 def _addAudioPresetButtonClickedCb(self, button):
     preset_name = self._getUniquePresetName(self.audio_presets)
     self.audio_presets.addPreset(
         preset_name, {
             "channels": get_combo_value(self.channels_combo),
             "sample-rate": get_combo_value(self.sample_rate_combo),
             "depth": get_combo_value(self.sample_depth_combo)
         })
     self.audio_presets.restorePreset(preset_name)
     self._updateAudioPresetButtons()
예제 #4
0
    def updateSettings(self):
        width = int(self.width_spinbutton.get_value())
        height = int(self.height_spinbutton.get_value())
        par = self.par_fraction_widget.getWidgetValue()
        frame_rate = self.frame_rate_fraction_widget.getWidgetValue()

        channels = get_combo_value(self.channels_combo)
        sample_rate = get_combo_value(self.sample_rate_combo)
        sample_depth = get_combo_value(self.sample_depth_combo)

        self.settings.setVideoProperties(width, height, frame_rate, par)
        self.settings.setAudioProperties(channels, sample_rate, sample_depth)

        self.project.setSettings(self.settings)
예제 #5
0
 def createVideoNoPreset(self, mgr):
     mgr.prependPreset(
         _("No preset"),
         {
             "par": gst.Fraction(
                 int(get_combo_value(self.par_combo).num), int(get_combo_value(self.par_combo).denom)
             ),
             "frame-rate": gst.Fraction(
                 int(get_combo_value(self.frame_rate_combo).num), int(get_combo_value(self.frame_rate_combo).denom)
             ),
             "height": int(self.height_spinbutton.get_value()),
             "width": int(self.width_spinbutton.get_value()),
         },
     )
예제 #6
0
    def updateSettings(self):
        width = int(self.width_spinbutton.get_value())
        height = int(self.height_spinbutton.get_value())
        par = self.par_fraction_widget.getWidgetValue()
        frame_rate = self.frame_rate_fraction_widget.getWidgetValue()

        channels = get_combo_value(self.channels_combo)
        sample_rate = get_combo_value(self.sample_rate_combo)
        sample_depth = get_combo_value(self.sample_depth_combo)

        self.settings.setVideoProperties(width, height, frame_rate, par)
        self.settings.setAudioProperties(channels, sample_rate, sample_depth)

        self.project.setSettings(self.settings)
예제 #7
0
    def bindCombo(self, mgr, name, widget):
        if name == "container":
            mgr.bindWidget(name,
                lambda x: self.muxer_setter(widget, x),
                lambda: get_combo_value(widget).get_name())

        elif name == "acodec":
            mgr.bindWidget(name,
                lambda x: self.acodec_setter(widget, x),
                lambda: get_combo_value(widget).get_name())

        elif name == "vcodec":
            mgr.bindWidget(name,
                lambda x: self.vcodec_setter(widget, x),
                lambda: get_combo_value(widget).get_name())

        elif name == "depth":
            mgr.bindWidget(name,
                lambda x: self.sample_depth_setter(widget, x),
                lambda: get_combo_value(widget))

        elif name == "sample-rate":
            mgr.bindWidget(name,
                lambda x: self.sample_rate_setter(widget, x),
                lambda: get_combo_value(widget))

        elif name == "channels":
            mgr.bindWidget(name,
                lambda x: self.channels_setter(widget, x),
                lambda: get_combo_value(widget))

        elif name == "frame-rate":
            mgr.bindWidget(name,
                lambda x: self.framerate_setter(widget, x),
                lambda: get_combo_value(widget))
예제 #8
0
    def _elementSettingsDialog(self, combo, settings_attr):
        factory = get_combo_value(combo)
        settings = getattr(self.settings, settings_attr)
        dialog = GstElementSettingsDialog(factory, settings)

        response = dialog.run()
        if response == gtk.RESPONSE_OK:
            setattr(self.settings, settings_attr, dialog.getSettings())
        dialog.destroy()
예제 #9
0
 def createNoPreset(self, mgr):
     mgr.prependPreset(_("No preset"), {
         "depth": int(get_combo_value(self.sample_depth_combo)),
         "channels": int(get_combo_value(self.channels_combo)),
         "sample-rate": int(get_combo_value(self.sample_rate_combo)),
         "acodec": get_combo_value(self.audio_encoder_combo).get_name(),
         "vcodec": get_combo_value(self.video_encoder_combo).get_name(),
         "container": get_combo_value(self.muxercombobox).get_name(),
         "frame-rate": gst.Fraction(int(get_combo_value(self.frame_rate_combo).num),
                                     int(get_combo_value(self.frame_rate_combo).denom)),
         "height": self.getDimension("height"),
         "width": self.getDimension("width")})
예제 #10
0
    def _addRenderPresetButtonClickedCb(self, button):
        preset_name = self._getUniquePresetName(self.render_presets)
        self.render_presets.addPreset(preset_name, {
            "depth": int(get_combo_value(self.sample_depth_combo)),
            "channels": int(get_combo_value(self.channels_combo)),
            "sample-rate": int(get_combo_value(self.sample_rate_combo)),
            "acodec": get_combo_value(self.audio_encoder_combo).get_name(),
            "vcodec": get_combo_value(self.video_encoder_combo).get_name(),
            "container": get_combo_value(self.muxercombobox).get_name(),
            "frame-rate": gst.Fraction(int(get_combo_value(self.frame_rate_combo).num),
                                        int(get_combo_value(self.frame_rate_combo).denom)),
            "height": 0,
            "width": 0})

        self.render_presets.restorePreset(preset_name)
        self._updateRenderPresetButtons()
예제 #11
0
    def _muxerComboChangedCb(self, muxer_combo):
        """Handle the changing of the container format combobox."""
        muxer = get_combo_value(muxer_combo).get_name()
        self.settings.setEncoders(muxer=muxer)

        # Update the extension of the filename.
        basename = os.path.splitext(self.fileentry.get_text())[0]
        self.updateFilename(basename)

        # Update muxer-dependent widgets.
        self.muxer_combo_changing = True
        try:
            self.updateAvailableEncoders()
        finally:
            self.muxer_combo_changing = False
예제 #12
0
    def _muxerComboChangedCb(self, muxer):
        basename = os.path.splitext(self.fileentry.get_text())[0]
        muxer = get_combo_value(muxer).get_name()

        self.settings.setEncoders(muxer=muxer)
        self.updateFilename(basename)

        # update muxer-dependent video widgets
        self.video_encoder_combo.set_model(factorylist(
            self.settings.getVideoEncoders()))
        self.video_encoder_combo.set_active(0)

        # update muxer-dependent audio widgets
        self.audio_encoder_combo.set_model(factorylist(
            self.settings.getAudioEncoders()))
        self.audio_encoder_combo.set_active(0)
예제 #13
0
 def _channelsComboChangedCb(self, combo):
     self.settings.setAudioProperties(nbchanns=get_combo_value(combo))
예제 #14
0
 def _videoEncoderComboChangedCb(self, combo):
     vencoder = get_combo_value(combo).get_name()
     self.settings.setEncoders(vencoder=vencoder)
     if not self.muxer_combo_changing:
         # The user directly changed the video encoder combo.
         self.preferred_vencoder = vencoder
예제 #15
0
 def _frameRateComboChangedCb(self, combo):
     framerate = get_combo_value(combo)
     self.settings.setVideoProperties(framerate=framerate)
예제 #16
0
 def updateParFromCombo(self):
     self.par_fraction_widget.setWidgetValue(get_combo_value(
         self.par_combo))
예제 #17
0
 def _updateFraction(self, unused, fraction, combo):
     fraction.setWidgetValue(get_combo_value(combo))
예제 #18
0
 def _updateFraction(self, unused, fraction, combo):
     fraction.setWidgetValue(get_combo_value(combo))
예제 #19
0
 def bindCombo(self, mgr, name, widget):
     mgr.bindWidget(name,
         lambda x: set_combo_value(widget, x),
         lambda: get_combo_value(widget))
예제 #20
0
 def _videoEncoderComboChangedCb(self, combo):
     name = get_combo_value(combo).get_name()
     self.settings.setEncoders(vencoder=name)
예제 #21
0
 def _audioEncoderChangedComboCb(self, combo):
     aencoder = get_combo_value(combo).get_name()
     self.settings.setEncoders(aencoder=aencoder)
     if not self.muxer_combo_changing:
         # The user directly changed the audio encoder combo.
         self.preferred_aencoder = aencoder
예제 #22
0
 def updateParFromCombo(self):
     self.par_fraction_widget.setWidgetValue(get_combo_value(
         self.par_combo))
예제 #23
0
 def _audioEncoderChangedComboCb(self, combo):
     name = get_combo_value(combo).get_name()
     self.settings.setEncoders(aencoder=name)
예제 #24
0
 def _sampleDepthComboChangedCb(self, combo):
     self.settings.setAudioProperties(depth=get_combo_value(combo))
예제 #25
0
 def _sampleRateComboChangedCb(self, combo):
     self.settings.setAudioProperties(rate=get_combo_value(combo))
예제 #26
0
 def bindCombo(self, mgr, name, widget):
     mgr.bindWidget(name, lambda x: set_combo_value(widget, x),
                    lambda: get_combo_value(widget))
예제 #27
0
 def _audioSettingsButtonClickedCb(self, button):
     factory = get_combo_value(self.audio_encoder_combo)
     self._elementSettingsDialog(factory, 'acodecsettings')
예제 #28
0
 def _addAudioPresetButtonClickedCb(self, button):
     self.audio_presets.addPreset(_("New Preset"), {
         "channels" : get_combo_value(self.channels_combo),
         "sample-rate" : get_combo_value(self.sample_rate_combo),
         "depth" : get_combo_value(self.sample_depth_combo)
     })