Added pauses between lots of info in summary for comprehensibility.

md1702
vk7js 2022-05-19 20:12:42 +10:00 zatwierdzone przez Silvano Seva
rodzic 46e3900462
commit c0371dad2a
3 zmienionych plików z 32 dodań i 8 usunięć

Wyświetl plik

@ -217,7 +217,8 @@ typedef enum
vpqInit=0x01, // stop any voice prompts already in progress. vpqInit=0x01, // stop any voice prompts already in progress.
vpqPlayImmediately=0x02, // call play after queue at all levels. vpqPlayImmediately=0x02, // call play after queue at all levels.
vpqPlayImmediatelyAtMediumOrHigher =0x04, vpqPlayImmediatelyAtMediumOrHigher =0x04,
vpqIncludeDescriptions=0x08 vpqIncludeDescriptions=0x08,
vpqAddSeparatingSilence=0x10
} VoicePromptQueueFlags_T; } VoicePromptQueueFlags_T;
typedef enum typedef enum

Wyświetl plik

@ -39,6 +39,15 @@ static void vpPlayIfNeeded(VoicePromptQueueFlags_T flags)
vpPlay(); vpPlay();
} }
static void addSilenceIfNeeded(VoicePromptQueueFlags_T flags)
{
if ((flags & vpqAddSeparatingSilence) == 0)
return;
vpQueuePrompt(PROMPT_SILENCE);
vpQueuePrompt(PROMPT_SILENCE);
}
static void removeUnnecessaryZerosFromVoicePrompts(char *str) static void removeUnnecessaryZerosFromVoicePrompts(char *str)
{ {
const int NUM_DECIMAL_PLACES = 1; const int NUM_DECIMAL_PLACES = 1;
@ -52,6 +61,7 @@ static void removeUnnecessaryZerosFromVoicePrompts(char *str)
} }
} }
} }
void announceVFO() void announceVFO()
{ {
vpInit(); vpInit();
@ -181,6 +191,8 @@ VoicePromptQueueFlags_T flags)
// Force on the descriptions for level 3. // Force on the descriptions for level 3.
if (state.settings.vpLevel == vpHigh) if (state.settings.vpLevel == vpHigh)
localFlags |= vpqIncludeDescriptions; localFlags |= vpqIncludeDescriptions;
// ensure we add silence between various fields.
localFlags |= vpqAddSeparatingSilence;
// if VFO mode, announce VFO. // if VFO mode, announce VFO.
// channelIndex will be 0 if called from VFO mode. // channelIndex will be 0 if called from VFO mode.
if (channelIndex == 0) if (channelIndex == 0)
@ -193,7 +205,8 @@ VoicePromptQueueFlags_T flags)
if (channel->mode == OPMODE_FM) if (channel->mode == OPMODE_FM)
{ {
announceBandwidth(channel->bandwidth, localFlags); announceBandwidth(channel->bandwidth, localFlags);
addSilenceIfNeeded(localFlags);
if (channel->fm.rxToneEn || channel->fm.txToneEn) if (channel->fm.rxToneEn || channel->fm.txToneEn)
{ {
announceCTCSS(channel->fm.rxToneEn, channel->fm.rxTone, announceCTCSS(channel->fm.rxToneEn, channel->fm.rxTone,
@ -203,18 +216,22 @@ VoicePromptQueueFlags_T flags)
} }
else if (channel->mode == OPMODE_M17) else if (channel->mode == OPMODE_M17)
{ {
addSilenceIfNeeded(localFlags);
announceM17Info(channel, localFlags); announceM17Info(channel, localFlags);
} }
else if (channel->mode == OPMODE_DMR) else if (channel->mode == OPMODE_DMR)
{ {
addSilenceIfNeeded(localFlags);
announceContactWithIndex(channel->dmr.contact_index, localFlags); announceContactWithIndex(channel->dmr.contact_index, localFlags);
// Force announcement of the words timeslot and colorcode to avoid ambiguity. // Force announcement of the words timeslot and colorcode to avoid ambiguity.
announceTimeslot(channel->dmr.dmr_timeslot, (localFlags | vpqIncludeDescriptions)); announceTimeslot(channel->dmr.dmr_timeslot, (localFlags | vpqIncludeDescriptions));
announceColorCode(channel->dmr.rxColorCode, channel->dmr.txColorCode, (localFlags | vpqIncludeDescriptions)); announceColorCode(channel->dmr.rxColorCode, channel->dmr.txColorCode, (localFlags | vpqIncludeDescriptions));
} }
addSilenceIfNeeded(localFlags);
anouncePower(channel->power, localFlags); anouncePower(channel->power, localFlags);
addSilenceIfNeeded(localFlags);
if (channelIndex > 0) // i.e. not called from VFO. if (channelIndex > 0) // i.e. not called from VFO.
announceBank(bank, localFlags); announceBank(bank, localFlags);
@ -490,7 +507,8 @@ void announceGPSInfo(VoicePromptQueueFlags_T flags)
vpQueueString("3D", vpAnnounceCommonSymbols); vpQueueString("3D", vpAnnounceCommonSymbols);
break; break;
} }
// lat/long addSilenceIfNeeded(flags);
// lat/long
char buffer[16] = "\0"; char buffer[16] = "\0";
vpQueuePrompt(PROMPT_LATITUDE); vpQueuePrompt(PROMPT_LATITUDE);
snprintf(buffer, 16, "%8.6f", state.gps_data.latitude); snprintf(buffer, 16, "%8.6f", state.gps_data.latitude);
@ -503,20 +521,22 @@ void announceGPSInfo(VoicePromptQueueFlags_T flags)
vpQueuePrompt(PROMPT_LONGITUDE); vpQueuePrompt(PROMPT_LONGITUDE);
vpQueueString(buffer, vpAnnounceCommonSymbols); vpQueueString(buffer, vpAnnounceCommonSymbols);
vpQueuePrompt(direction); vpQueuePrompt(direction);
addSilenceIfNeeded(flags);
// speed/altitude: // speed/altitude:
vpQueuePrompt(PROMPT_SPEED); vpQueuePrompt(PROMPT_SPEED);
snprintf(buffer, 16, "%4.1fkm/h", state.gps_data.speed); snprintf(buffer, 16, "%4.1fkm/h", state.gps_data.speed);
vpQueueString(buffer, vpAnnounceCommonSymbols); vpQueueString(buffer, vpAnnounceCommonSymbols);
vpQueuePrompt(PROMPT_ALTITUDE); vpQueuePrompt(PROMPT_ALTITUDE);
snprintf(buffer, 16, "%4.1fm", state.gps_data.altitude); snprintf(buffer, 16, "%4.1fm", state.gps_data.altitude);
vpQueueString(buffer, vpAnnounceCommonSymbols); vpQueueString(buffer, vpAnnounceCommonSymbols);
addSilenceIfNeeded(flags);
vpQueuePrompt(PROMPT_COMPASS); vpQueuePrompt(PROMPT_COMPASS);
snprintf(buffer, 16, "%3.1f", state.gps_data.tmg_true); snprintf(buffer, 16, "%3.1f", state.gps_data.tmg_true);
vpQueueString(buffer, vpAnnounceCommonSymbols); vpQueueString(buffer, vpAnnounceCommonSymbols);
vpQueuePrompt(PROMPT_DEGREES); vpQueuePrompt(PROMPT_DEGREES);
addSilenceIfNeeded(flags);
vpQueuePrompt(PROMPT_SATELLITES); vpQueuePrompt(PROMPT_SATELLITES);
vpQueueInteger(__builtin_popcount(state.gps_data.active_sats)); vpQueueInteger(__builtin_popcount(state.gps_data.active_sats));
@ -541,7 +561,7 @@ options rapidly.
*/ */
VoicePromptQueueFlags_T GetQueueFlagsForVoiceLevel() VoicePromptQueueFlags_T GetQueueFlagsForVoiceLevel()
{ {
VoicePromptQueueFlags_T flags = vpqInit; VoicePromptQueueFlags_T flags = vpqInit | vpqAddSeparatingSilence;
uint8_t vpLevel = state.settings.vpLevel; uint8_t vpLevel = state.settings.vpLevel;
switch (vpLevel) switch (vpLevel)

Wyświetl plik

@ -334,6 +334,9 @@ void vpQueueString(char *promptString, VoicePromptFlags_T flags)
promptString++; promptString++;
} }
if (flags & vpqAddSeparatingSilence)
vpQueuePrompt(PROMPT_SILENCE);
} }
void vpQueueInteger(int32_t value) void vpQueueInteger(int32_t value)