cleanup: move stressAmp to LoadLanguageOptions()

This commit is contained in:
Juho Hiltunen
2022-10-09 16:38:53 +03:00
parent 2a462e4afe
commit 46bc25e173
2 changed files with 14 additions and 16 deletions
+13
View File
@@ -110,8 +110,21 @@ void LoadLanguageOptions(Translator *translator, int key, char *keyValue ) {
break;
}
case V_STRESSAMP: {
if (CheckTranslator(translator, langopts_tab, key) != 0)
break;
int stress_amps_set = 0;
int stress_amps[8];
stress_amps_set = Read8Numbers(keyValue, stress_amps);
for (ix = 0; ix < stress_amps_set; ix++) {
translator->stress_amps[ix] = stress_amps[ix];
}
break;
}
case V_STRESSLENGTH: {
if (CheckTranslator(translator, langopts_tab, key) != 0)
break;
+1 -16
View File
@@ -123,6 +123,7 @@ enum {
const MNEM_TAB langopts_tab[] = {
{ "lowercaseSentence", V_LOWERCASE_SENTENCE },
{ "stressAdd", V_STRESSADD },
{ "stressAmp", V_STRESSAMP },
{ "stressLength", V_STRESSLENGTH },
{ "maintainer", V_MAINTAINER },
@@ -141,7 +142,6 @@ static const MNEM_TAB keyword_tab[] = {
{ "pitch", V_PITCH },
{ "phonemes", V_PHONEMES },
{ "dictionary", V_DICTIONARY },
{ "stressAmp", V_STRESSAMP },
{ "intonation", V_INTONATION },
{ "tunes", V_TUNES },
{ "dictrules", V_DICTRULES },
@@ -715,21 +715,6 @@ voice_t *LoadVoice(const char *vname, int control)
break;
case V_STRESSAMP: { // stressAmp
if (CheckTranslator(translator, keyword_tab, key) != 0)
break;
int stress_amps_set = 0;
int stress_amps[8];
stress_amps_set = Read8Numbers(p, stress_amps);
for (ix = 0; ix < stress_amps_set; ix++) {
translator->stress_amps[ix] = stress_amps[ix];
}
break;
}
case V_INTONATION: // intonation
sscanf(p, "%d", &option_tone_flags);
if ((option_tone_flags & 0xff) != 0) {