Fix two bug inTTS regenerate - thx cvrle77 :)

Work on #8981
This commit is contained in:
Nikolaj Olsson 2024-11-08 08:46:39 +01:00
parent 0af4540cdf
commit ba58543a9c
2 changed files with 10 additions and 2 deletions

View File

@ -120,6 +120,8 @@ namespace Nikse.SubtitleEdit.Forms.Tts
private void buttonOK_Click(object sender, EventArgs e) private void buttonOK_Click(object sender, EventArgs e)
{ {
_subtitle.Paragraphs[_index].Text = TextBoxReGenerate.Text.Trim();
_libMpv?.Stop(); _libMpv?.Stop();
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
} }

View File

@ -272,12 +272,18 @@ namespace Nikse.SubtitleEdit.Forms.Tts
using (var form = new RegenerateAudioClip(_textToSpeech, _subtitle, idx, _engine)) using (var form = new RegenerateAudioClip(_textToSpeech, _subtitle, idx, _engine))
{ {
var dr = form.ShowDialog(this); var dr = form.ShowDialog(this);
if (dr == DialogResult.OK) if (dr != DialogResult.OK)
{
return;
}
listViewAudioClips.Items[idx].SubItems[5].Text = _subtitle.Paragraphs[idx].Text;
if (form.FileNameAndSpeedFactor != null)
{ {
_fileNames[idx].Filename = form.FileNameAndSpeedFactor.Filename; _fileNames[idx].Filename = form.FileNameAndSpeedFactor.Filename;
_fileNames[idx].Factor = form.FileNameAndSpeedFactor.Factor; _fileNames[idx].Factor = form.FileNameAndSpeedFactor.Factor;
listViewAudioClips.Items[idx].SubItems[4].Text = $"{(form.FileNameAndSpeedFactor.Factor * 100.0m):0.#}%"; listViewAudioClips.Items[idx].SubItems[4].Text = $"{(form.FileNameAndSpeedFactor.Factor * 100.0m):0.#}%";
listViewAudioClips.Items[idx].SubItems[5].Text = _subtitle.Paragraphs[idx].Text;
} }
} }
} }