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)), }, )
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()
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()
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)
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()), }, )
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))
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()
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")})
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()
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
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)
def _channelsComboChangedCb(self, combo): self.settings.setAudioProperties(nbchanns=get_combo_value(combo))
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
def _frameRateComboChangedCb(self, combo): framerate = get_combo_value(combo) self.settings.setVideoProperties(framerate=framerate)
def updateParFromCombo(self): self.par_fraction_widget.setWidgetValue(get_combo_value( self.par_combo))
def _updateFraction(self, unused, fraction, combo): fraction.setWidgetValue(get_combo_value(combo))
def bindCombo(self, mgr, name, widget): mgr.bindWidget(name, lambda x: set_combo_value(widget, x), lambda: get_combo_value(widget))
def _videoEncoderComboChangedCb(self, combo): name = get_combo_value(combo).get_name() self.settings.setEncoders(vencoder=name)
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
def _audioEncoderChangedComboCb(self, combo): name = get_combo_value(combo).get_name() self.settings.setEncoders(aencoder=name)
def _sampleDepthComboChangedCb(self, combo): self.settings.setAudioProperties(depth=get_combo_value(combo))
def _sampleRateComboChangedCb(self, combo): self.settings.setAudioProperties(rate=get_combo_value(combo))
def _audioSettingsButtonClickedCb(self, button): factory = get_combo_value(self.audio_encoder_combo) self._elementSettingsDialog(factory, 'acodecsettings')
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) })