/// <summary> /// Create a Converter instance using ConvertConfigure configuration. /// </summary> /// <param name="ConvConfig">ConvertConfigure instance for Converter configuration.</param> public Converter(ConvertConfigure ConvConfig, System.ComponentModel.BackgroundWorker backgroundWorker) { this.ConvConfig = ConvConfig; this.backgroundWorker = backgroundWorker; }
private void okButton_Click(object sender, EventArgs e) { thisConf = Config.Configure.ConvertConfigure; //Match match = Regex.Match(this.newFileSuffixTextBox.Text, @"^[\w\- _]*$"); Match match = Regex.Match(this.newFileSuffixTextBox.Text, @"[<>\|\\/\?\*\:""]+"); Match match2 = Regex.Match(this.newFilePrefixTextBox.Text, @"[<>\|\\/\?\*\:""]+"); if (match.Success | match2.Success) { MessageBox.Show("Invalid characters found in Output File Naming.", "Error"); return; } if (custVFilterTextBox.Text.Contains('-')) { MessageBox.Show("Custom VFilter must not contain dashes.", "Error"); return; } if (custMapTextBox.Text.Contains(' ')) { MessageBox.Show("Custom Mapping must not contain spaces.", "Error"); return; } thisConf.newfilesuffix = this.newFileSuffixTextBox.Text; thisConf.newfileprefix = this.newFilePrefixTextBox.Text; thisConf.format = this.formatComboBox.Text; thisConf.acodec = this.acodecComboBox.Text; thisConf.vcodec = this.vcodecComboBox.Text; thisConf.audiobitkb = int.Parse(this.akbitTextBox.Text); thisConf.videobitkb = int.Parse(this.vkbitTextBox.Text); thisConf.vheight = int.Parse(this.vheightTextBox.Text); thisConf.vwidth = int.Parse(this.vwidthTextBox.Text); thisConf.x264crf = int.Parse(this.x264crfTextBox.Text); thisConf.x264preset = this.x264presetComboBox.Text; thisConf.x264tune = this.x264tuneComboBox.Text; thisConf.externalsubs = this.extSubCheckBox.Checked; thisConf.externalsubsext = this.extSubFormatComboBox.Text; thisConf.useSubFilter = this.subsFilterCheckBox.Checked; thisConf.subindex = int.Parse(this.subIndexTextBox.Text); thisConf.shutdownDevice = this.shutdownCheckBox.Checked; thisConf.showCommands = this.showMessageBoxCheckBox.Checked; //Added for diagnostics thisConf.showFFmpegWindow = this.showFFmpegCheckBox.Checked; //Added for diagnostics thisConf.vscaler = this.vidScalerComboBox.Text; thisConf.customffmpegarg = this.custFFmpegTextBox.Text; thisConf.audioexperimental = this.experAudCodecCheckBox.Checked; thisConf.x264faststart = this.x264fastStartCheckBox.Checked; thisConf.x264level = this.x264levelComboBox.Text; thisConf.x264pretest = this.x264pretestCheckBox.Checked; thisConf.x264offsettime = int.Parse(this.x264offsetTextBox.Text); thisConf.x264outduration = int.Parse(this.x264durationTextBox.Text); thisConf.usex264opts = this.x264optsCheckBox.Checked; thisConf.x264optsarg = this.x264optsTextBox.Text; thisConf.x264fps = this.x264fpsTextBox.Text; thisConf.x264profile = this.h264profileComboBox.Text; thisConf.customx264arg = this.customx264TextBox.Text; thisConf.custommapping = this.custMapTextBox.Text; thisConf.customvfilter = this.custVFilterTextBox.Text; thisConf.audiochannel = int.Parse(this.audchannelTextBox.Text); thisConf.ahrate = this.frequencyTextBox.Text; //Sampling Frequency thisConf.audlangswitch = this.audLangSwitchCheckBox.Checked; thisConf.alanguage = this.langCodeComboBox.Text; thisConf.vresize = this.resizeVidCheckBox.Checked; thisConf.maintainAspectRatio = this.maintainAspectCheckBox.Checked; thisConf.includeVidStreams = this.incVidSCheckBox.Checked; thisConf.includeAudStreams = this.incAudSCheckBox.Checked; thisConf.includeSubStreams = this.incSubSCheckBox.Checked; thisConf.includeAttStreams = this.incAttSCheckBox.Checked; thisConf.includeDatStreams = this.incDatSCheckBox.Checked; //For metadata, etc. Config.writeConfiguration(); this.Close(); }
private void InitializeConfiguration(ConvertConfigure ConvertConfigure) { this.newFileSuffixTextBox.Text = ConvertConfigure.newfilesuffix; this.newFilePrefixTextBox.Text = ConvertConfigure.newfileprefix; this.formatComboBox.Text = ConvertConfigure.format; this.acodecComboBox.Text = ConvertConfigure.acodec; this.vcodecComboBox.Text = ConvertConfigure.vcodec; this.akbitTextBox.Text = ConvertConfigure.audiobitkb.ToString(); this.vkbitTextBox.Text = ConvertConfigure.videobitkb.ToString(); this.vheightTextBox.Text = ConvertConfigure.vheight.ToString(); this.vwidthTextBox.Text = ConvertConfigure.vwidth.ToString(); this.x264crfTextBox.Text = ConvertConfigure.x264crf.ToString(); this.x264presetComboBox.Text = ConvertConfigure.x264preset; this.x264tuneComboBox.Text = ConvertConfigure.x264tune; this.extSubCheckBox.Checked = ConvertConfigure.externalsubs; this.extSubFormatComboBox.Text = ConvertConfigure.externalsubsext; this.subsFilterCheckBox.Checked = ConvertConfigure.useSubFilter; this.subIndexTextBox.Text = ConvertConfigure.subindex.ToString(); this.shutdownCheckBox.Checked = ConvertConfigure.shutdownDevice; this.showMessageBoxCheckBox.Checked = ConvertConfigure.showCommands; //Added for diagnostics this.showFFmpegCheckBox.Checked = ConvertConfigure.showFFmpegWindow; //Added for diagnostics this.vidScalerComboBox.Text = ConvertConfigure.vscaler; this.custFFmpegTextBox.Text = ConvertConfigure.customffmpegarg; this.experAudCodecCheckBox.Checked = ConvertConfigure.audioexperimental; this.x264fastStartCheckBox.Checked = ConvertConfigure.x264faststart; this.x264levelComboBox.Text = ConvertConfigure.x264level; this.x264pretestCheckBox.Checked = ConvertConfigure.x264pretest; this.x264offsetTextBox.Text = ConvertConfigure.x264offsettime.ToString(); this.x264durationTextBox.Text = ConvertConfigure.x264outduration.ToString(); this.x264optsCheckBox.Checked = ConvertConfigure.usex264opts; this.x264optsTextBox.Text = ConvertConfigure.x264optsarg; this.x264fpsTextBox.Text = ConvertConfigure.x264fps.ToString(); this.h264profileComboBox.Text = ConvertConfigure.x264profile; this.customx264TextBox.Text = ConvertConfigure.customx264arg; this.custMapTextBox.Text = ConvertConfigure.custommapping; this.custVFilterTextBox.Text = ConvertConfigure.customvfilter; this.audchannelTextBox.Text = ConvertConfigure.audiochannel.ToString(); this.frequencyTextBox.Text = ConvertConfigure.ahrate; //Sampling Frequency this.audLangSwitchCheckBox.Checked = ConvertConfigure.audlangswitch; this.langCodeComboBox.Text = ConvertConfigure.alanguage; this.maintainAspectCheckBox.Checked = ConvertConfigure.maintainAspectRatio; this.incVidSCheckBox.Checked = ConvertConfigure.includeVidStreams; this.incAudSCheckBox.Checked = ConvertConfigure.includeAudStreams; this.incSubSCheckBox.Checked = ConvertConfigure.includeSubStreams; this.incAttSCheckBox.Checked = ConvertConfigure.includeAttStreams; this.incDatSCheckBox.Checked = ConvertConfigure.includeDatStreams; //For metadata, etc. this.vheightTextBox.Enabled = resizeVidCheckBox.Checked; this.vwidthTextBox.Enabled = resizeVidCheckBox.Checked; this.subIndexTextBox.Enabled = subsFilterCheckBox.Checked; this.extSubFormatComboBox.Enabled = extSubCheckBox.Checked; if (ConvertConfigure.useSubFilter) { this.incSubSCheckBox.Checked = false; this.incAttSCheckBox.Checked = false; } this.resizeVidCheckBox.Checked = ConvertConfigure.vresize; this.maintainAspectCheckBox.Enabled = resizeVidCheckBox.Checked; if (ConvertConfigure.maintainAspectRatio) this.vwidthTextBox.Enabled = false; else this.vwidthTextBox.Enabled = true; //Removed x264optsTextBox toggling as it is no longer necessary this.x264offsetTextBox.Enabled = x264pretestCheckBox.Checked; this.x264durationTextBox.Enabled = x264pretestCheckBox.Checked; this.langCodeComboBox.Enabled = audLangSwitchCheckBox.Checked; }
/// <summary> /// Create a Converter instance using ConvertConfigure configuration. /// </summary> /// <param name="ConvConfig">ConvertConfigure instance for Converter configuration.</param> public Converter(ConvertConfigure ConvConfig, System.ComponentModel.BackgroundWorker backgroundWorker) { this.ConvConfig = ConvConfig; this.backgroundWorker = backgroundWorker; }
private void InitializeConfiguration(ConvertConfigure ConvertConfigure) { this.newFileSuffixTextBox.Text = ConvertConfigure.newfilesuffix; this.newFilePrefixTextBox.Text = ConvertConfigure.newfileprefix; this.formatComboBox.Text = ConvertConfigure.format; this.acodecComboBox.Text = ConvertConfigure.acodec; this.vcodecComboBox.Text = ConvertConfigure.vcodec; this.akbitTextBox.Text = ConvertConfigure.audiobitkb.ToString(); this.vkbitTextBox.Text = ConvertConfigure.videobitkb.ToString(); this.vheightTextBox.Text = ConvertConfigure.vheight.ToString(); this.vwidthTextBox.Text = ConvertConfigure.vwidth.ToString(); this.x264crfTextBox.Text = ConvertConfigure.x264crf.ToString(); this.x264presetComboBox.Text = ConvertConfigure.x264preset; this.x264tuneComboBox.Text = ConvertConfigure.x264tune; this.extSubCheckBox.Checked = ConvertConfigure.externalsubs; this.extSubFormatComboBox.Text = ConvertConfigure.externalsubsext; this.subsFilterCheckBox.Checked = ConvertConfigure.useSubFilter; this.subIndexTextBox.Text = ConvertConfigure.subindex.ToString(); this.shutdownCheckBox.Checked = ConvertConfigure.shutdownDevice; this.showMessageBoxCheckBox.Checked = ConvertConfigure.showCommands; //Added for diagnostics this.showFFmpegCheckBox.Checked = ConvertConfigure.showFFmpegWindow; //Added for diagnostics this.vidScalerComboBox.Text = ConvertConfigure.vscaler; this.custFFmpegTextBox.Text = ConvertConfigure.customffmpegarg; this.experAudCodecCheckBox.Checked = ConvertConfigure.audioexperimental; this.x264fastStartCheckBox.Checked = ConvertConfigure.x264faststart; this.x264levelComboBox.Text = ConvertConfigure.x264level; this.x264pretestCheckBox.Checked = ConvertConfigure.x264pretest; this.x264offsetTextBox.Text = ConvertConfigure.x264offsettime.ToString(); this.x264durationTextBox.Text = ConvertConfigure.x264outduration.ToString(); this.x264optsCheckBox.Checked = ConvertConfigure.usex264opts; this.x264optsTextBox.Text = ConvertConfigure.x264optsarg; this.x264fpsTextBox.Text = ConvertConfigure.x264fps.ToString(); this.h264profileComboBox.Text = ConvertConfigure.x264profile; this.customx264TextBox.Text = ConvertConfigure.customx264arg; this.custMapTextBox.Text = ConvertConfigure.custommapping; this.custVFilterTextBox.Text = ConvertConfigure.customvfilter; this.audchannelTextBox.Text = ConvertConfigure.audiochannel.ToString(); this.frequencyTextBox.Text = ConvertConfigure.ahrate; //Sampling Frequency this.audLangSwitchCheckBox.Checked = ConvertConfigure.audlangswitch; this.langCodeComboBox.Text = ConvertConfigure.alanguage; this.maintainAspectCheckBox.Checked = ConvertConfigure.maintainAspectRatio; this.incVidSCheckBox.Checked = ConvertConfigure.includeVidStreams; this.incAudSCheckBox.Checked = ConvertConfigure.includeAudStreams; this.incSubSCheckBox.Checked = ConvertConfigure.includeSubStreams; this.incAttSCheckBox.Checked = ConvertConfigure.includeAttStreams; this.incDatSCheckBox.Checked = ConvertConfigure.includeDatStreams; //For metadata, etc. this.vheightTextBox.Enabled = resizeVidCheckBox.Checked; this.vwidthTextBox.Enabled = resizeVidCheckBox.Checked; this.subIndexTextBox.Enabled = subsFilterCheckBox.Checked; this.extSubFormatComboBox.Enabled = extSubCheckBox.Checked; if (ConvertConfigure.useSubFilter) { this.incSubSCheckBox.Checked = false; this.incAttSCheckBox.Checked = false; } this.resizeVidCheckBox.Checked = ConvertConfigure.vresize; this.maintainAspectCheckBox.Enabled = resizeVidCheckBox.Checked; if (ConvertConfigure.maintainAspectRatio) { this.vwidthTextBox.Enabled = false; } else { this.vwidthTextBox.Enabled = true; } //Removed x264optsTextBox toggling as it is no longer necessary this.x264offsetTextBox.Enabled = x264pretestCheckBox.Checked; this.x264durationTextBox.Enabled = x264pretestCheckBox.Checked; this.langCodeComboBox.Enabled = audLangSwitchCheckBox.Checked; }
private void okButton_Click(object sender, EventArgs e) { thisConf = Config.Configure.ConvertConfigure; //Match match = Regex.Match(this.newFileSuffixTextBox.Text, @"^[\w\- _]*$"); Match match = Regex.Match(this.newFileSuffixTextBox.Text, @"[<>\|\\/\?\*\:""]+"); Match match2 = Regex.Match(this.newFilePrefixTextBox.Text, @"[<>\|\\/\?\*\:""]+"); if (match.Success | match2.Success) { MessageBox.Show("Invalid characters found in Output File Naming.", "Error"); return; } if (custVFilterTextBox.Text.Contains('-')) { MessageBox.Show("Custom VFilter must not contain dashes.", "Error"); return; } if (custMapTextBox.Text.Contains(' ')) { MessageBox.Show("Custom Mapping must not contain spaces.", "Error"); return; } thisConf.newfilesuffix = this.newFileSuffixTextBox.Text; thisConf.newfileprefix = this.newFilePrefixTextBox.Text; thisConf.format = this.formatComboBox.Text; thisConf.acodec = this.acodecComboBox.Text; thisConf.vcodec = this.vcodecComboBox.Text; thisConf.audiobitkb = int.Parse(this.akbitTextBox.Text); thisConf.videobitkb = int.Parse(this.vkbitTextBox.Text); thisConf.vheight = int.Parse(this.vheightTextBox.Text); thisConf.vwidth = int.Parse(this.vwidthTextBox.Text); thisConf.x264crf = int.Parse(this.x264crfTextBox.Text); thisConf.x264preset = this.x264presetComboBox.Text; thisConf.x264tune = this.x264tuneComboBox.Text; thisConf.externalsubs = this.extSubCheckBox.Checked; thisConf.externalsubsext = this.extSubFormatComboBox.Text; thisConf.useSubFilter = this.subsFilterCheckBox.Checked; thisConf.subindex = int.Parse(this.subIndexTextBox.Text); thisConf.shutdownDevice = this.shutdownCheckBox.Checked; thisConf.showCommands = this.showMessageBoxCheckBox.Checked; //Added for diagnostics thisConf.showFFmpegWindow = this.showFFmpegCheckBox.Checked; //Added for diagnostics thisConf.vscaler = this.vidScalerComboBox.Text; thisConf.customffmpegarg = this.custFFmpegTextBox.Text; thisConf.audioexperimental = this.experAudCodecCheckBox.Checked; thisConf.x264faststart = this.x264fastStartCheckBox.Checked; thisConf.x264level = this.x264levelComboBox.Text; thisConf.x264pretest = this.x264pretestCheckBox.Checked; thisConf.x264offsettime = int.Parse(this.x264offsetTextBox.Text); thisConf.x264outduration = int.Parse(this.x264durationTextBox.Text); thisConf.usex264opts = this.x264optsCheckBox.Checked; thisConf.x264optsarg = this.x264optsTextBox.Text; thisConf.x264fps = this.x264fpsTextBox.Text; thisConf.x264profile = this.h264profileComboBox.Text; thisConf.customx264arg = this.customx264TextBox.Text; thisConf.custommapping = this.custMapTextBox.Text; thisConf.customvfilter = this.custVFilterTextBox.Text; thisConf.audiochannel = int.Parse(this.audchannelTextBox.Text); thisConf.ahrate = this.frequencyTextBox.Text; //Sampling Frequency thisConf.audlangswitch = this.audLangSwitchCheckBox.Checked; thisConf.alanguage = this.langCodeComboBox.Text; thisConf.vresize = this.resizeVidCheckBox.Checked; thisConf.maintainAspectRatio = this.maintainAspectCheckBox.Checked; thisConf.includeVidStreams = this.incVidSCheckBox.Checked; thisConf.includeAudStreams = this.incAudSCheckBox.Checked; thisConf.includeSubStreams = this.incSubSCheckBox.Checked; thisConf.includeAttStreams = this.incAttSCheckBox.Checked; thisConf.includeDatStreams = this.incDatSCheckBox.Checked; //For metadata, etc. Config.writeConfiguration(); this.Close(); }