kopia lustrzana https://github.com/OpenRTX/OpenRTX
Updated voice prompt for UTC timezone to support also half hour values, thanks to Joe VK7JS.
rodzic
ce1dc202ae
commit
ae8bba88b6
|
@ -223,9 +223,18 @@ vpQueueFlags_t vp_getVoiceLevelQueueFlags();
|
|||
*
|
||||
*/
|
||||
void vp_playMenuBeepIfNeeded(bool firstItem);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
void vp_announceSplashScreen();
|
||||
|
||||
/**
|
||||
* Announce timezone value.
|
||||
*
|
||||
* @param timeZone: timezone value.
|
||||
* @param flags: control flags.
|
||||
*/
|
||||
void vp_announceTimeZone(const int8_t timeZone, const vpQueueFlags_t flags);
|
||||
|
||||
#endif // VOICE_PROMPT_UTILS_H
|
||||
|
|
|
@ -1066,3 +1066,38 @@ void vp_announceSplashScreen()
|
|||
vp_announceRadioMode(state.channel.mode, localFlags);
|
||||
vp_play();
|
||||
}
|
||||
|
||||
void vp_announceTimeZone(const int8_t timeZone, const vpQueueFlags_t flags)
|
||||
{
|
||||
clearCurrPromptIfNeeded(flags);
|
||||
|
||||
if (flags & vpqIncludeDescriptions)
|
||||
{
|
||||
vp_queueStringTableEntry(¤tLanguage->UTCTimeZone);
|
||||
}
|
||||
|
||||
int wholeHours = timeZone / 2;
|
||||
int halfHour = timeZone % 2;
|
||||
|
||||
// While vp_queueInteeger handles negative numbers, we want to explicitly
|
||||
// say the sign even when positive.
|
||||
if (timeZone > 0)
|
||||
{
|
||||
vp_queuePrompt(PROMPT_PLUS);
|
||||
}
|
||||
else if (timeZone < 0)
|
||||
{
|
||||
vp_queuePrompt(PROMPT_MINUS);
|
||||
wholeHours *= -1;
|
||||
}
|
||||
|
||||
vp_queueInteger(wholeHours);
|
||||
|
||||
if (halfHour != 0)
|
||||
{
|
||||
vp_queuePrompt(PROMPT_POINT);
|
||||
vp_queueInteger(5);
|
||||
}
|
||||
|
||||
playIfNeeded(flags);
|
||||
}
|
||||
|
|
|
@ -1899,9 +1899,7 @@ void ui_updateFSM(bool *sync_rtx)
|
|||
else if(msg.keys & KEY_RIGHT || msg.keys & KEY_UP ||
|
||||
msg.keys & KNOB_RIGHT)
|
||||
state.settings.utc_timezone += 1;
|
||||
vp_announceSettingsInt(¤tLanguage->UTCTimeZone,
|
||||
queueFlags,
|
||||
state.settings.utc_timezone);
|
||||
vp_announceTimeZone(state.settings.utc_timezone, queueFlags);
|
||||
break;
|
||||
default:
|
||||
state.ui_screen = SETTINGS_GPS;
|
||||
|
|
Ładowanie…
Reference in New Issue