Adjusted vp_anounceBuffer to distinguish between a callsign buffer and a regular name buffer.
This commit is contained in:
parent
a1d782b16c
commit
ac7a2b94a9
|
|
@ -206,8 +206,7 @@ void vp_announceScreen(uint8_t ui_screen);
|
|||
* This function is called from ui_updateFSM to speak string buffers.
|
||||
*/
|
||||
void vp_announceBuffer(const char* const* stringTableStringPtr, bool editMode,
|
||||
const char* buffer);
|
||||
|
||||
bool callsign, const char* buffer);
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
|||
|
|
@ -750,12 +750,13 @@ void vp_announceScreen(uint8_t ui_screen)
|
|||
break;
|
||||
case SETTINGS_M17:
|
||||
vp_announceBuffer(¤tLanguage->callsign,
|
||||
false, state.settings.callsign);
|
||||
false, true, state.settings.callsign);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void vp_announceBuffer(const char* const* stringTableStringPtr, bool editMode,
|
||||
void vp_announceBuffer(const char* const* stringTableStringPtr,
|
||||
bool editMode, bool callsign,
|
||||
const char* buffer)
|
||||
{
|
||||
bool isPlaying=vp_isPlaying();
|
||||
|
|
@ -772,7 +773,8 @@ void vp_announceBuffer(const char* const* stringTableStringPtr, bool editMode,
|
|||
|
||||
vpFlags_t flags= vpAnnounceCommonSymbols;
|
||||
// add edit mode flags to adjust what is spoken.
|
||||
if (editMode)
|
||||
// extra symbols not relevant when entering callsign.
|
||||
if (editMode && !callsign)
|
||||
flags |= vpAnnounceLessCommonSymbols | vpAnnounceSpace | vpAnnounceASCIIValueForUnknownChars;
|
||||
|
||||
vp_queueString(buffer, flags);
|
||||
|
|
|
|||
|
|
@ -1054,7 +1054,12 @@ static void _ui_textInputConfirm(char *buf)
|
|||
static void _ui_textInputDel(char *buf)
|
||||
{
|
||||
// announce the char about to be backspaced.
|
||||
if(buf[ui_state.input_position])
|
||||
// Note this assumes editing callsign.
|
||||
// If we edit a different buffer which allows the underline char, we may
|
||||
// not want to exclude it, but when editing callsign, we do not want to say
|
||||
// underline since it means the field is empty.
|
||||
if(buf[ui_state.input_position]
|
||||
&& buf[ui_state.input_position]!='_')
|
||||
vp_announceInputChar(buf[ui_state.input_position]);
|
||||
|
||||
buf[ui_state.input_position] = '\0';
|
||||
|
|
@ -1844,14 +1849,14 @@ void ui_updateFSM(bool *sync_rtx)
|
|||
ui_state.edit_mode = false;
|
||||
*sync_rtx = true;
|
||||
vp_announceBuffer(¤tLanguage->callsign,
|
||||
false, state.settings.callsign);
|
||||
false, true, state.settings.callsign);
|
||||
}
|
||||
else if(msg.keys & KEY_ESC)
|
||||
{
|
||||
// Discard selected callsign and disable input mode
|
||||
ui_state.edit_mode = false;
|
||||
vp_announceBuffer(¤tLanguage->callsign,
|
||||
false, state.settings.callsign);
|
||||
false, true, state.settings.callsign);
|
||||
}
|
||||
else if(msg.keys & KEY_UP || msg.keys & KEY_DOWN ||
|
||||
msg.keys & KEY_LEFT || msg.keys & KEY_RIGHT)
|
||||
|
|
@ -1861,7 +1866,7 @@ void ui_updateFSM(bool *sync_rtx)
|
|||
else if (msg.long_press && (msg.keys & KEY_F1) && (state.settings.vpLevel > vpBeep))
|
||||
{
|
||||
vp_announceBuffer(¤tLanguage->callsign,
|
||||
true, ui_state.new_callsign);
|
||||
true, true, ui_state.new_callsign);
|
||||
f1Handled=true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1874,7 +1879,7 @@ void ui_updateFSM(bool *sync_rtx)
|
|||
// Reset text input variables
|
||||
_ui_textInputReset(ui_state.new_callsign);
|
||||
vp_announceBuffer(¤tLanguage->callsign,
|
||||
true, ui_state.new_callsign);
|
||||
true, true, ui_state.new_callsign);
|
||||
}
|
||||
else if(msg.keys & KEY_ESC)
|
||||
_ui_menuBack(MENU_SETTINGS);
|
||||
|
|
|
|||
Loading…
Reference in New Issue