mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-21 18:52:36 +01:00
Fix minor whisper cmd setting UI issue
This commit is contained in:
parent
d1e66d2b53
commit
22173fb253
@ -137,6 +137,7 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
|
||||
Init();
|
||||
InitializeWhisperEngines(comboBoxWhisperEngine);
|
||||
FixPurfviewWhisperStandardArgument(labelAdvanced, comboBoxWhisperEngine.Text);
|
||||
}
|
||||
|
||||
public static void InitializeWhisperEngines(NikseComboBox cb)
|
||||
@ -1993,18 +1994,7 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
|
||||
private void comboBoxWhisperEngine_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (comboBoxWhisperEngine.Text != WhisperChoice.PurfviewFasterWhisper && Configuration.Settings.Tools.WhisperExtraSettings.Contains("--standard", StringComparison.Ordinal))
|
||||
{
|
||||
Configuration.Settings.Tools.WhisperExtraSettings = Configuration.Settings.Tools.WhisperExtraSettings.Replace("--standard", string.Empty).Trim();
|
||||
labelAdvanced.Text = Configuration.Settings.Tools.WhisperExtraSettings;
|
||||
}
|
||||
else if (comboBoxWhisperEngine.Text == WhisperChoice.PurfviewFasterWhisper &&
|
||||
!Configuration.Settings.Tools.WhisperExtraSettings.Contains("--standard", StringComparison.Ordinal) &&
|
||||
Configuration.Settings.Tools.WhisperPurfviewFasterWhisperDefaultCmd == "--standard")
|
||||
{
|
||||
Configuration.Settings.Tools.WhisperExtraSettings = Configuration.Settings.Tools.WhisperPurfviewFasterWhisperDefaultCmd;
|
||||
labelAdvanced.Text = Configuration.Settings.Tools.WhisperExtraSettings;
|
||||
}
|
||||
FixPurfviewWhisperStandardArgument(labelAdvanced, comboBoxWhisperEngine.Text);
|
||||
|
||||
if (comboBoxWhisperEngine.Text == Configuration.Settings.Tools.WhisperChoice)
|
||||
{
|
||||
@ -2077,6 +2067,22 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
}
|
||||
}
|
||||
|
||||
internal static void FixPurfviewWhisperStandardArgument(Label label, string engine)
|
||||
{
|
||||
if (engine != WhisperChoice.PurfviewFasterWhisper && Configuration.Settings.Tools.WhisperExtraSettings.Contains("--standard", StringComparison.Ordinal))
|
||||
{
|
||||
Configuration.Settings.Tools.WhisperExtraSettings = Configuration.Settings.Tools.WhisperExtraSettings.Replace("--standard", string.Empty).Trim();
|
||||
}
|
||||
else if (engine == WhisperChoice.PurfviewFasterWhisper &&
|
||||
!Configuration.Settings.Tools.WhisperExtraSettings.Contains("--standard", StringComparison.Ordinal) &&
|
||||
Configuration.Settings.Tools.WhisperPurfviewFasterWhisperDefaultCmd == "--standard")
|
||||
{
|
||||
Configuration.Settings.Tools.WhisperExtraSettings = Configuration.Settings.Tools.WhisperPurfviewFasterWhisperDefaultCmd;
|
||||
}
|
||||
|
||||
label.Text = Configuration.Settings.Tools.WhisperExtraSettings;
|
||||
}
|
||||
|
||||
private void setCPPConstMeModelsFolderToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
using (var folderBrowserDialog1 = new FolderBrowserDialog())
|
||||
|
@ -77,6 +77,7 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
}
|
||||
|
||||
WhisperAudioToText.InitializeWhisperEngines(comboBoxWhisperEngine);
|
||||
WhisperAudioToText.FixPurfviewWhisperStandardArgument(labelAdvanced, comboBoxWhisperEngine.Text);
|
||||
}
|
||||
|
||||
private void Init()
|
||||
@ -667,6 +668,8 @@ namespace Nikse.SubtitleEdit.Forms.AudioToText
|
||||
|
||||
private void comboBoxWhisperEngine_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
WhisperAudioToText.FixPurfviewWhisperStandardArgument(labelAdvanced, comboBoxWhisperEngine.Text);
|
||||
|
||||
if (comboBoxWhisperEngine.Text == Configuration.Settings.Tools.WhisperChoice)
|
||||
{
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user