This commit is contained in:
Nikolaj Olsson 2024-04-19 22:35:23 +02:00
parent 408bf2539e
commit 264da9188d
3 changed files with 82 additions and 41 deletions

View File

@ -1,8 +1,9 @@
Subtitle Edit Changelog
4.0.6 (xth March 2024) BETA
4.0.6 (xth May 2024) BETA
* NEW:
* Add "Text To Speech" - thx darnn
* Add burn-in batch mode - thx Leon
* IMPROVED:
* Update Portuguese translation - thx hugok79
* Update Bulgarian translation - thx Калин

View File

@ -54,6 +54,8 @@ namespace Nikse.SubtitleEdit.Forms
this.groupBoxVideo = new System.Windows.Forms.GroupBox();
this.buttonVideoChooseStandardRes = new System.Windows.Forms.Button();
this.groupBoxAudio = new System.Windows.Forms.GroupBox();
this.listViewAudioTracks = new System.Windows.Forms.ListView();
this.columnHeaderAudioTrack = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.checkBoxMakeStereo = new System.Windows.Forms.CheckBox();
this.checkBoxTargetFileSize = new System.Windows.Forms.CheckBox();
this.listViewBatch = new System.Windows.Forms.ListView();
@ -85,8 +87,6 @@ namespace Nikse.SubtitleEdit.Forms
this.x352ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.x272ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.buttonMode = new System.Windows.Forms.Button();
this.listViewAudioTracks = new System.Windows.Forms.ListView();
this.columnHeaderAudioTrack = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.labelPreviewPleaseWait = new Nikse.SubtitleEdit.Controls.NikseLabel();
this.videoPlayerContainer1 = new Nikse.SubtitleEdit.Controls.VideoPlayerContainer();
this.numericUpDownCutToSeconds = new Nikse.SubtitleEdit.Controls.NikseUpDown();
@ -232,7 +232,7 @@ namespace Nikse.SubtitleEdit.Forms
//
// buttonClear
//
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonClear.Location = new System.Drawing.Point(165, 513);
this.buttonClear.Name = "buttonClear";
this.buttonClear.Size = new System.Drawing.Size(74, 23);
@ -252,7 +252,7 @@ namespace Nikse.SubtitleEdit.Forms
//
// buttonRemoveFile
//
this.buttonRemoveFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonRemoveFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonRemoveFile.Location = new System.Drawing.Point(85, 513);
this.buttonRemoveFile.Name = "buttonRemoveFile";
this.buttonRemoveFile.Size = new System.Drawing.Size(74, 23);
@ -273,7 +273,7 @@ namespace Nikse.SubtitleEdit.Forms
//
// buttonAddFile
//
this.buttonAddFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.buttonAddFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.buttonAddFile.Location = new System.Drawing.Point(6, 513);
this.buttonAddFile.Name = "buttonAddFile";
this.buttonAddFile.Size = new System.Drawing.Size(73, 23);
@ -438,6 +438,26 @@ namespace Nikse.SubtitleEdit.Forms
this.groupBoxAudio.TabStop = false;
this.groupBoxAudio.Text = "Audio";
//
// listViewAudioTracks
//
this.listViewAudioTracks.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listViewAudioTracks.CheckBoxes = true;
this.listViewAudioTracks.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeaderAudioTrack});
this.listViewAudioTracks.HideSelection = false;
this.listViewAudioTracks.Location = new System.Drawing.Point(229, 29);
this.listViewAudioTracks.Name = "listViewAudioTracks";
this.listViewAudioTracks.Size = new System.Drawing.Size(190, 122);
this.listViewAudioTracks.TabIndex = 45;
this.listViewAudioTracks.UseCompatibleStateImageBehavior = false;
this.listViewAudioTracks.View = System.Windows.Forms.View.Details;
//
// columnHeaderAudioTrack
//
this.columnHeaderAudioTrack.Text = "Audio tracks";
this.columnHeaderAudioTrack.Width = 160;
//
// checkBoxMakeStereo
//
this.checkBoxMakeStereo.AutoSize = true;
@ -527,6 +547,7 @@ namespace Nikse.SubtitleEdit.Forms
this.pickSubtitleFileToolStripMenuItem.Name = "pickSubtitleFileToolStripMenuItem";
this.pickSubtitleFileToolStripMenuItem.Size = new System.Drawing.Size(166, 22);
this.pickSubtitleFileToolStripMenuItem.Text = "Pick subtitle file...";
this.pickSubtitleFileToolStripMenuItem.Click += new System.EventHandler(this.pickSubtitleFileToolStripMenuItem_Click);
//
// toolStripSeparator1
//
@ -700,26 +721,6 @@ namespace Nikse.SubtitleEdit.Forms
this.buttonMode.UseVisualStyleBackColor = true;
this.buttonMode.Click += new System.EventHandler(this.buttonMode_Click);
//
// listViewAudioTracks
//
this.listViewAudioTracks.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.listViewAudioTracks.CheckBoxes = true;
this.listViewAudioTracks.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.columnHeaderAudioTrack});
this.listViewAudioTracks.HideSelection = false;
this.listViewAudioTracks.Location = new System.Drawing.Point(229, 29);
this.listViewAudioTracks.Name = "listViewAudioTracks";
this.listViewAudioTracks.Size = new System.Drawing.Size(190, 122);
this.listViewAudioTracks.TabIndex = 45;
this.listViewAudioTracks.UseCompatibleStateImageBehavior = false;
this.listViewAudioTracks.View = System.Windows.Forms.View.Details;
//
// columnHeaderAudioTrack
//
this.columnHeaderAudioTrack.Text = "Audio tracks";
this.columnHeaderAudioTrack.Width = 160;
//
// labelPreviewPleaseWait
//
this.labelPreviewPleaseWait.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));

