mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 12:44:46 +01:00
Minor UI fix
This commit is contained in:
parent
5eacb31f0b
commit
6e8944742a
@ -1439,9 +1439,9 @@ namespace Nikse.SubtitleEdit.Forms.Tts
|
||||
nikseComboBoxRegion.Text = Configuration.Settings.Tools.TextToSpeechAzureRegion;
|
||||
}
|
||||
|
||||
if (nikseComboBoxVoice.Items.Count > 0)
|
||||
if (nikseComboBoxVoice.Items.Count > 0 && nikseComboBoxVoice.SelectedIndex < 0)
|
||||
{
|
||||
nikseComboBoxVoice.SelectedIndex = 0;
|
||||
SetFirstLanguageHitAsVoice();
|
||||
}
|
||||
|
||||
if (nikseComboBoxVoice.Items.Count > 1)
|
||||
@ -1698,6 +1698,28 @@ namespace Nikse.SubtitleEdit.Forms.Tts
|
||||
}
|
||||
}
|
||||
|
||||
private void SetFirstLanguageHitAsVoice()
|
||||
{
|
||||
nikseComboBoxVoice.Text = Configuration.Settings.Tools.TextToSpeechLastVoice;
|
||||
if (nikseComboBoxVoice.Text == Configuration.Settings.Tools.TextToSpeechLastVoice)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var language = LanguageAutoDetect.AutoDetectGoogleLanguage(_subtitle);
|
||||
for (var index = 0; index < nikseComboBoxVoice.Items.Count; index++)
|
||||
{
|
||||
var item = (string)nikseComboBoxVoice.Items[index];
|
||||
if (item.StartsWith(language, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
nikseComboBoxVoice.SelectedIndex = index;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
nikseComboBoxVoice.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
private List<PiperModel> GetPiperVoices(bool useCache)
|
||||
{
|
||||
var ttsPath = Path.Combine(Configuration.DataDirectory, "TextToSpeech");
|
||||
|
Loading…
Reference in New Issue
Block a user