From d52c09af5ec633fca89abe631ee1ad3ed8e09ec6 Mon Sep 17 00:00:00 2001 From: Tom van de Graaf Date: Fri, 6 Nov 2015 20:17:31 +0100 Subject: [PATCH 1/5] Added GUI parts. --- src/Forms/BatchConvert.Designer.cs | 118 ++++++++++++++++++++++++++--- 1 file changed, 107 insertions(+), 11 deletions(-) diff --git a/src/Forms/BatchConvert.Designer.cs b/src/Forms/BatchConvert.Designer.cs index 03ed62efa..8c384a3d0 100644 --- a/src/Forms/BatchConvert.Designer.cs +++ b/src/Forms/BatchConvert.Designer.cs @@ -85,14 +85,22 @@ this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.progressBar1 = new System.Windows.Forms.ProgressBar(); this.labelStatus = new System.Windows.Forms.Label(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.numericUpDownPercent = new System.Windows.Forms.NumericUpDown(); + this.labelPercent = new System.Windows.Forms.Label(); + this.radioButtonToDropFrame = new System.Windows.Forms.RadioButton(); + this.radioButtonSpeedFromDropFrame = new System.Windows.Forms.RadioButton(); + this.radioButtonSpeedCustom = new System.Windows.Forms.RadioButton(); this.groupBoxConvertOptions.SuspendLayout(); this.groupBoxChangeFrameRate.SuspendLayout(); this.groupBoxOffsetTimeCodes.SuspendLayout(); this.groupBoxOutput.SuspendLayout(); this.groupBoxInput.SuspendLayout(); this.contextMenuStripFiles.SuspendLayout(); + this.groupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPercent)).BeginInit(); this.SuspendLayout(); - // + // // buttonConvert // this.buttonConvert.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); @@ -118,9 +126,10 @@ this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); // // groupBoxConvertOptions - // - this.groupBoxConvertOptions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + // + this.groupBoxConvertOptions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.groupBoxConvertOptions.Controls.Add(this.groupBox1); this.groupBoxConvertOptions.Controls.Add(this.checkBoxSplitLongLines); this.groupBoxConvertOptions.Controls.Add(this.buttonRemoveTextForHiSettings); this.groupBoxConvertOptions.Controls.Add(this.checkBoxSetMinimumDisplayTimeBetweenSubs); @@ -279,16 +288,16 @@ this.groupBoxOffsetTimeCodes.Controls.Add(this.labelHourMinSecMilliSecond); this.groupBoxOffsetTimeCodes.Location = new System.Drawing.Point(280, 89); this.groupBoxOffsetTimeCodes.Name = "groupBoxOffsetTimeCodes"; - this.groupBoxOffsetTimeCodes.Size = new System.Drawing.Size(239, 115); + this.groupBoxOffsetTimeCodes.Size = new System.Drawing.Size(122, 115); this.groupBoxOffsetTimeCodes.TabIndex = 11; this.groupBoxOffsetTimeCodes.TabStop = false; this.groupBoxOffsetTimeCodes.Text = "Offset time codes"; // // radioButtonShowLater - // + // this.radioButtonShowLater.AutoSize = true; this.radioButtonShowLater.Checked = true; - this.radioButtonShowLater.Location = new System.Drawing.Point(108, 61); + this.radioButtonShowLater.Location = new System.Drawing.Point(9, 89); this.radioButtonShowLater.Name = "radioButtonShowLater"; this.radioButtonShowLater.Size = new System.Drawing.Size(75, 17); this.radioButtonShowLater.TabIndex = 3; @@ -297,9 +306,9 @@ this.radioButtonShowLater.UseVisualStyleBackColor = true; // // radioButtonShowEarlier - // + // this.radioButtonShowEarlier.AutoSize = true; - this.radioButtonShowEarlier.Location = new System.Drawing.Point(108, 38); + this.radioButtonShowEarlier.Location = new System.Drawing.Point(9, 66); this.radioButtonShowEarlier.Name = "radioButtonShowEarlier"; this.radioButtonShowEarlier.Size = new System.Drawing.Size(83, 17); this.radioButtonShowEarlier.TabIndex = 2; @@ -671,9 +680,88 @@ this.labelStatus.Size = new System.Drawing.Size(59, 13); this.labelStatus.TabIndex = 9; this.labelStatus.Text = "labelStatus"; - // + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.radioButtonToDropFrame); + this.groupBox1.Controls.Add(this.radioButtonSpeedFromDropFrame); + this.groupBox1.Controls.Add(this.radioButtonSpeedCustom); + this.groupBox1.Controls.Add(this.numericUpDownPercent); + this.groupBox1.Controls.Add(this.labelPercent); + this.groupBox1.Location = new System.Drawing.Point(408, 89); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(106, 115); + this.groupBox1.TabIndex = 12; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Change speed"; + // + // numericUpDownPercent + // + this.numericUpDownPercent.DecimalPlaces = 5; + this.numericUpDownPercent.Location = new System.Drawing.Point(6, 19); + this.numericUpDownPercent.Maximum = new decimal(new int[] { + 200, + 0, + 0, + 0}); + this.numericUpDownPercent.Minimum = new decimal(new int[] { + 50, + 0, + 0, + 0}); + this.numericUpDownPercent.Name = "numericUpDownPercent"; + this.numericUpDownPercent.Size = new System.Drawing.Size(81, 20); + this.numericUpDownPercent.TabIndex = 0; + this.numericUpDownPercent.Value = new decimal(new int[] { + 100, + 0, + 0, + 0}); + // + // labelPercent + // + this.labelPercent.AutoSize = true; + this.labelPercent.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.labelPercent.Location = new System.Drawing.Point(87, 22); + this.labelPercent.Name = "labelPercent"; + this.labelPercent.Size = new System.Drawing.Size(15, 13); + this.labelPercent.TabIndex = 12; + this.labelPercent.Text = "%"; + // + // radioButtonToDropFrame + // + this.radioButtonToDropFrame.AutoSize = true; + this.radioButtonToDropFrame.Location = new System.Drawing.Point(6, 91); + this.radioButtonToDropFrame.Name = "radioButtonToDropFrame"; + this.radioButtonToDropFrame.Size = new System.Drawing.Size(91, 17); + this.radioButtonToDropFrame.TabIndex = 3; + this.radioButtonToDropFrame.Text = "To drop frame"; + this.radioButtonToDropFrame.UseVisualStyleBackColor = true; + // + // radioButtonSpeedFromDropFrame + // + this.radioButtonSpeedFromDropFrame.AutoSize = true; + this.radioButtonSpeedFromDropFrame.Location = new System.Drawing.Point(6, 68); + this.radioButtonSpeedFromDropFrame.Name = "radioButtonSpeedFromDropFrame"; + this.radioButtonSpeedFromDropFrame.Size = new System.Drawing.Size(101, 17); + this.radioButtonSpeedFromDropFrame.TabIndex = 2; + this.radioButtonSpeedFromDropFrame.Text = "From drop frame"; + this.radioButtonSpeedFromDropFrame.UseVisualStyleBackColor = true; + // + // radioButtonSpeedCustom + // + this.radioButtonSpeedCustom.AutoSize = true; + this.radioButtonSpeedCustom.Checked = true; + this.radioButtonSpeedCustom.Location = new System.Drawing.Point(6, 45); + this.radioButtonSpeedCustom.Name = "radioButtonSpeedCustom"; + this.radioButtonSpeedCustom.Size = new System.Drawing.Size(60, 17); + this.radioButtonSpeedCustom.TabIndex = 1; + this.radioButtonSpeedCustom.TabStop = true; + this.radioButtonSpeedCustom.Text = "Custom"; + this.radioButtonSpeedCustom.UseVisualStyleBackColor = true; + // // BatchConvert - // + // this.AllowDrop = true; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; @@ -702,6 +790,9 @@ this.groupBoxInput.ResumeLayout(false); this.groupBoxInput.PerformLayout(); this.contextMenuStripFiles.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPercent)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -765,6 +856,11 @@ private System.Windows.Forms.Label labelFilter; private System.Windows.Forms.ComboBox comboBoxFilter; private System.Windows.Forms.TextBox textBoxFilter; - + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.NumericUpDown numericUpDownPercent; + private System.Windows.Forms.Label labelPercent; + private System.Windows.Forms.RadioButton radioButtonToDropFrame; + private System.Windows.Forms.RadioButton radioButtonSpeedFromDropFrame; + private System.Windows.Forms.RadioButton radioButtonSpeedCustom; } } \ No newline at end of file From d8d231732f619319edfffb42292ea78d92a4c0e2 Mon Sep 17 00:00:00 2001 From: Tom van de Graaf Date: Fri, 6 Nov 2015 20:20:08 +0100 Subject: [PATCH 2/5] Fixed alignment of the GUI items. --- src/Forms/BatchConvert.Designer.cs | 200 ++++++++++++++--------------- 1 file changed, 100 insertions(+), 100 deletions(-) diff --git a/src/Forms/BatchConvert.Designer.cs b/src/Forms/BatchConvert.Designer.cs index 8c384a3d0..8b8412dec 100644 --- a/src/Forms/BatchConvert.Designer.cs +++ b/src/Forms/BatchConvert.Designer.cs @@ -32,6 +32,12 @@ this.buttonConvert = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button(); this.groupBoxConvertOptions = new System.Windows.Forms.GroupBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.radioButtonToDropFrame = new System.Windows.Forms.RadioButton(); + this.radioButtonSpeedFromDropFrame = new System.Windows.Forms.RadioButton(); + this.radioButtonSpeedCustom = new System.Windows.Forms.RadioButton(); + this.numericUpDownPercent = new System.Windows.Forms.NumericUpDown(); + this.labelPercent = new System.Windows.Forms.Label(); this.checkBoxSplitLongLines = new System.Windows.Forms.CheckBox(); this.buttonRemoveTextForHiSettings = new System.Windows.Forms.Button(); this.checkBoxSetMinimumDisplayTimeBetweenSubs = new System.Windows.Forms.CheckBox(); @@ -85,20 +91,14 @@ this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.progressBar1 = new System.Windows.Forms.ProgressBar(); this.labelStatus = new System.Windows.Forms.Label(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.numericUpDownPercent = new System.Windows.Forms.NumericUpDown(); - this.labelPercent = new System.Windows.Forms.Label(); - this.radioButtonToDropFrame = new System.Windows.Forms.RadioButton(); - this.radioButtonSpeedFromDropFrame = new System.Windows.Forms.RadioButton(); - this.radioButtonSpeedCustom = new System.Windows.Forms.RadioButton(); this.groupBoxConvertOptions.SuspendLayout(); + this.groupBox1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPercent)).BeginInit(); this.groupBoxChangeFrameRate.SuspendLayout(); this.groupBoxOffsetTimeCodes.SuspendLayout(); this.groupBoxOutput.SuspendLayout(); this.groupBoxInput.SuspendLayout(); this.contextMenuStripFiles.SuspendLayout(); - this.groupBox1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPercent)).BeginInit(); this.SuspendLayout(); // // buttonConvert @@ -143,15 +143,94 @@ this.groupBoxConvertOptions.Controls.Add(this.checkBoxFixCasing); this.groupBoxConvertOptions.Controls.Add(this.checkBoxRemoveTextForHI); this.groupBoxConvertOptions.Controls.Add(this.checkBoxRemoveFormatting); - this.groupBoxConvertOptions.Location = new System.Drawing.Point(498, 19); + this.groupBoxConvertOptions.Location = new System.Drawing.Point(473, 19); this.groupBoxConvertOptions.Name = "groupBoxConvertOptions"; - this.groupBoxConvertOptions.Size = new System.Drawing.Size(520, 210); + this.groupBoxConvertOptions.Size = new System.Drawing.Size(545, 210); this.groupBoxConvertOptions.TabIndex = 11; this.groupBoxConvertOptions.TabStop = false; this.groupBoxConvertOptions.Text = "Convert options"; - // + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.radioButtonToDropFrame); + this.groupBox1.Controls.Add(this.radioButtonSpeedFromDropFrame); + this.groupBox1.Controls.Add(this.radioButtonSpeedCustom); + this.groupBox1.Controls.Add(this.numericUpDownPercent); + this.groupBox1.Controls.Add(this.labelPercent); + this.groupBox1.Location = new System.Drawing.Point(429, 89); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(110, 115); + this.groupBox1.TabIndex = 12; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Change speed"; + // + // radioButtonToDropFrame + // + this.radioButtonToDropFrame.AutoSize = true; + this.radioButtonToDropFrame.Location = new System.Drawing.Point(6, 91); + this.radioButtonToDropFrame.Name = "radioButtonToDropFrame"; + this.radioButtonToDropFrame.Size = new System.Drawing.Size(91, 17); + this.radioButtonToDropFrame.TabIndex = 3; + this.radioButtonToDropFrame.Text = "To drop frame"; + this.radioButtonToDropFrame.UseVisualStyleBackColor = true; + // + // radioButtonSpeedFromDropFrame + // + this.radioButtonSpeedFromDropFrame.AutoSize = true; + this.radioButtonSpeedFromDropFrame.Location = new System.Drawing.Point(6, 68); + this.radioButtonSpeedFromDropFrame.Name = "radioButtonSpeedFromDropFrame"; + this.radioButtonSpeedFromDropFrame.Size = new System.Drawing.Size(101, 17); + this.radioButtonSpeedFromDropFrame.TabIndex = 2; + this.radioButtonSpeedFromDropFrame.Text = "From drop frame"; + this.radioButtonSpeedFromDropFrame.UseVisualStyleBackColor = true; + // + // radioButtonSpeedCustom + // + this.radioButtonSpeedCustom.AutoSize = true; + this.radioButtonSpeedCustom.Checked = true; + this.radioButtonSpeedCustom.Location = new System.Drawing.Point(6, 45); + this.radioButtonSpeedCustom.Name = "radioButtonSpeedCustom"; + this.radioButtonSpeedCustom.Size = new System.Drawing.Size(60, 17); + this.radioButtonSpeedCustom.TabIndex = 1; + this.radioButtonSpeedCustom.TabStop = true; + this.radioButtonSpeedCustom.Text = "Custom"; + this.radioButtonSpeedCustom.UseVisualStyleBackColor = true; + // + // numericUpDownPercent + // + this.numericUpDownPercent.DecimalPlaces = 5; + this.numericUpDownPercent.Location = new System.Drawing.Point(6, 19); + this.numericUpDownPercent.Maximum = new decimal(new int[] { + 200, + 0, + 0, + 0}); + this.numericUpDownPercent.Minimum = new decimal(new int[] { + 50, + 0, + 0, + 0}); + this.numericUpDownPercent.Name = "numericUpDownPercent"; + this.numericUpDownPercent.Size = new System.Drawing.Size(81, 20); + this.numericUpDownPercent.TabIndex = 0; + this.numericUpDownPercent.Value = new decimal(new int[] { + 100, + 0, + 0, + 0}); + // + // labelPercent + // + this.labelPercent.AutoSize = true; + this.labelPercent.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.labelPercent.Location = new System.Drawing.Point(87, 22); + this.labelPercent.Name = "labelPercent"; + this.labelPercent.Size = new System.Drawing.Size(15, 13); + this.labelPercent.TabIndex = 12; + this.labelPercent.Text = "%"; + // // checkBoxSplitLongLines - // + // this.checkBoxSplitLongLines.AutoSize = true; this.checkBoxSplitLongLines.Location = new System.Drawing.Point(15, 145); this.checkBoxSplitLongLines.Name = "checkBoxSplitLongLines"; @@ -241,15 +320,15 @@ this.groupBoxChangeFrameRate.Controls.Add(this.labelFromFrameRate); this.groupBoxChangeFrameRate.Location = new System.Drawing.Point(280, 12); this.groupBoxChangeFrameRate.Name = "groupBoxChangeFrameRate"; - this.groupBoxChangeFrameRate.Size = new System.Drawing.Size(239, 73); + this.groupBoxChangeFrameRate.Size = new System.Drawing.Size(259, 73); this.groupBoxChangeFrameRate.TabIndex = 10; this.groupBoxChangeFrameRate.TabStop = false; this.groupBoxChangeFrameRate.Text = "Change frame rate"; // // comboBoxFrameRateTo - // + // this.comboBoxFrameRateTo.FormattingEnabled = true; - this.comboBoxFrameRateTo.Location = new System.Drawing.Point(106, 47); + this.comboBoxFrameRateTo.Location = new System.Drawing.Point(132, 46); this.comboBoxFrameRateTo.Name = "comboBoxFrameRateTo"; this.comboBoxFrameRateTo.Size = new System.Drawing.Size(121, 21); this.comboBoxFrameRateTo.TabIndex = 3; @@ -264,9 +343,9 @@ this.labelToFrameRate.Text = "To frame rate"; // // comboBoxFrameRateFrom - // + // this.comboBoxFrameRateFrom.FormattingEnabled = true; - this.comboBoxFrameRateFrom.Location = new System.Drawing.Point(106, 18); + this.comboBoxFrameRateFrom.Location = new System.Drawing.Point(132, 17); this.comboBoxFrameRateFrom.Name = "comboBoxFrameRateFrom"; this.comboBoxFrameRateFrom.Size = new System.Drawing.Size(121, 21); this.comboBoxFrameRateFrom.TabIndex = 1; @@ -288,7 +367,7 @@ this.groupBoxOffsetTimeCodes.Controls.Add(this.labelHourMinSecMilliSecond); this.groupBoxOffsetTimeCodes.Location = new System.Drawing.Point(280, 89); this.groupBoxOffsetTimeCodes.Name = "groupBoxOffsetTimeCodes"; - this.groupBoxOffsetTimeCodes.Size = new System.Drawing.Size(122, 115); + this.groupBoxOffsetTimeCodes.Size = new System.Drawing.Size(143, 115); this.groupBoxOffsetTimeCodes.TabIndex = 11; this.groupBoxOffsetTimeCodes.TabStop = false; this.groupBoxOffsetTimeCodes.Text = "Offset time codes"; @@ -681,85 +760,6 @@ this.labelStatus.TabIndex = 9; this.labelStatus.Text = "labelStatus"; // - // groupBox1 - // - this.groupBox1.Controls.Add(this.radioButtonToDropFrame); - this.groupBox1.Controls.Add(this.radioButtonSpeedFromDropFrame); - this.groupBox1.Controls.Add(this.radioButtonSpeedCustom); - this.groupBox1.Controls.Add(this.numericUpDownPercent); - this.groupBox1.Controls.Add(this.labelPercent); - this.groupBox1.Location = new System.Drawing.Point(408, 89); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(106, 115); - this.groupBox1.TabIndex = 12; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Change speed"; - // - // numericUpDownPercent - // - this.numericUpDownPercent.DecimalPlaces = 5; - this.numericUpDownPercent.Location = new System.Drawing.Point(6, 19); - this.numericUpDownPercent.Maximum = new decimal(new int[] { - 200, - 0, - 0, - 0}); - this.numericUpDownPercent.Minimum = new decimal(new int[] { - 50, - 0, - 0, - 0}); - this.numericUpDownPercent.Name = "numericUpDownPercent"; - this.numericUpDownPercent.Size = new System.Drawing.Size(81, 20); - this.numericUpDownPercent.TabIndex = 0; - this.numericUpDownPercent.Value = new decimal(new int[] { - 100, - 0, - 0, - 0}); - // - // labelPercent - // - this.labelPercent.AutoSize = true; - this.labelPercent.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.labelPercent.Location = new System.Drawing.Point(87, 22); - this.labelPercent.Name = "labelPercent"; - this.labelPercent.Size = new System.Drawing.Size(15, 13); - this.labelPercent.TabIndex = 12; - this.labelPercent.Text = "%"; - // - // radioButtonToDropFrame - // - this.radioButtonToDropFrame.AutoSize = true; - this.radioButtonToDropFrame.Location = new System.Drawing.Point(6, 91); - this.radioButtonToDropFrame.Name = "radioButtonToDropFrame"; - this.radioButtonToDropFrame.Size = new System.Drawing.Size(91, 17); - this.radioButtonToDropFrame.TabIndex = 3; - this.radioButtonToDropFrame.Text = "To drop frame"; - this.radioButtonToDropFrame.UseVisualStyleBackColor = true; - // - // radioButtonSpeedFromDropFrame - // - this.radioButtonSpeedFromDropFrame.AutoSize = true; - this.radioButtonSpeedFromDropFrame.Location = new System.Drawing.Point(6, 68); - this.radioButtonSpeedFromDropFrame.Name = "radioButtonSpeedFromDropFrame"; - this.radioButtonSpeedFromDropFrame.Size = new System.Drawing.Size(101, 17); - this.radioButtonSpeedFromDropFrame.TabIndex = 2; - this.radioButtonSpeedFromDropFrame.Text = "From drop frame"; - this.radioButtonSpeedFromDropFrame.UseVisualStyleBackColor = true; - // - // radioButtonSpeedCustom - // - this.radioButtonSpeedCustom.AutoSize = true; - this.radioButtonSpeedCustom.Checked = true; - this.radioButtonSpeedCustom.Location = new System.Drawing.Point(6, 45); - this.radioButtonSpeedCustom.Name = "radioButtonSpeedCustom"; - this.radioButtonSpeedCustom.Size = new System.Drawing.Size(60, 17); - this.radioButtonSpeedCustom.TabIndex = 1; - this.radioButtonSpeedCustom.TabStop = true; - this.radioButtonSpeedCustom.Text = "Custom"; - this.radioButtonSpeedCustom.UseVisualStyleBackColor = true; - // // BatchConvert // this.AllowDrop = true; @@ -781,6 +781,9 @@ this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.BatchConvert_KeyDown); this.groupBoxConvertOptions.ResumeLayout(false); this.groupBoxConvertOptions.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPercent)).EndInit(); this.groupBoxChangeFrameRate.ResumeLayout(false); this.groupBoxChangeFrameRate.PerformLayout(); this.groupBoxOffsetTimeCodes.ResumeLayout(false); @@ -790,9 +793,6 @@ this.groupBoxInput.ResumeLayout(false); this.groupBoxInput.PerformLayout(); this.contextMenuStripFiles.ResumeLayout(false); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPercent)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); From 41c54d690febf0bd4530be97a431fa593a48b06c Mon Sep 17 00:00:00 2001 From: Tom van de Graaf Date: Fri, 6 Nov 2015 20:24:23 +0100 Subject: [PATCH 3/5] Added radiobutton events. --- LanguageMaster.xml | 1 + libse/Language.cs | 1 + libse/LanguageDeserializer.cs | 3 +++ libse/LanguageStructure.cs | 1 + src/Forms/BatchConvert.Designer.cs | 39 ++++++++++++++++-------------- src/Forms/BatchConvert.cs | 21 ++++++++++++++++ 6 files changed, 48 insertions(+), 18 deletions(-) diff --git a/LanguageMaster.xml b/LanguageMaster.xml index 75304a6ee..d40734b57 100644 --- a/LanguageMaster.xml +++ b/LanguageMaster.xml @@ -222,6 +222,7 @@ Note: Do check free disk space. Adjust speed in percent + Ajust speed Change speed of subtitle in percent Custom To drop frame diff --git a/libse/Language.cs b/libse/Language.cs index 021d4a4de..5cdcc2657 100644 --- a/libse/Language.cs +++ b/libse/Language.cs @@ -361,6 +361,7 @@ namespace Nikse.SubtitleEdit.Core ChangeSpeedInPercent = new LanguageStructure.ChangeSpeedInPercent { Title = "Adjust speed in percent", + TitleShort = "Ajust speed", Info = "Change speed of subtitle in percent", Custom = "Custom", ToDropFrame = "To drop frame", diff --git a/libse/LanguageDeserializer.cs b/libse/LanguageDeserializer.cs index ebe3cd5bc..5e982181d 100644 --- a/libse/LanguageDeserializer.cs +++ b/libse/LanguageDeserializer.cs @@ -577,6 +577,9 @@ namespace Nikse.SubtitleEdit.Core case "ChangeSpeedInPercent/Title": language.ChangeSpeedInPercent.Title = reader.Value; break; + case "ChangeSpeedInPercent/TitleShort": + language.ChangeSpeedInPercent.TitleShort = reader.Value; + break; case "ChangeSpeedInPercent/Info": language.ChangeSpeedInPercent.Info = reader.Value; break; diff --git a/libse/LanguageStructure.cs b/libse/LanguageStructure.cs index e841e0e8f..e716aee20 100644 --- a/libse/LanguageStructure.cs +++ b/libse/LanguageStructure.cs @@ -240,6 +240,7 @@ public class ChangeSpeedInPercent { public string Title { get; set; } + public string TitleShort { get; set; } public string Info { get; set; } public string Custom { get; set; } public string ToDropFrame { get; set; } diff --git a/src/Forms/BatchConvert.Designer.cs b/src/Forms/BatchConvert.Designer.cs index 8b8412dec..ec73ecd4c 100644 --- a/src/Forms/BatchConvert.Designer.cs +++ b/src/Forms/BatchConvert.Designer.cs @@ -32,7 +32,7 @@ this.buttonConvert = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button(); this.groupBoxConvertOptions = new System.Windows.Forms.GroupBox(); - this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.groupBoxSpeed = new System.Windows.Forms.GroupBox(); this.radioButtonToDropFrame = new System.Windows.Forms.RadioButton(); this.radioButtonSpeedFromDropFrame = new System.Windows.Forms.RadioButton(); this.radioButtonSpeedCustom = new System.Windows.Forms.RadioButton(); @@ -92,7 +92,7 @@ this.progressBar1 = new System.Windows.Forms.ProgressBar(); this.labelStatus = new System.Windows.Forms.Label(); this.groupBoxConvertOptions.SuspendLayout(); - this.groupBox1.SuspendLayout(); + this.groupBoxSpeed.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPercent)).BeginInit(); this.groupBoxChangeFrameRate.SuspendLayout(); this.groupBoxOffsetTimeCodes.SuspendLayout(); @@ -129,7 +129,7 @@ // this.groupBoxConvertOptions.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.groupBoxConvertOptions.Controls.Add(this.groupBox1); + this.groupBoxConvertOptions.Controls.Add(this.groupBoxSpeed); this.groupBoxConvertOptions.Controls.Add(this.checkBoxSplitLongLines); this.groupBoxConvertOptions.Controls.Add(this.buttonRemoveTextForHiSettings); this.groupBoxConvertOptions.Controls.Add(this.checkBoxSetMinimumDisplayTimeBetweenSubs); @@ -150,19 +150,19 @@ this.groupBoxConvertOptions.TabStop = false; this.groupBoxConvertOptions.Text = "Convert options"; // - // groupBox1 + // groupBoxSpeed // - this.groupBox1.Controls.Add(this.radioButtonToDropFrame); - this.groupBox1.Controls.Add(this.radioButtonSpeedFromDropFrame); - this.groupBox1.Controls.Add(this.radioButtonSpeedCustom); - this.groupBox1.Controls.Add(this.numericUpDownPercent); - this.groupBox1.Controls.Add(this.labelPercent); - this.groupBox1.Location = new System.Drawing.Point(429, 89); - this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(110, 115); - this.groupBox1.TabIndex = 12; - this.groupBox1.TabStop = false; - this.groupBox1.Text = "Change speed"; + this.groupBoxSpeed.Controls.Add(this.radioButtonToDropFrame); + this.groupBoxSpeed.Controls.Add(this.radioButtonSpeedFromDropFrame); + this.groupBoxSpeed.Controls.Add(this.radioButtonSpeedCustom); + this.groupBoxSpeed.Controls.Add(this.numericUpDownPercent); + this.groupBoxSpeed.Controls.Add(this.labelPercent); + this.groupBoxSpeed.Location = new System.Drawing.Point(429, 89); + this.groupBoxSpeed.Name = "groupBoxSpeed"; + this.groupBoxSpeed.Size = new System.Drawing.Size(110, 115); + this.groupBoxSpeed.TabIndex = 12; + this.groupBoxSpeed.TabStop = false; + this.groupBoxSpeed.Text = "Change speed"; // // radioButtonToDropFrame // @@ -173,6 +173,7 @@ this.radioButtonToDropFrame.TabIndex = 3; this.radioButtonToDropFrame.Text = "To drop frame"; this.radioButtonToDropFrame.UseVisualStyleBackColor = true; + this.radioButtonToDropFrame.CheckedChanged += new System.EventHandler(this.radioButtonToDropFrame_CheckedChanged); // // radioButtonSpeedFromDropFrame // @@ -183,6 +184,7 @@ this.radioButtonSpeedFromDropFrame.TabIndex = 2; this.radioButtonSpeedFromDropFrame.Text = "From drop frame"; this.radioButtonSpeedFromDropFrame.UseVisualStyleBackColor = true; + this.radioButtonSpeedFromDropFrame.CheckedChanged += new System.EventHandler(this.radioButtonSpeedFromDropFrame_CheckedChanged); // // radioButtonSpeedCustom // @@ -195,6 +197,7 @@ this.radioButtonSpeedCustom.TabStop = true; this.radioButtonSpeedCustom.Text = "Custom"; this.radioButtonSpeedCustom.UseVisualStyleBackColor = true; + this.radioButtonSpeedCustom.CheckedChanged += new System.EventHandler(this.radioButtonSpeedCustom_CheckedChanged); // // numericUpDownPercent // @@ -781,8 +784,8 @@ this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.BatchConvert_KeyDown); this.groupBoxConvertOptions.ResumeLayout(false); this.groupBoxConvertOptions.PerformLayout(); - this.groupBox1.ResumeLayout(false); - this.groupBox1.PerformLayout(); + this.groupBoxSpeed.ResumeLayout(false); + this.groupBoxSpeed.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownPercent)).EndInit(); this.groupBoxChangeFrameRate.ResumeLayout(false); this.groupBoxChangeFrameRate.PerformLayout(); @@ -856,7 +859,7 @@ private System.Windows.Forms.Label labelFilter; private System.Windows.Forms.ComboBox comboBoxFilter; private System.Windows.Forms.TextBox textBoxFilter; - private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.GroupBox groupBoxSpeed; private System.Windows.Forms.NumericUpDown numericUpDownPercent; private System.Windows.Forms.Label labelPercent; private System.Windows.Forms.RadioButton radioButtonToDropFrame; diff --git a/src/Forms/BatchConvert.cs b/src/Forms/BatchConvert.cs index 489299ddc..bd13d57f0 100644 --- a/src/Forms/BatchConvert.cs +++ b/src/Forms/BatchConvert.cs @@ -102,6 +102,7 @@ namespace Nikse.SubtitleEdit.Forms groupBoxChangeFrameRate.Text = Configuration.Settings.Language.ChangeFrameRate.Title; groupBoxOffsetTimeCodes.Text = Configuration.Settings.Language.ShowEarlierLater.TitleAll; + groupBoxSpeed.Text = Configuration.Settings.Language.ChangeSpeedInPercent.TitleShort; labelFromFrameRate.Text = Configuration.Settings.Language.ChangeFrameRate.FromFrameRate; labelToFrameRate.Text = Configuration.Settings.Language.ChangeFrameRate.ToFrameRate; labelHourMinSecMilliSecond.Text = Configuration.Settings.Language.General.HourMinutesSecondsMilliseconds; @@ -200,6 +201,9 @@ namespace Nikse.SubtitleEdit.Forms checkBoxSplitLongLines.Text = l.SplitLongLines; radioButtonShowEarlier.Text = Configuration.Settings.Language.ShowEarlierLater.ShowEarlier; radioButtonShowLater.Text = Configuration.Settings.Language.ShowEarlierLater.ShowLater; + radioButtonSpeedCustom.Text = Configuration.Settings.Language.ChangeSpeedInPercent.Custom; + radioButtonSpeedFromDropFrame.Text = Configuration.Settings.Language.ChangeSpeedInPercent.FromDropFrame; + radioButtonToDropFrame.Text = Configuration.Settings.Language.ChangeSpeedInPercent.ToDropFrame; checkBoxSetMinimumDisplayTimeBetweenSubs.Text = l.SetMinMsBetweenSubtitles; _removeTextForHearingImpaired = new RemoveTextForHI(new RemoveTextForHISettings()); @@ -471,6 +475,23 @@ namespace Nikse.SubtitleEdit.Forms } } + private void radioButtonSpeedCustom_CheckedChanged(object sender, EventArgs e) + { + numericUpDownPercent.Enabled = true; + } + + private void radioButtonSpeedFromDropFrame_CheckedChanged(object sender, EventArgs e) + { + numericUpDownPercent.Value = Convert.ToDecimal(099.98887); + numericUpDownPercent.Enabled = false; + } + + private void radioButtonToDropFrame_CheckedChanged(object sender, EventArgs e) + { + numericUpDownPercent.Value = Convert.ToDecimal(100.1001001); + numericUpDownPercent.Enabled = false; + } + private void buttonCancel_Click(object sender, EventArgs e) { DialogResult = DialogResult.Cancel; From 63d6be82505aab13ef8181bfd06f5355e2b8bbeb Mon Sep 17 00:00:00 2001 From: Tom van de Graaf Date: Fri, 6 Nov 2015 20:25:12 +0100 Subject: [PATCH 4/5] Changing speed percentage now works. --- src/Forms/BatchConvert.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/Forms/BatchConvert.cs b/src/Forms/BatchConvert.cs index bd13d57f0..f26da411f 100644 --- a/src/Forms/BatchConvert.cs +++ b/src/Forms/BatchConvert.cs @@ -13,6 +13,7 @@ using System.Globalization; using System.IO; using System.Text; using System.Windows.Forms; +using System.Diagnostics; namespace Nikse.SubtitleEdit.Forms { @@ -820,7 +821,32 @@ namespace Nikse.SubtitleEdit.Forms { p.Text = HtmlUtil.RemoveHtmlTags(p.Text, true); } + + + if (!numericUpDownPercent.Value.Equals(100)) + { + double toSpeedPercentage = Convert.ToDouble(numericUpDownPercent.Value) / 100.0; + p.StartTime.TotalMilliseconds = p.StartTime.TotalMilliseconds * toSpeedPercentage; + p.EndTime.TotalMilliseconds = p.EndTime.TotalMilliseconds * toSpeedPercentage; + } + + } + + + + for (int i = 0; i < sub.Paragraphs.Count; i++) + { + Paragraph p = sub.Paragraphs[i]; + Paragraph next = sub.GetParagraphOrDefault(i + 1); + if (next != null) + { + if (p.EndTime.TotalMilliseconds >= next.StartTime.TotalMilliseconds) + p.EndTime.TotalMilliseconds = next.StartTime.TotalMilliseconds - 1; + } + } + + sub.RemoveEmptyLines(); if (checkBoxFixCasing.Checked) { From 800cc8537dafd4bea081c2e962cea480beab5ff7 Mon Sep 17 00:00:00 2001 From: Tom van de Graaf Date: Fri, 6 Nov 2015 20:25:58 +0100 Subject: [PATCH 5/5] Added correction for the Paragraphs. --- src/Forms/BatchConvert.cs | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/src/Forms/BatchConvert.cs b/src/Forms/BatchConvert.cs index f26da411f..0bdc10f7a 100644 --- a/src/Forms/BatchConvert.cs +++ b/src/Forms/BatchConvert.cs @@ -13,7 +13,6 @@ using System.Globalization; using System.IO; using System.Text; using System.Windows.Forms; -using System.Diagnostics; namespace Nikse.SubtitleEdit.Forms { @@ -811,6 +810,8 @@ namespace Nikse.SubtitleEdit.Forms } else { + Paragraph prev = sub.Paragraphs[0]; + bool first = true; foreach (Paragraph p in sub.Paragraphs) { if (checkBoxRemoveTextForHI.Checked) @@ -822,31 +823,23 @@ namespace Nikse.SubtitleEdit.Forms p.Text = HtmlUtil.RemoveHtmlTags(p.Text, true); } - if (!numericUpDownPercent.Value.Equals(100)) { double toSpeedPercentage = Convert.ToDouble(numericUpDownPercent.Value) / 100.0; p.StartTime.TotalMilliseconds = p.StartTime.TotalMilliseconds * toSpeedPercentage; p.EndTime.TotalMilliseconds = p.EndTime.TotalMilliseconds * toSpeedPercentage; + + if (first) + { + first = false; + } else + { + if (prev.EndTime.TotalMilliseconds >= p.StartTime.TotalMilliseconds) + prev.EndTime.TotalMilliseconds = p.StartTime.TotalMilliseconds - 1; + } } - - + prev = p; } - - - - for (int i = 0; i < sub.Paragraphs.Count; i++) - { - Paragraph p = sub.Paragraphs[i]; - Paragraph next = sub.GetParagraphOrDefault(i + 1); - if (next != null) - { - if (p.EndTime.TotalMilliseconds >= next.StartTime.TotalMilliseconds) - p.EndTime.TotalMilliseconds = next.StartTime.TotalMilliseconds - 1; - } - } - - sub.RemoveEmptyLines(); if (checkBoxFixCasing.Checked) {