View File

@ -38,6 +38,7 @@ namespace Nikse.SubtitleEdit.Forms
public string VideoFileName { get; private set; }
public long MillisecondsEncoding { get; private set; }
private PreviewVideo _previewVideo;
private readonly bool _initialFontOn;
public bool BatchMode { get; set; }
public string BatchInfo { get; set; }
private readonly List<BatchVideoAndSub> _batchVideoAndSubList;
@ -176,6 +177,12 @@ namespace Nikse.SubtitleEdit.Forms
numericUpDownCutToMinutes.Left = numericUpDownCutToHours.Right + 1;
numericUpDownCutToSeconds.Left = numericUpDownCutToMinutes.Right + 1;
if (string.IsNullOrEmpty(inputVideoFileName) || _videoInfo == null || _videoInfo.Width == 0 || _videoInfo.Height == 0)
{
buttonMode_Click(null, null);
buttonMode.Visible = false;
}
_isAssa = !fontSize.HasValue;
if (fontSize.HasValue && !_noSubtitles)
{
@ -194,21 +201,12 @@ namespace Nikse.SubtitleEdit.Forms
checkBoxRightToLeft.Checked = Configuration.Settings.General.RightToLeftMode &&
LanguageAutoDetect.CouldBeRightToLeftLanguage(_assaSubtitle);
_initialFontOn = true;
}
else
{
numericUpDownFontSize.Enabled = false;
labelFontSize.Enabled = false;
labelSubtitleFont.Enabled = false;
comboBoxSubtitleFont.Enabled = false;
checkBoxRightToLeft.Left = checkBoxTargetFileSize.Left;
checkBoxAlignRight.Enabled = false;
checkBoxBox.Enabled = false;
labelInfo.Text = LanguageSettings.Current.GenerateVideoWithBurnedInSubs.InfoAssaOn;
buttonForeColor.Enabled = false;
buttonOutlineColor.Enabled = false;
panelOutlineColor.Enabled = false;
panelForeColor.Enabled = false;
_initialFontOn = false;
FontEnableOrDisable(false);
}
var initialFont = Configuration.Settings.Tools.GenVideoFontName;
@ -216,6 +214,7 @@ namespace Nikse.SubtitleEdit.Forms
{
initialFont = Configuration.Settings.Tools.ExportBluRayFontName;
}
labelInfo.Text = LanguageSettings.Current.GenerateVideoWithBurnedInSubs.InfoAssaOn;
if (string.IsNullOrEmpty(initialFont))
{
initialFont = UiUtil.GetDefaultFont().Name;
@ -336,11 +335,30 @@ namespace Nikse.SubtitleEdit.Forms
listViewAudioTracks.Visible = false;
}
FontEnableOrDisable(BatchMode || _initialFontOn);
}
if (string.IsNullOrEmpty(inputVideoFileName) || _videoInfo == null || _videoInfo.Width == 0 || _videoInfo.Height == 0)
private void FontEnableOrDisable(bool enabled)
{
buttonMode_Click(null, null);
buttonMode.Visible = false;
numericUpDownFontSize.Enabled = enabled;
labelFontSize.Enabled = enabled;
labelSubtitleFont.Enabled = enabled;
comboBoxSubtitleFont.Enabled = enabled;
checkBoxRightToLeft.Left = checkBoxTargetFileSize.Left;
checkBoxAlignRight.Enabled = enabled;
checkBoxBox.Enabled = enabled;
buttonForeColor.Enabled = enabled;
buttonOutlineColor.Enabled = enabled;
panelOutlineColor.Enabled = enabled;
panelForeColor.Enabled = enabled;
if (!BatchMode)
{
labelInfo.Text = LanguageSettings.Current.GenerateVideoWithBurnedInSubs.InfoAssaOn;
}
else
{
labelInfo.Text = string.Empty;
}
}
@ -1935,6 +1953,8 @@ namespace Nikse.SubtitleEdit.Forms
buttonMode.Text = BatchMode
? LanguageSettings.Current.AudioToText.BatchMode
: LanguageSettings.Current.Split.Basic;
FontEnableOrDisable(BatchMode || _initialFontOn);
}
private void addFilesToolStripMenuItem_Click(object sender, EventArgs e)
@ -2107,5 +2127,24 @@ namespace Nikse.SubtitleEdit.Forms
{
clearToolStripMenuItem_Click(null, null);
}
private void pickSubtitleFileToolStripMenuItem_Click(object sender, EventArgs e)
{
using (var openFileDialog1 = new OpenFileDialog())
{
openFileDialog1.Title = LanguageSettings.Current.General.OpenSubtitle;
openFileDialog1.FileName = string.Empty;
openFileDialog1.Filter = UiUtil.SubtitleExtensionFilter.Value;
openFileDialog1.Multiselect = false;
if (openFileDialog1.ShowDialog(this) != DialogResult.OK)
{
return;
}
var idx = listViewBatch.SelectedIndices[0];
_batchVideoAndSubList[idx].SubtitleFileName = openFileDialog1.FileName;
listViewBatch.Items[idx].SubItems[2].Text = Path.GetFileName(openFileDialog1.FileName);
}
}
}
}