This commit is contained in:
Nikolaj Olsson 2024-05-08 20:57:22 +02:00
parent 31e92dcfbc
commit 7e623130e6
6 changed files with 58 additions and 33 deletions

View File

@ -1020,6 +1020,8 @@ We leverage the intrinsic rhythm of the image.</CreateSimpleChainingToolTip>
<AlignRight>Align right</AlignRight> <AlignRight>Align right</AlignRight>
<GetStartPosition>Get start position</GetStartPosition> <GetStartPosition>Get start position</GetStartPosition>
<GetEndPosition>Get end position</GetEndPosition> <GetEndPosition>Get end position</GetEndPosition>
<UseSource>Use source</UseSource>
<UseSourceResolution>Use source resolution</UseSourceResolution>
</GenerateVideoWithBurnedInSubs> </GenerateVideoWithBurnedInSubs>
<GenerateVideoWithEmbeddedSubs> <GenerateVideoWithEmbeddedSubs>
<Title>Generate video with added/removed embedded subtitles</Title> <Title>Generate video with added/removed embedded subtitles</Title>

View File

@ -37,6 +37,7 @@ namespace Nikse.SubtitleEdit.Forms
this.buttonCancel = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button();
this.timer1 = new System.Windows.Forms.Timer(this.components); this.timer1 = new System.Windows.Forms.Timer(this.components);
this.groupBoxSettings = new System.Windows.Forms.GroupBox(); this.groupBoxSettings = new System.Windows.Forms.GroupBox();
this.videoPlayerContainer1 = new Nikse.SubtitleEdit.Controls.VideoPlayerContainer();
this.buttonClear = new System.Windows.Forms.Button(); this.buttonClear = new System.Windows.Forms.Button();
this.panelForeColor = new System.Windows.Forms.Panel(); this.panelForeColor = new System.Windows.Forms.Panel();
this.nikseLabelOutputFileFolder = new System.Windows.Forms.Label(); this.nikseLabelOutputFileFolder = new System.Windows.Forms.Label();
@ -109,7 +110,6 @@ namespace Nikse.SubtitleEdit.Forms
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.deleteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.videoPlayerContainer1 = new Nikse.SubtitleEdit.Controls.VideoPlayerContainer();
this.buttonOutputFileSettings = new System.Windows.Forms.Button(); this.buttonOutputFileSettings = new System.Windows.Forms.Button();
this.buttonPreview = new System.Windows.Forms.Button(); this.buttonPreview = new System.Windows.Forms.Button();
this.linkLabelHelp = new System.Windows.Forms.LinkLabel(); this.linkLabelHelp = new System.Windows.Forms.LinkLabel();
@ -239,6 +239,31 @@ namespace Nikse.SubtitleEdit.Forms
this.groupBoxSettings.TabStop = false; this.groupBoxSettings.TabStop = false;
this.groupBoxSettings.Text = "Settings"; this.groupBoxSettings.Text = "Settings";
// //
// videoPlayerContainer1
//
this.videoPlayerContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.videoPlayerContainer1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(18)))), ((int)(((byte)(18)))));
this.videoPlayerContainer1.Chapters = null;
this.videoPlayerContainer1.CurrentPosition = 0D;
this.videoPlayerContainer1.FontSizeFactor = 1F;
this.videoPlayerContainer1.LastParagraph = null;
this.videoPlayerContainer1.Location = new System.Drawing.Point(430, 313);
this.videoPlayerContainer1.Name = "videoPlayerContainer1";
this.videoPlayerContainer1.ShowFullscreenButton = true;
this.videoPlayerContainer1.ShowMuteButton = true;
this.videoPlayerContainer1.ShowStopButton = true;
this.videoPlayerContainer1.Size = new System.Drawing.Size(431, 226);
this.videoPlayerContainer1.SubtitleText = "";
this.videoPlayerContainer1.TabIndex = 110;
this.videoPlayerContainer1.TextRightToLeft = System.Windows.Forms.RightToLeft.No;
this.videoPlayerContainer1.UsingFrontCenterAudioChannelOnly = false;
this.videoPlayerContainer1.VideoHeight = 0;
this.videoPlayerContainer1.VideoPlayer = null;
this.videoPlayerContainer1.VideoWidth = 0;
this.videoPlayerContainer1.Volume = 0D;
//
// buttonClear // buttonClear
// //
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
@ -1389,31 +1414,6 @@ namespace Nikse.SubtitleEdit.Forms
this.clearToolStripMenuItem.Text = "Clear"; this.clearToolStripMenuItem.Text = "Clear";
this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click); this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click);
// //
// videoPlayerContainer1
//
this.videoPlayerContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.videoPlayerContainer1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(18)))), ((int)(((byte)(18)))), ((int)(((byte)(18)))));
this.videoPlayerContainer1.Chapters = null;
this.videoPlayerContainer1.CurrentPosition = 0D;
this.videoPlayerContainer1.FontSizeFactor = 1F;
this.videoPlayerContainer1.LastParagraph = null;
this.videoPlayerContainer1.Location = new System.Drawing.Point(430, 313);
this.videoPlayerContainer1.Name = "videoPlayerContainer1";
this.videoPlayerContainer1.ShowFullscreenButton = true;
this.videoPlayerContainer1.ShowMuteButton = true;
this.videoPlayerContainer1.ShowStopButton = true;
this.videoPlayerContainer1.Size = new System.Drawing.Size(431, 226);
this.videoPlayerContainer1.SubtitleText = "";
this.videoPlayerContainer1.TabIndex = 110;
this.videoPlayerContainer1.TextRightToLeft = System.Windows.Forms.RightToLeft.No;
this.videoPlayerContainer1.UsingFrontCenterAudioChannelOnly = false;
this.videoPlayerContainer1.VideoHeight = 0;
this.videoPlayerContainer1.VideoPlayer = null;
this.videoPlayerContainer1.VideoWidth = 0;
this.videoPlayerContainer1.Volume = 0D;
//
// buttonOutputFileSettings // buttonOutputFileSettings
// //
this.buttonOutputFileSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.buttonOutputFileSettings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
@ -1468,14 +1468,14 @@ namespace Nikse.SubtitleEdit.Forms
this.x352ToolStripMenuItem, this.x352ToolStripMenuItem,
this.x272ToolStripMenuItem}); this.x272ToolStripMenuItem});
this.contextMenuStripRes.Name = "contextMenuStripRes"; this.contextMenuStripRes.Name = "contextMenuStripRes";
this.contextMenuStripRes.Size = new System.Drawing.Size(221, 356); this.contextMenuStripRes.Size = new System.Drawing.Size(221, 378);
this.contextMenuStripRes.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStripRes_Opening); this.contextMenuStripRes.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStripRes_Opening);
// //
// useSourceResolutionToolStripMenuItem // useSourceResolutionToolStripMenuItem
// //
this.useSourceResolutionToolStripMenuItem.Name = "useSourceResolutionToolStripMenuItem"; this.useSourceResolutionToolStripMenuItem.Name = "useSourceResolutionToolStripMenuItem";
this.useSourceResolutionToolStripMenuItem.Size = new System.Drawing.Size(220, 22); this.useSourceResolutionToolStripMenuItem.Size = new System.Drawing.Size(220, 22);
this.useSourceResolutionToolStripMenuItem.Text = "Use source resoluton"; this.useSourceResolutionToolStripMenuItem.Text = "Use source resolution";
this.useSourceResolutionToolStripMenuItem.Click += new System.EventHandler(this.useSourceResolutionToolStripMenuItem_Click); this.useSourceResolutionToolStripMenuItem.Click += new System.EventHandler(this.useSourceResolutionToolStripMenuItem_Click);
// //
// x2160ToolStripMenuItem // x2160ToolStripMenuItem

