mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
Apply duration limit: Fix check selected lines - thx PM :)
This commit is contained in:
parent
08724c30d8
commit
82ac167024
@ -44,6 +44,7 @@
|
||||
* Try to fix Tools - Join... with different ASSA styles - thx Joe
|
||||
* Fix crash in "Continuation style" - thx ivandrofly
|
||||
* Fix export to "dvd studio stl" - thx nonofx
|
||||
* Apply duration limit: Only fix "checked" lines - thx PM
|
||||
|
||||
|
||||
3.6.1 (20th May 2021)
|
||||
|
@ -144,13 +144,13 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
double minDisplayTime = (double)numericUpDownDurationMin.Value;
|
||||
for (int i = 0; i < _working.Paragraphs.Count; i++)
|
||||
{
|
||||
Paragraph p = _working.Paragraphs[i];
|
||||
double displayTime = p.Duration.TotalMilliseconds;
|
||||
var p = _working.Paragraphs[i];
|
||||
var displayTime = p.Duration.TotalMilliseconds;
|
||||
if (displayTime < minDisplayTime)
|
||||
{
|
||||
var next = _working.GetParagraphOrDefault(i + 1);
|
||||
var wantedEndMs = p.StartTime.TotalMilliseconds + minDisplayTime;
|
||||
if (next == null || wantedEndMs < next.StartTime.TotalMilliseconds - Configuration.Settings.General.MinimumMillisecondsBetweenLines && AllowFix(p))
|
||||
if (next == null || wantedEndMs < next.StartTime.TotalMilliseconds - Configuration.Settings.General.MinimumMillisecondsBetweenLines)
|
||||
{
|
||||
AddFix(p, wantedEndMs, DefaultBackColor);
|
||||
}
|
||||
@ -180,21 +180,26 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void AddFix(Paragraph p, double endMs, Color backgroundColor)
|
||||
{
|
||||
string before = p.StartTime.ToShortString() + " --> " + p.EndTime.ToShortString() + " - " + p.Duration.ToShortString();
|
||||
if (!AllowFix(p))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var before = p.StartTime.ToShortString() + " --> " + p.EndTime.ToShortString() + " - " + p.Duration.ToShortString();
|
||||
p.EndTime.TotalMilliseconds = endMs;
|
||||
string after = p.StartTime.ToShortString() + " --> " + p.EndTime.ToShortString() + " - " + p.Duration.ToShortString();
|
||||
var after = p.StartTime.ToShortString() + " --> " + p.EndTime.ToShortString() + " - " + p.Duration.ToShortString();
|
||||
_totalFixes++;
|
||||
AddFixToListView(p, before, after, backgroundColor);
|
||||
}
|
||||
|
||||
public void FixLongDisplayTimes()
|
||||
{
|
||||
double maxDisplayTime = (double)numericUpDownDurationMax.Value;
|
||||
var maxDisplayTime = (double)numericUpDownDurationMax.Value;
|
||||
for (int i = 0; i < _working.Paragraphs.Count; i++)
|
||||
{
|
||||
Paragraph p = _working.Paragraphs[i];
|
||||
double displayTime = p.Duration.TotalMilliseconds;
|
||||
if (displayTime > maxDisplayTime && AllowFix(p))
|
||||
var p = _working.Paragraphs[i];
|
||||
var displayTime = p.Duration.TotalMilliseconds;
|
||||
if (displayTime > maxDisplayTime)
|
||||
{
|
||||
AddFix(p, p.StartTime.TotalMilliseconds + maxDisplayTime, DefaultBackColor);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user