From d81a4220d1e87e4b1c1e96774339e98d4b232764 Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Mon, 29 Aug 2022 21:35:44 +0200 Subject: [PATCH] Fixed voice prompt bugs Fixed following voice prompt bugs: 1. Now say OpenRTX when powering on if vp enabled to let user know radio is on. 2. When switching back to VFO or channel mode from menus, now anounce VFO info or channel info. 3. When entering first digit of frequency in VFO input mode, say it. 4. Refixed issue of concatenating menus rather than clearing menu. --- openrtx/src/core/voicePrompts.c | 6 ++++++ openrtx/src/ui/ui.c | 16 ++++++++++++++++ openrtx/src/ui/ui_menu.c | 9 ++++++--- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/openrtx/src/core/voicePrompts.c b/openrtx/src/core/voicePrompts.c index 1b7f11dc..0bad5925 100644 --- a/openrtx/src/core/voicePrompts.c +++ b/openrtx/src/core/voicePrompts.c @@ -279,6 +279,12 @@ void vp_init() // Initialize codec2 module codec_init(); + + if (state.settings.vpLevel > vpBeep) + { + vp_queueStringTableEntry(¤tLanguage->openRTX); + vp_play(); + } } void vp_terminate() diff --git a/openrtx/src/ui/ui.c b/openrtx/src/ui/ui.c index b3a4b556..3ebd5c87 100644 --- a/openrtx/src/ui/ui.c +++ b/openrtx/src/ui/ui.c @@ -1169,6 +1169,8 @@ void ui_updateFSM(bool *sync_rtx) { macro_menu = false; } + + int priorUIScreen = state.ui_screen; switch(state.ui_screen) { // VFO screen @@ -1905,6 +1907,20 @@ void ui_updateFSM(bool *sync_rtx) { vp_replayLastPrompt(); } + else if ((priorUIScreen!=state.ui_screen) && state.settings.vpLevel > vpLow) + { + // When we switch to VFO or Channel screen, we need to announce it. + // All other cases are handled as needed. + if (state.ui_screen == MAIN_VFO) + { + vp_announceChannelSummary(&state.channel, 0, state.bank); + } + else if (state.ui_screen == MAIN_MEM) + { + vp_announceChannelSummary(&state.channel, state.channel_index, + state.bank); + } + } } else if(event.type == EVENT_STATUS) { diff --git a/openrtx/src/ui/ui_menu.c b/openrtx/src/ui/ui_menu.c index 69007e49..9deee74c 100644 --- a/openrtx/src/ui/ui_menu.c +++ b/openrtx/src/ui/ui_menu.c @@ -103,14 +103,17 @@ static void announceMenuItemIfNeeded(char* name, char* value) // prompt if arrowing rapidly. bool voicePromptWasPlaying = vp_isPlaying(); - // Stop any prompt in progress and clear the buffer. - if (voicePromptWasPlaying) - vp_clearCurrPrompt(); + // Stop any prompt in progress and/or clear the buffer. + 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); + // This is a top-level menu rather than a menu/value pair. + if (value == NULL) + vp_queueStringTableEntry(¤tLanguage->menu); + if ((value != NULL) && (*value != '\0')) vp_announceText(value, vpqDefault);