More work on #3633

This commit is contained in:
niksedk 2019-10-07 15:32:33 +02:00
parent 5b4dc657b9
commit 4875b69d76
6 changed files with 128 additions and 36 deletions

View File

@ -214,7 +214,8 @@ Note: Do check free disk space.</WaveFileMalformed>
<AutoBalanceErrorX>Auto balance: {0}</AutoBalanceErrorX>
<OffsetTimeCodes>Offset time codes</OffsetTimeCodes>
<TransportStreamSettings>Transport Stream settings</TransportStreamSettings>
<TransportStreamOverridePosition>Override original position</TransportStreamOverridePosition>
<TransportStreamOverrideXPosition>Override original X position</TransportStreamOverrideXPosition>
<TransportStreamOverrideYPosition>Override original Y position</TransportStreamOverrideYPosition>
<TransportStreamOverrideVideoSize>Override original video size</TransportStreamOverrideVideoSize>
</BatchConvert>
<Beamer>

View File

@ -354,7 +354,8 @@ namespace Nikse.SubtitleEdit.Core
AutoBalanceErrorX = "Auto balance: {0}",
OffsetTimeCodes = "Offset time codes",
TransportStreamSettings = "Transport Stream settings",
TransportStreamOverridePosition = "Override original position",
TransportStreamOverrideXPosition = "Override original X position",
TransportStreamOverrideYPosition = "Override original Y position",
TransportStreamOverrideVideoSize = "Override original video size"
};

View File

@ -583,8 +583,11 @@ namespace Nikse.SubtitleEdit.Core
case "BatchConvert/TransportStreamSettings":
language.BatchConvert.TransportStreamSettings = reader.Value;
break;
case "BatchConvert/TransportStreamOverridePosition":
language.BatchConvert.TransportStreamOverridePosition = reader.Value;
case "BatchConvert/TransportStreamOverrideXPosition":
language.BatchConvert.TransportStreamOverrideXPosition = reader.Value;
break;
case "BatchConvert/TransportStreamOverrideYPosition":
language.BatchConvert.TransportStreamOverrideYPosition = reader.Value;
break;
case "BatchConvert/TransportStreamOverrideVideoSize":
language.BatchConvert.TransportStreamOverrideVideoSize = reader.Value;

View File

@ -224,7 +224,8 @@
public string AutoBalanceErrorX { get; set; }
public string OffsetTimeCodes { get; set; }
public string TransportStreamSettings { get; set; }
public string TransportStreamOverridePosition { get; set; }
public string TransportStreamOverrideXPosition { get; set; }
public string TransportStreamOverrideYPosition { get; set; }
public string TransportStreamOverrideVideoSize { get; set; }
}

View File

