Allow burn-in without subtitle - thx Leon :)

Fix #8205
This commit is contained in:
Nikolaj Olsson 2024-04-17 15:52:52 +02:00
parent daa88f30c9
commit 780a8f7c7c
3 changed files with 26 additions and 12 deletions

View File

@ -33,6 +33,7 @@ namespace Nikse.SubtitleEdit.Forms
private bool _promptFFmpegParameters; private bool _promptFFmpegParameters;
private readonly bool _mpvOn; private readonly bool _mpvOn;
private readonly string _mpvSubtitleFileName; private readonly string _mpvSubtitleFileName;
private readonly bool _noSubtitles;
public string VideoFileName { get; private set; } public string VideoFileName { get; private set; }
public long MillisecondsEncoding { get; private set; } public long MillisecondsEncoding { get; private set; }
private PreviewVideo _previewVideo; private PreviewVideo _previewVideo;
@ -49,6 +50,10 @@ namespace Nikse.SubtitleEdit.Forms
_assaSubtitle = new Subtitle(assaSubtitle); _assaSubtitle = new Subtitle(assaSubtitle);
_inputVideoFileName = inputVideoFileName; _inputVideoFileName = inputVideoFileName;
_noSubtitles = _assaSubtitle == null ||
_assaSubtitle.Paragraphs.Count == 0 ||
(_assaSubtitle.Paragraphs.Count == 1 && string.IsNullOrWhiteSpace(_assaSubtitle.Paragraphs[0].Text));
if (format.GetType() == typeof(NetflixImsc11Japanese)) if (format.GetType() == typeof(NetflixImsc11Japanese))
{ {
_assaSubtitle = new Subtitle(); _assaSubtitle = new Subtitle();
@ -148,7 +153,7 @@ namespace Nikse.SubtitleEdit.Forms
numericUpDownCutToSeconds.Left = numericUpDownCutToMinutes.Right + 1; numericUpDownCutToSeconds.Left = numericUpDownCutToMinutes.Right + 1;
_isAssa = !fontSize.HasValue; _isAssa = !fontSize.HasValue;
if (fontSize.HasValue) if (fontSize.HasValue && !_noSubtitles)
{ {
if (fontSize.Value < numericUpDownFontSize.Minimum) if (fontSize.Value < numericUpDownFontSize.Minimum)
{ {
@ -268,9 +273,18 @@ namespace Nikse.SubtitleEdit.Forms
videoPlayerContainer1.Visible = false; videoPlayerContainer1.Visible = false;
} }
if (_isAssa) if (_noSubtitles)
{ {
checkBoxRightToLeft.Enabled = false;
labelProgress.Text = LanguageSettings.Current.Main.NoSubtitleLoaded;
if (Configuration.Settings.General.UseDarkTheme)
{
labelProgress.ForeColor = Color.Yellow;
}
else
{
labelProgress.ForeColor = Color.DarkGoldenrod;
}
} }
} }
@ -312,6 +326,9 @@ namespace Nikse.SubtitleEdit.Forms
private void buttonGenerate_Click(object sender, EventArgs e) private void buttonGenerate_Click(object sender, EventArgs e)
{ {
labelProgress.Text = string.Empty;
labelProgress.ForeColor = UiUtil.ForeColor;
if (checkBoxCut.Checked) if (checkBoxCut.Checked)
{ {
var cutStart = GetCutStart(); var cutStart = GetCutStart();
@ -1343,6 +1360,9 @@ namespace Nikse.SubtitleEdit.Forms
private void buttonPreview_Click(object sender, EventArgs e) private void buttonPreview_Click(object sender, EventArgs e)
{ {
labelProgress.Text = string.Empty;
labelProgress.ForeColor = UiUtil.ForeColor;
try try
{ {
buttonPreview.Enabled = false; buttonPreview.Enabled = false;

View File

@ -35607,12 +35607,6 @@ namespace Nikse.SubtitleEdit.Forms
return; return;
} }
if (_subtitle == null || _subtitle.Paragraphs.Count == 0)
{
DisplaySubtitleNotLoadedMessage();
return;
}
if (!RequireFfmpegOk()) if (!RequireFfmpegOk())
{ {
return; return;

View File

@ -94,13 +94,13 @@ namespace Nikse.SubtitleEdit.Forms.Tts
_engines = new List<TextToSpeechEngine>(); _engines = new List<TextToSpeechEngine>();
_engines.Add(new TextToSpeechEngine(TextToSpeechEngineId.Piper, "Piper (fast/good)", _engines.Count)); _engines.Add(new TextToSpeechEngine(TextToSpeechEngineId.Piper, "Piper (fast/good)", _engines.Count));
_engines.Add(new TextToSpeechEngine(TextToSpeechEngineId.Tortoise, "Tortoise TTS (very slow/very good)", _engines.Count)); _engines.Add(new TextToSpeechEngine(TextToSpeechEngineId.Tortoise, "Tortoise TTS (very slow/good)", _engines.Count));
_engines.Add(new TextToSpeechEngine(TextToSpeechEngineId.Coqui, "coqui TTS", _engines.Count)); _engines.Add(new TextToSpeechEngine(TextToSpeechEngineId.Coqui, "Coqui AI TTS (only one voice)", _engines.Count));
if (Configuration.IsRunningOnWindows) if (Configuration.IsRunningOnWindows)
{ {
_engines.Add(new TextToSpeechEngine(TextToSpeechEngineId.MsSpeechSynthesizer, "Microsoft SpeechSynthesizer (very fast/robotic)", _engines.Count)); _engines.Add(new TextToSpeechEngine(TextToSpeechEngineId.MsSpeechSynthesizer, "Microsoft SpeechSynthesizer (very fast/robotic)", _engines.Count));
} }
_engines.Add(new TextToSpeechEngine(TextToSpeechEngineId.ElevenLabs, "ElevenLabs TTS", _engines.Count)); _engines.Add(new TextToSpeechEngine(TextToSpeechEngineId.ElevenLabs, "ElevenLabs TTS (online/pay/good)", _engines.Count));
_actorAndVoices = new List<ActorAndVoice>(); _actorAndVoices = new List<ActorAndVoice>();
nikseComboBoxEngine.DropDownStyle = ComboBoxStyle.DropDownList; nikseComboBoxEngine.DropDownStyle = ComboBoxStyle.DropDownList;