View File

@ -106,6 +106,7 @@ namespace Nikse.SubtitleEdit.Forms
buttonRemoveFile.Text = LanguageSettings.Current.DvdSubRip.Remove; buttonRemoveFile.Text = LanguageSettings.Current.DvdSubRip.Remove;
buttonClear.Text = LanguageSettings.Current.DvdSubRip.Clear; buttonClear.Text = LanguageSettings.Current.DvdSubRip.Clear;
buttonAddFile.Text = LanguageSettings.Current.DvdSubRip.Add; buttonAddFile.Text = LanguageSettings.Current.DvdSubRip.Add;
useSourceResolutionToolStripMenuItem.Text = LanguageSettings.Current.GenerateVideoWithBurnedInSubs.UseSourceResolution;
progressBar1.Visible = false; progressBar1.Visible = false;
labelPleaseWait.Visible = false; labelPleaseWait.Visible = false;
@ -1943,7 +1944,7 @@ namespace Nikse.SubtitleEdit.Forms
private void buttonCutTo_Click(object sender, EventArgs e) private void buttonCutTo_Click(object sender, EventArgs e)
{ {
var timeSpan = new TimeSpan((int)numericUpDownCutFromHours.Value, (int)numericUpDownCutToMinutes.Value, (int)numericUpDownCutFromSeconds.Value); var timeSpan = new TimeSpan((int)numericUpDownCutFromHours.Value, (int)numericUpDownCutToMinutes.Value, (int)numericUpDownCutFromSeconds.Value);
using (var form = new GetVideoPosition(_assaSubtitle, _inputVideoFileName, _videoInfo, timeSpan, LanguageSettings.Current.GenerateVideoWithBurnedInSubs.GetStartPosition)) using (var form = new GetVideoPosition(_assaSubtitle, _inputVideoFileName, _videoInfo, timeSpan, LanguageSettings.Current.GenerateVideoWithBurnedInSubs.GetEndPosition))
{ {
if (form.ShowDialog(this) == DialogResult.OK) if (form.ShowDialog(this) == DialogResult.OK)
{ {
@ -2430,15 +2431,27 @@ namespace Nikse.SubtitleEdit.Forms
numericUpDownHeight.Visible = false; numericUpDownHeight.Visible = false;
labelX.Left = numericUpDownWidth.Left; labelX.Left = numericUpDownWidth.Left;
labelX.Text = "Use source"; if (BatchMode)
{
labelX.Text = LanguageSettings.Current.GenerateVideoWithBurnedInSubs.UseSource;
numericUpDownWidth.Value = 0; numericUpDownWidth.Value = 0;
numericUpDownHeight.Value = 0; numericUpDownHeight.Value = 0;
} }
else
{
labelX.Text = $"{LanguageSettings.Current.GenerateVideoWithBurnedInSubs.UseSource} ({_videoInfo.Width}x{_videoInfo.Height})";
numericUpDownWidth.Value = _videoInfo.Width;
numericUpDownHeight.Value = _videoInfo.Height;
}
}
private void contextMenuStripRes_Opening(object sender, System.ComponentModel.CancelEventArgs e) private void contextMenuStripRes_Opening(object sender, System.ComponentModel.CancelEventArgs e)
{ {
useSourceResolutionToolStripMenuItem.Visible = BatchMode; useSourceResolutionToolStripMenuItem.Visible =
BatchMode ||
(_videoInfo != null && !string.IsNullOrEmpty(_inputVideoFileName));
} }
private void listViewBatch_ColumnClick(object sender, ColumnClickEventArgs e) private void listViewBatch_ColumnClick(object sender, ColumnClickEventArgs e)

View File

@ -1275,6 +1275,8 @@ namespace Nikse.SubtitleEdit.Logic
AlignRight = "Align right", AlignRight = "Align right",
GetStartPosition = "Get start position", GetStartPosition = "Get start position",
GetEndPosition = "Get end position", GetEndPosition = "Get end position",
UseSource = "Use source",
UseSourceResolution = "Use source resolution",
}; };
GenerateVideoWithEmbeddedSubs = new LanguageStructure.GenerateVideoWithEmbeddedSubs GenerateVideoWithEmbeddedSubs = new LanguageStructure.GenerateVideoWithEmbeddedSubs

View File

@ -2701,6 +2701,12 @@ namespace Nikse.SubtitleEdit.Logic
case "GenerateVideoWithBurnedInSubs/GetEndPosition": case "GenerateVideoWithBurnedInSubs/GetEndPosition":
language.GenerateVideoWithBurnedInSubs.GetEndPosition = reader.Value; language.GenerateVideoWithBurnedInSubs.GetEndPosition = reader.Value;
break; break;
case "GenerateVideoWithBurnedInSubs/UseSource":
language.GenerateVideoWithBurnedInSubs.UseSource = reader.Value;
break;
case "GenerateVideoWithBurnedInSubs/UseSourceResolution":
language.GenerateVideoWithBurnedInSubs.UseSourceResolution = reader.Value;
break;
case "GenerateVideoWithEmbeddedSubs/Title": case "GenerateVideoWithEmbeddedSubs/Title":
language.GenerateVideoWithEmbeddedSubs.Title = reader.Value; language.GenerateVideoWithEmbeddedSubs.Title = reader.Value;
break; break;

View File

@ -1095,6 +1095,8 @@
public string AlignRight { get; set; } public string AlignRight { get; set; }
public string GetStartPosition { get; set; } public string GetStartPosition { get; set; }
public string GetEndPosition { get; set; } public string GetEndPosition { get; set; }
public string UseSource { get; set; }
public string UseSourceResolution { get; set; }
} }
public class GenerateVideoWithEmbeddedSubs public class GenerateVideoWithEmbeddedSubs