Added function to announce generic on/off toggle settings.

This commit is contained in:
Silvano Seva 2022-08-26 17:03:13 +02:00
parent 33867ec009
commit 99408a5455
3 changed files with 23 additions and 0 deletions

View File

@ -193,6 +193,12 @@ void vp_announceSettingsTimeDate();
*/
void vp_announceSettingsVoiceLevel(const vpQueueFlags_t flags);
/**
* This is called to speak generic settings on/off toggles.
*/
void vp_announceSettingsOnOffToggle(const char* const* stringTableStringPtr,
const vpQueueFlags_t flags, bool val);
/**
*
*/

View File

@ -718,6 +718,19 @@ void vp_announceSettingsVoiceLevel(const vpQueueFlags_t flags)
playIfNeeded(flags);
}
void vp_announceSettingsOnOffToggle(const char* const* stringTableStringPtr,
const vpQueueFlags_t flags, bool val)
{
clearCurrPromptIfNeeded(flags);
if (flags & vpqIncludeDescriptions)
vp_queueStringTableEntry(stringTableStringPtr);
vp_queueStringTableEntry(val ? &currentLanguage->on : &currentLanguage->off);
playIfNeeded(flags);
}
vpQueueFlags_t vp_getVoiceLevelQueueFlags()
{
uint8_t vpLevel = state.settings.vpLevel;

View File

@ -759,6 +759,10 @@ static void _ui_changeVoiceLevel(int variation)
static void _ui_changePhoneticSpell(bool newVal)
{
state.settings.vpPhoneticSpell = newVal ? 1 : 0;
vp_announceSettingsOnOffToggle(&currentLanguage->phonetic,
vp_getVoiceLevelQueueFlags(),
state.settings.vpPhoneticSpell);
}
static bool _ui_checkStandby(long long time_since_last_event)