kopia lustrzana https://github.com/OpenRTX/OpenRTX
Fixed speaking of voice prompt level when changing from the menu.
rodzic
7a78ece920
commit
33867ec009
|
@ -188,6 +188,11 @@ void vp_announceRestoreScreen();
|
|||
void vp_announceSettingsTimeDate();
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This is called to speak voice prompt level changes.
|
||||
*/
|
||||
void vp_announceSettingsVoiceLevel(const vpQueueFlags_t flags);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
|
|
@ -180,6 +180,9 @@ typedef enum
|
|||
}
|
||||
voicePrompt_t;
|
||||
|
||||
// The name of the voice prompt file is always encoded as the last prompt.
|
||||
#define PROMPT_VOICE_NAME (NUM_VOICE_PROMPTS + (sizeof(stringsTable_t)/sizeof(char*)))
|
||||
|
||||
/**
|
||||
* Flags controlling how vp_queueString operates.
|
||||
*/
|
||||
|
|
|
@ -692,6 +692,31 @@ void vp_announceSettingsTimeDate()
|
|||
}
|
||||
#endif // RTC_PRESENT
|
||||
|
||||
void vp_announceSettingsVoiceLevel(const vpQueueFlags_t flags)
|
||||
{
|
||||
clearCurrPromptIfNeeded(flags);
|
||||
switch (state.settings.vpLevel)
|
||||
{
|
||||
case vpNone:
|
||||
vp_queueStringTableEntry(¤tLanguage->off);
|
||||
break;
|
||||
|
||||
case vpBeep:
|
||||
vp_queueStringTableEntry(¤tLanguage->beep);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (flags & vpqIncludeDescriptions)
|
||||
{
|
||||
vp_queuePrompt(PROMPT_VOICE_NAME);
|
||||
vp_queueStringTableEntry(¤tLanguage->level);
|
||||
}
|
||||
vp_queueInteger(state.settings.vpLevel-vpBeep);
|
||||
break;
|
||||
}
|
||||
|
||||
playIfNeeded(flags);
|
||||
}
|
||||
|
||||
vpQueueFlags_t vp_getVoiceLevelQueueFlags()
|
||||
{
|
||||
|
|
|
@ -742,6 +742,18 @@ static void _ui_changeVoiceLevel(int variation)
|
|||
}
|
||||
|
||||
state.settings.vpLevel += variation;
|
||||
|
||||
// Force these flags to ensure the changes are spoken for levels 1 through 3.
|
||||
vpQueueFlags_t flags = vpqInit
|
||||
| vpqAddSeparatingSilence
|
||||
| vpqPlayImmediately;
|
||||
|
||||
if (!vp_isPlaying())
|
||||
{
|
||||
flags |= vpqIncludeDescriptions;
|
||||
}
|
||||
|
||||
vp_announceSettingsVoiceLevel(flags);
|
||||
}
|
||||
|
||||
static void _ui_changePhoneticSpell(bool newVal)
|
||||
|
|
|
@ -102,8 +102,11 @@ static void announceMenuItemIfNeeded(char* name, char* value)
|
|||
// e.g. when changing a value with left or right, we don't want to repeat the
|
||||
// prompt if arrowing rapidly.
|
||||
bool voicePromptWasPlaying = vp_isPlaying();
|
||||
|
||||
// Stop any prompt in progress and clear the buffer.
|
||||
if (voicePromptWasPlaying)
|
||||
vp_clearCurrPrompt();
|
||||
|
||||
// If no value is supplied, or, no prompt is in progress, announce the name.
|
||||
if ((voicePromptWasPlaying == false) || (value == NULL) || (*value == '\0'))
|
||||
vp_announceText(name, vpqDefault);
|
||||
|
|
Ładowanie…
Reference in New Issue