Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,9 @@ private void UpdatePreview()
return;
}

// Build a Subtitle and run the full libse beautifier — it reads the profile
// directly from Configuration.Settings.BeautifyTimeCodes.
var subtitle = new Subtitle();
foreach (var p in _allSubtitles.Select(p => p.Paragraph!).OrderBy(p => p.StartTime.TotalMilliseconds))
{
subtitle.Paragraphs.Add(new Paragraph(p));
}
// Build a Subtitle from the current row values and run the full libse
// beautifier — it reads the profile directly from Configuration.Settings.BeautifyTimeCodes.
var subtitle = BuildSubtitleFromRows();

var beautifier = new Core.Forms.TimeCodesBeautifier(subtitle, _frameRate, new List<double>(), _shotChanges);
beautifier.Beautify();
Expand Down Expand Up @@ -595,11 +591,7 @@ private void Ok()
_timerUpdatePreview.Stop();

// Apply final beautification to commit the result back to _allSubtitles
var subtitle = new Subtitle();
foreach (var p in _allSubtitles.Select(p => p.Paragraph!).OrderBy(p => p.StartTime.TotalMilliseconds))
{
subtitle.Paragraphs.Add(new Paragraph(p));
}
var subtitle = BuildSubtitleFromRows();

var beautifier = new Core.Forms.TimeCodesBeautifier(subtitle, _frameRate, new List<double>(), _shotChanges);
beautifier.Beautify();
Expand Down Expand Up @@ -628,6 +620,17 @@ public List<SubtitleLineViewModel> GetBeautifiedSubtitles()
return new List<SubtitleLineViewModel>(_allSubtitles);
}

private Subtitle BuildSubtitleFromRows()
{
var subtitle = new Subtitle();
foreach (var p in _allSubtitles.Select(p => p.ToParagraph()).OrderBy(p => p.StartTime.TotalMilliseconds))
{
subtitle.Paragraphs.Add(p);
}

return subtitle;
}

internal void OnKeyDown(KeyEventArgs e)
{
if (e.Key == Key.Escape)
Expand Down