This commit is contained in:
Nikolaj Olsson 2024-04-17 20:35:15 +02:00
parent c2120b6797
commit d70939e50b

View File

@ -1140,7 +1140,7 @@ namespace Nikse.SubtitleEdit.Forms
deleteParagraphToolStripMenuItem.Visible = true; deleteParagraphToolStripMenuItem.Visible = true;
toolStripMenuItemFocusTextbox.Visible = true; toolStripMenuItemFocusTextbox.Visible = true;
splitToolStripMenuItem1.Visible = true; splitToolStripMenuItem1.Visible = true;
runWhiperOnParagraphToolStripMenuItem.Visible = e.Paragraph.DurationTotalMilliseconds > 8000; runWhiperOnParagraphToolStripMenuItem.Visible = true;
mergeWithPreviousToolStripMenuItem.Visible = true; mergeWithPreviousToolStripMenuItem.Visible = true;
mergeWithNextToolStripMenuItem.Visible = true; mergeWithNextToolStripMenuItem.Visible = true;
toolStripSeparator11.Visible = true; toolStripSeparator11.Visible = true;
@ -1242,6 +1242,7 @@ namespace Nikse.SubtitleEdit.Forms
extendToPreviousToolStripMenuItem.Visible = false; extendToPreviousToolStripMenuItem.Visible = false;
extendToNextToolStripMenuItem.Visible = false; extendToNextToolStripMenuItem.Visible = false;
toolStripSeparator6.Visible = false; toolStripSeparator6.Visible = false;
runWhiperOnParagraphToolStripMenuItem.Visible = false;
addShotChangeToolStripMenuItem.Visible = false; addShotChangeToolStripMenuItem.Visible = false;
var shotChangeCount = audioVisualizer.ShotChanges?.Count(p => p >= e.Paragraph.StartTime.TotalSeconds && p <= e.Paragraph.EndTime.TotalSeconds); var shotChangeCount = audioVisualizer.ShotChanges?.Count(p => p >= e.Paragraph.StartTime.TotalSeconds && p <= e.Paragraph.EndTime.TotalSeconds);
@ -9880,6 +9881,18 @@ namespace Nikse.SubtitleEdit.Forms
if (useOriginal) if (useOriginal)
{ {
_subtitleOriginal.InsertParagraphInCorrectTimeOrder(p); _subtitleOriginal.InsertParagraphInCorrectTimeOrder(p);
if (_subtitle.Paragraphs.Any(x =>
(p.StartTime.TotalMilliseconds > x.StartTime.TotalMilliseconds && p.StartTime.TotalMilliseconds < x.EndTime.TotalMilliseconds) ||
(p.EndTime.TotalMilliseconds > x.EndTime.TotalMilliseconds && p.EndTime.TotalMilliseconds < x.EndTime.TotalMilliseconds)))
{
// overlap
}
else
{
var p2 = new Paragraph(p);
p2.Text = string.Empty;
_subtitle.InsertParagraphInCorrectTimeOrder(p2);
}
} }
else else
{ {