mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 04:33:04 +01:00
Work on Whisper and Translator mode problems - thx rRobis :)
Work #8204
This commit is contained in:
parent
d6f56a0aec
commit
c2120b6797
@ -48,7 +48,6 @@ using System.Threading;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using Nikse.SubtitleEdit.Forms.Tts;
|
using Nikse.SubtitleEdit.Forms.Tts;
|
||||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TrackBar;
|
|
||||||
using CheckForUpdatesHelper = Nikse.SubtitleEdit.Logic.CheckForUpdatesHelper;
|
using CheckForUpdatesHelper = Nikse.SubtitleEdit.Logic.CheckForUpdatesHelper;
|
||||||
using MessageBox = Nikse.SubtitleEdit.Forms.SeMsgBox.MessageBox;
|
using MessageBox = Nikse.SubtitleEdit.Forms.SeMsgBox.MessageBox;
|
||||||
using Timer = System.Windows.Forms.Timer;
|
using Timer = System.Windows.Forms.Timer;
|
||||||
@ -9850,6 +9849,9 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var useOriginal = Configuration.Settings.General.AllowEditOfOriginalSubtitle &&
|
||||||
|
_subtitleOriginal != null &&
|
||||||
|
SubtitleListview1.IsOriginalTextColumnVisible;
|
||||||
var audioClips = GetAudioClips();
|
var audioClips = GetAudioClips();
|
||||||
if (audioClips.Count == 1 && audioClips[0].Paragraph.DurationTotalMilliseconds > 8_000)
|
if (audioClips.Count == 1 && audioClips[0].Paragraph.DurationTotalMilliseconds > 8_000)
|
||||||
{
|
{
|
||||||
@ -9875,9 +9877,18 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
foreach (var p in form.TranscribedSubtitle.Paragraphs)
|
foreach (var p in form.TranscribedSubtitle.Paragraphs)
|
||||||
{
|
{
|
||||||
p.Adjust(1, audioClips[0].Paragraph.StartTime.TotalSeconds);
|
p.Adjust(1, audioClips[0].Paragraph.StartTime.TotalSeconds);
|
||||||
_subtitle.InsertParagraphInCorrectTimeOrder(p);
|
if (useOriginal)
|
||||||
|
{
|
||||||
|
_subtitleOriginal.InsertParagraphInCorrectTimeOrder(p);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_subtitle.InsertParagraphInCorrectTimeOrder(p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_subtitle.Renumber();
|
||||||
|
_subtitleOriginal.Renumber();
|
||||||
SubtitleListview1.Fill(_subtitle, _subtitleOriginal);
|
SubtitleListview1.Fill(_subtitle, _subtitleOriginal);
|
||||||
RestoreSubtitleListviewIndices();
|
RestoreSubtitleListviewIndices();
|
||||||
RefreshSelectedParagraph();
|
RefreshSelectedParagraph();
|
||||||
@ -9898,9 +9909,22 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
var p = _subtitle.Paragraphs.FirstOrDefault(pa => pa.Id == ac.Paragraph.Id);
|
var p = _subtitle.Paragraphs.FirstOrDefault(pa => pa.Id == ac.Paragraph.Id);
|
||||||
if (p != null)
|
if (p != null)
|
||||||
{
|
{
|
||||||
p.Text = ac.Paragraph.Text;
|
if (useOriginal)
|
||||||
var idx = _subtitle.Paragraphs.IndexOf(p);
|
{
|
||||||
SubtitleListview1.SetText(idx, p.Text);
|
var original = Utilities.GetOriginalParagraph(_subtitle.Paragraphs.IndexOf(p), p, _subtitleOriginal.Paragraphs);
|
||||||
|
if (original != null)
|
||||||
|
{
|
||||||
|
original.Text = ac.Paragraph.Text;
|
||||||
|
var idx = _subtitleOriginal.Paragraphs.IndexOf(original);
|
||||||
|
SubtitleListview1.SetOriginalText(idx, original.Text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p.Text = ac.Paragraph.Text;
|
||||||
|
var idx = _subtitle.Paragraphs.IndexOf(p);
|
||||||
|
SubtitleListview1.SetText(idx, p.Text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user