@ -31,23 +31,29 @@
this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button();
this.labelBottomMargin = new System.Windows.Forms.Label();
this.checkBoxOverrideOriginalPosition = new System.Windows.Forms.CheckBox();
this.checkBoxOverrideOriginalYPosition = new System.Windows.Forms.CheckBox();
this.numericUpDownBottomMargin = new System.Windows.Forms.NumericUpDown();
this.numericUpDownWidth = new System.Windows.Forms.NumericUpDown();
this.labelWidth = new System.Windows.Forms.Label();
this.checkBoxOverrideVideoSize = new System.Windows.Forms.CheckBox();
this.numericUpDownHeight = new System.Windows.Forms.NumericUpDown();
this.labelHeight = new System.Windows.Forms.Label();
this.numericUpDownXMargin = new System.Windows.Forms.NumericUpDown();
this.checkBoxOverrideOriginalXPosition = new System.Windows.Forms.CheckBox();
this.labelXMargin = new System.Windows.Forms.Label();
this.labelXAlignment = new System.Windows.Forms.Label();
this.comboBoxHAlign = new System.Windows.Forms.ComboBox();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownBottomMargin)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownWidth)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownHeight)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownXMargin)).BeginInit();
this.SuspendLayout();
//
// buttonOK
//
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonOK.Location = new System.Drawing.Point(287, 145);
this.buttonOK.Location = new System.Drawing.Point(307, 176);
this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(75, 21);
this.buttonOK.TabIndex = 8;
@ -60,7 +66,7 @@
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonCancel.Location = new System.Drawing.Point(368, 145);
this.buttonCancel.Location = new System.Drawing.Point(388, 176);
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(75, 21);
this.buttonCancel.TabIndex = 9;
@ -70,26 +76,26 @@
// labelBottomMargin
//
this.labelBottomMargin.AutoSize = true;
this.labelBottomMargin.Location = new System.Drawing.Point(23, 47);
this.labelBottomMargin.Location = new System.Drawing.Point(13, 137);
this.labelBottomMargin.Name = "labelBottomMargin";
this.labelBottomMargin.Size = new System.Drawing.Size(74, 13);
this.labelBottomMargin.TabIndex = 10;
this.labelBottomMargin.Text = "Bottom margin";
//
// checkBoxOverrideOriginalPosition
// checkBoxOverrideOriginalYPosition
//
this.checkBoxOverrideOriginalPosition.AutoSize = true;
this.checkBoxOverrideOriginalPosition.Location = new System.Drawing.Point(26, 24);
this.checkBoxOverrideOriginalPosition.Name = "checkBoxOverrideOriginalPosition";
this.checkBoxOverrideOriginalPosition.Size = new System.Drawing.Size(141, 17);
this.checkBoxOverrideOriginalPosition.TabIndex = 12;
this.checkBoxOverrideOriginalPosition.Text = "Override original position";
this.checkBoxOverrideOriginalPosition.UseVisualStyleBackColor = true;
this.checkBoxOverrideOriginalPosition.CheckedChanged += new System.EventHandler(this.CheckBoxOverrideOriginalPosition_CheckedChanged);
this.checkBoxOverrideOriginalYPosition.AutoSize = true;
this.checkBoxOverrideOriginalYPosition.Location = new System.Drawing.Point(16, 114);
this.checkBoxOverrideOriginalYPosition.Name = "checkBoxOverrideOriginalYPosition";
this.checkBoxOverrideOriginalYPosition.Size = new System.Drawing.Size(151, 17);
this.checkBoxOverrideOriginalYPosition.TabIndex = 12;
this.checkBoxOverrideOriginalYPosition.Text = "Override original Y position";
this.checkBoxOverrideOriginalYPosition.UseVisualStyleBackColor = true;
this.checkBoxOverrideOriginalYPosition.CheckedChanged += new System.EventHandler(this.CheckBoxOverrideOriginalYPosition_CheckedChanged);
//
// numericUpDownBottomMargin
//
this.numericUpDownBottomMargin.Location = new System.Drawing.Point(105, 45);
this.numericUpDownBottomMargin.Location = new System.Drawing.Point(95, 135);
this.numericUpDownBottomMargin.Maximum = new decimal(new int[] {
200,
0,
@ -101,7 +107,7 @@
//
// numericUpDownWidth
//
this.numericUpDownWidth.Location = new System.Drawing.Point(291, 50);
this.numericUpDownWidth.Location = new System.Drawing.Point(333, 50);
this.numericUpDownWidth.Maximum = new decimal(new int[] {
50000,
0,
@ -124,7 +130,7 @@
// labelWidth
//
this.labelWidth.AutoSize = true;
this.labelWidth.Location = new System.Drawing.Point(241, 52);
this.labelWidth.Location = new System.Drawing.Point(283, 52);
this.labelWidth.Name = "labelWidth";
this.labelWidth.Size = new System.Drawing.Size(35, 13);
this.labelWidth.TabIndex = 14;
@ -133,17 +139,17 @@
// checkBoxOverrideVideoSize
//
this.checkBoxOverrideVideoSize.AutoSize = true;
this.checkBoxOverrideVideoSize.Location = new System.Drawing.Point(244, 24);
this.checkBoxOverrideVideoSize.Location = new System.Drawing.Point(286, 24);
this.checkBoxOverrideVideoSize.Name = "checkBoxOverrideVideoSize";
this.checkBoxOverrideVideoSize.Size = new System.Drawing.Size(116, 17);
this.checkBoxOverrideVideoSize.Size = new System.Drawing.Size(149, 17);
this.checkBoxOverrideVideoSize.TabIndex = 15;
this.checkBoxOverrideVideoSize.Text = "Override video size";
this.checkBoxOverrideVideoSize.Text = "Override output video size";
this.checkBoxOverrideVideoSize.UseVisualStyleBackColor = true;
this.checkBoxOverrideVideoSize.CheckedChanged += new System.EventHandler(this.CheckBoxOverrideVideoSize_CheckedChanged);
//
// numericUpDownHeight
//
this.numericUpDownHeight.Location = new System.Drawing.Point(291, 76);
this.numericUpDownHeight.Location = new System.Drawing.Point(333, 76);
this.numericUpDownHeight.Maximum = new decimal(new int[] {
50000,
0,
@ -166,24 +172,84 @@
// labelHeight
//
this.labelHeight.AutoSize = true;
this.labelHeight.Location = new System.Drawing.Point(241, 78);
this.labelHeight.Location = new System.Drawing.Point(283, 78);
this.labelHeight.Name = "labelHeight";
this.labelHeight.Size = new System.Drawing.Size(38, 13);
this.labelHeight.TabIndex = 17;
this.labelHeight.Text = "Height";
//
// numericUpDownXMargin
//
this.numericUpDownXMargin.Location = new System.Drawing.Point(95, 45);
this.numericUpDownXMargin.Maximum = new decimal(new int[] {
200,
0,
0,
0});
this.numericUpDownXMargin.Name = "numericUpDownXMargin";
this.numericUpDownXMargin.Size = new System.Drawing.Size(62, 20);
this.numericUpDownXMargin.TabIndex = 20;
//
// checkBoxOverrideOriginalXPosition
//
this.checkBoxOverrideOriginalXPosition.AutoSize = true;
this.checkBoxOverrideOriginalXPosition.Location = new System.Drawing.Point(16, 24);
this.checkBoxOverrideOriginalXPosition.Name = "checkBoxOverrideOriginalXPosition";
this.checkBoxOverrideOriginalXPosition.Size = new System.Drawing.Size(151, 17);
this.checkBoxOverrideOriginalXPosition.TabIndex = 19;
this.checkBoxOverrideOriginalXPosition.Text = "Override original X position";
this.checkBoxOverrideOriginalXPosition.UseVisualStyleBackColor = true;
this.checkBoxOverrideOriginalXPosition.CheckedChanged += new System.EventHandler(this.checkBoxOverrideOriginalXPosition_CheckedChanged);
//
// labelXMargin
//
this.labelXMargin.AutoSize = true;
this.labelXMargin.Location = new System.Drawing.Point(13, 47);
this.labelXMargin.Name = "labelXMargin";
this.labelXMargin.Size = new System.Drawing.Size(39, 13);
this.labelXMargin.TabIndex = 18;
this.labelXMargin.Text = "Margin";
//
// labelXAlignment
//
this.labelXAlignment.AutoSize = true;
this.labelXAlignment.Location = new System.Drawing.Point(13, 76);
this.labelXAlignment.Name = "labelXAlignment";
this.labelXAlignment.Size = new System.Drawing.Size(53, 13);
this.labelXAlignment.TabIndex = 21;
this.labelXAlignment.Text = "Alignment";
//
// comboBoxHAlign
//
this.comboBoxHAlign.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxHAlign.FormattingEnabled = true;
this.comboBoxHAlign.Items.AddRange(new object[] {
"Left",
"Center",
"Right",
"Center - Left justify"});
this.comboBoxHAlign.Location = new System.Drawing.Point(95, 73);
this.comboBoxHAlign.Name = "comboBoxHAlign";
this.comboBoxHAlign.Size = new System.Drawing.Size(123, 21);
this.comboBoxHAlign.TabIndex = 22;
//
// BatchConvertTsSettings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(455, 178);
this.ClientSize = new System.Drawing.Size(475, 209);
this.Controls.Add(this.comboBoxHAlign);
this.Controls.Add(this.labelXAlignment);
this.Controls.Add(this.numericUpDownXMargin);
this.Controls.Add(this.checkBoxOverrideOriginalXPosition);
this.Controls.Add(this.labelXMargin);
this.Controls.Add(this.numericUpDownHeight);
this.Controls.Add(this.labelHeight);
this.Controls.Add(this.checkBoxOverrideVideoSize);
this.Controls.Add(this.numericUpDownWidth);
this.Controls.Add(this.labelWidth);
this.Controls.Add(this.numericUpDownBottomMargin);
this.Controls.Add(this.checkBoxOverrideOriginalPosition);
this.Controls.Add(this.checkBoxOverrideOriginalYPosition);
this.Controls.Add(this.labelBottomMargin);
this.Controls.Add(this.buttonOK);
this.Controls.Add(this.buttonCancel);
@ -200,6 +266,7 @@
((System.ComponentModel.ISupportInitialize)(this.numericUpDownBottomMargin)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownWidth)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownHeight)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDownXMargin)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@ -210,12 +277,17 @@
private System.Windows.Forms.Button buttonOK;
private System.Windows.Forms.Button buttonCancel;
private System.Windows.Forms.Label labelBottomMargin;
private System.Windows.Forms.CheckBox checkBoxOverrideOriginalPosition;
private System.Windows.Forms.CheckBox checkBoxOverrideOriginalYPosition;
private System.Windows.Forms.NumericUpDown numericUpDownBottomMargin;
private System.Windows.Forms.NumericUpDown numericUpDownWidth;
private System.Windows.Forms.Label labelWidth;
private System.Windows.Forms.CheckBox checkBoxOverrideVideoSize;
private System.Windows.Forms.NumericUpDown numericUpDownHeight;
private System.Windows.Forms.Label labelHeight;
private System.Windows.Forms.NumericUpDown numericUpDownXMargin;
private System.Windows.Forms.CheckBox checkBoxOverrideOriginalXPosition;
private System.Windows.Forms.Label labelXMargin;
private System.Windows.Forms.Label labelXAlignment;
private System.Windows.Forms.ComboBox comboBoxHAlign;
}
}

View File

@ -13,34 +13,40 @@ namespace Nikse.SubtitleEdit.Forms
InitializeComponent();
UiUtil.FixFonts(this);
Text = Configuration.Settings.Language.BatchConvert.TransportStreamSettings;
checkBoxOverrideOriginalPosition.Text = Configuration.Settings.Language.BatchConvert.TransportStreamOverridePosition;
checkBoxOverrideOriginalXPosition.Text = Configuration.Settings.Language.BatchConvert.TransportStreamOverrideXPosition;
checkBoxOverrideOriginalYPosition.Text = Configuration.Settings.Language.BatchConvert.TransportStreamOverrideYPosition;
checkBoxOverrideVideoSize.Text = Configuration.Settings.Language.BatchConvert.TransportStreamOverrideVideoSize;
labelBottomMargin.Text = Configuration.Settings.Language.ExportPngXml.BottomMargin;
labelXMargin.Text = Configuration.Settings.Language.ExportPngXml.LeftRightMargin;
labelXAlignment.Text = Configuration.Settings.Language.ExportPngXml.Align;
labelWidth.Text = Configuration.Settings.Language.General.Width;
labelHeight.Text = Configuration.Settings.Language.General.Height;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
buttonOK.Text = Configuration.Settings.Language.General.Ok;
UiUtil.FixLargeFonts(this, buttonOK);
numericUpDownXMargin.Left = labelXMargin.Left + labelXMargin.Width + 5;
comboBoxHAlign.Left = labelXAlignment.Left + labelXAlignment.Width + 5;
numericUpDownBottomMargin.Left = labelBottomMargin.Left + labelBottomMargin.Width + 5;
var widthAndHeightLeft = Math.Max(labelWidth.Left + labelWidth.Width, labelHeight.Left + labelHeight.Width) + 5;
numericUpDownWidth.Left = widthAndHeightLeft;
numericUpDownHeight.Left = widthAndHeightLeft;
checkBoxOverrideOriginalPosition.Checked = Configuration.Settings.Tools.BatchConvertTsOverridePosition;
checkBoxOverrideOriginalYPosition.Checked = Configuration.Settings.Tools.BatchConvertTsOverridePosition;
numericUpDownBottomMargin.Value = Configuration.Settings.Tools.BatchConvertTsOverrideBottomMargin;
checkBoxOverrideVideoSize.Checked = Configuration.Settings.Tools.BatchConvertTsOverrideScreenSize;
numericUpDownWidth.Value = Configuration.Settings.Tools.BatchConvertTsScreenWidth;
numericUpDownHeight.Value = Configuration.Settings.Tools.BatchConvertTsScreenHeight;
CheckBoxOverrideOriginalPosition_CheckedChanged(null, null);
checkBoxOverrideOriginalXPosition_CheckedChanged(null, null);
CheckBoxOverrideOriginalYPosition_CheckedChanged(null, null);
CheckBoxOverrideVideoSize_CheckedChanged(null, null);
}
private void CheckBoxOverrideOriginalPosition_CheckedChanged(object sender, EventArgs e)
private void CheckBoxOverrideOriginalYPosition_CheckedChanged(object sender, EventArgs e)
{
labelBottomMargin.Enabled = checkBoxOverrideOriginalPosition.Checked;
numericUpDownBottomMargin.Enabled = checkBoxOverrideOriginalPosition.Checked;
labelBottomMargin.Enabled = checkBoxOverrideOriginalYPosition.Checked;
numericUpDownBottomMargin.Enabled = checkBoxOverrideOriginalYPosition.Checked;
}
private void CheckBoxOverrideVideoSize_CheckedChanged(object sender, EventArgs e)
@ -61,12 +67,20 @@ namespace Nikse.SubtitleEdit.Forms
private void ButtonOK_Click(object sender, EventArgs e)
{
Configuration.Settings.Tools.BatchConvertTsOverridePosition = checkBoxOverrideOriginalPosition.Checked;
Configuration.Settings.Tools.BatchConvertTsOverridePosition = checkBoxOverrideOriginalYPosition.Checked;
Configuration.Settings.Tools.BatchConvertTsOverrideBottomMargin = (int)numericUpDownBottomMargin.Value;
Configuration.Settings.Tools.BatchConvertTsOverrideScreenSize = checkBoxOverrideVideoSize.Checked;
Configuration.Settings.Tools.BatchConvertTsScreenWidth = (int)numericUpDownWidth.Value;
Configuration.Settings.Tools.BatchConvertTsScreenHeight = (int)numericUpDownHeight.Value;
DialogResult = DialogResult.OK;
}
private void checkBoxOverrideOriginalXPosition_CheckedChanged(object sender, EventArgs e)
{
labelXMargin.Enabled = checkBoxOverrideOriginalXPosition.Checked;
numericUpDownXMargin.Enabled = checkBoxOverrideOriginalXPosition.Checked;
labelXAlignment.Enabled = checkBoxOverrideOriginalXPosition.Checked;
comboBoxHAlign.Enabled = checkBoxOverrideOriginalXPosition.Checked;
}
}
}