Added Broadcast to string table for use with voice prompts. Cleaned up hash key announcement.

md1702
vk7js 2022-09-22 11:24:26 +10:00 zatwierdzone przez Silvano Seva
rodzic 3ea4431b35
commit 7cc287643e
7 zmienionych plików z 31 dodań i 26 usunięć

Wyświetl plik

@ -149,7 +149,7 @@ void vp_announceBank(const uint16_t bank, const vpQueueFlags_t flags);
/**
*
*/
void vp_announceM17Info(const channel_t* channel, const vpQueueFlags_t flags);
void vp_announceM17Info(const channel_t* channel, bool isEditing, const vpQueueFlags_t flags);
/**
*

Wyświetl plik

@ -89,6 +89,7 @@ const stringsTable_t englishStrings =
.forEmergencyUse = "For emergency use",
.pressAnyButton = "press any button.",
.accessibility = "Accessibility",
.usedHeap="Used heap"
.usedHeap = "Used heap",
.broadcast = "Broadcast"
};
#endif // ENGLISHSTRINGS_H

Wyświetl plik

@ -95,6 +95,7 @@ typedef struct
const char* pressAnyButton;
const char* accessibility;
const char* usedHeap;
const char* broadcast;
}
stringsTable_t;

Wyświetl plik

@ -250,7 +250,7 @@ void vp_announceChannelSummary(const channel_t* channel,
}
else if (channel->mode == OPMODE_M17)
{
vp_announceM17Info(channel, localFlags);
vp_announceM17Info(channel, false, localFlags);
}
else if (channel->mode == OPMODE_DMR)
{
@ -502,26 +502,31 @@ void vp_announceBank(const uint16_t bank, const vpQueueFlags_t flags)
playIfNeeded(flags);
}
void vp_announceM17Info(const channel_t* channel, const vpQueueFlags_t flags)
void vp_announceM17Info(const channel_t* channel, bool isEditing, const vpQueueFlags_t flags)
{
if (channel == NULL)
return;
clearCurrPromptIfNeeded(flags);
if (state.m17_data.dst_addr[0] != '\0')
{
if (flags & vpqIncludeDescriptions)
{
vp_queuePrompt(PROMPT_DEST_ID);
}
if (isEditing)
{
vp_queuePrompt(PROMPT_EDIT);
}
else if (state.m17_data.dst_addr[0] != '\0')
{
vp_queueString(state.m17_data.dst_addr, vpAnnounceCommonSymbols);
}
else if (channel->m17.contact_index != 0)
else if ((channel != NULL) && (channel->m17.contact_index != 0))
{
vp_announceContactWithIndex(channel->m17.contact_index, flags);
}
else
{
vp_queueStringTableEntry(&currentLanguage->broadcast);
}
playIfNeeded(flags);
}

Wyświetl plik

@ -1280,20 +1280,19 @@ void ui_updateFSM(bool *sync_rtx)
_ui_textInputConfirm(ui_state.new_callsign);
// Save selected dst ID and disable input mode
strncpy(state.m17_data.dst_addr, ui_state.new_callsign, 10);
vp_announceBuffer(&currentLanguage->callsign,
false, true,
state.m17_data.dst_addr);
ui_state.edit_mode = false;
*sync_rtx = true;
vp_announceM17Info(NULL, ui_state.edit_mode,
queueFlags);
}
else if(msg.keys & KEY_HASH)
{
// Save selected dst ID and disable input mode
strncpy(state.m17_data.dst_addr, "", 1);
vp_announceBuffer(&currentLanguage->callsign,
false, true, "-");
ui_state.edit_mode = false;
*sync_rtx = true;
vp_announceM17Info(NULL, ui_state.edit_mode,
queueFlags);
}
else if(msg.keys & KEY_ESC)
// Discard selected dst ID and disable input mode
@ -1338,9 +1337,8 @@ void ui_updateFSM(bool *sync_rtx)
ui_state.edit_mode = true;
// Reset text input variables
_ui_textInputReset(ui_state.new_callsign);
vp_announceBuffer(&currentLanguage->callsign,
true, true,
"");
vp_announceM17Info(NULL, ui_state.edit_mode,
queueFlags);
}
else if(msg.keys & KEY_UP || msg.keys & KNOB_RIGHT)
{

Wyświetl plik

@ -127,12 +127,12 @@ void _ui_drawModeInfo(ui_state_t* ui_state)
case OPMODE_M17:
{
// Print M17 Destination ID on line 3 of 3
char *dst = NULL;
const char *dst = NULL;
if(ui_state->edit_mode)
dst = ui_state->new_callsign;
else
dst = (!strnlen(cfg.destination_address, 10)) ?
"Broadcast" : cfg.destination_address;
currentLanguage->broadcast : cfg.destination_address;
gfx_print(layout.line2_pos, layout.line2_font, TEXT_ALIGN_CENTER,
color_white, "#%s", dst);
break;

Plik binarny nie jest wyświetlany.