Add prompts for brightness and squelch
Added support for announcing macros for adjusting brightness and squelch. Added voiceprompt for squelch.
This commit is contained in:
parent
e74eccfffd
commit
537a20eef5
|
|
@ -58,4 +58,7 @@ character by character.
|
||||||
void announceText( char* text, VoicePromptQueueFlags_T flags);
|
void announceText( char* text, VoicePromptQueueFlags_T flags);
|
||||||
void announceCTCSS(bool rxToneEnabled, uint8_t rxTone, bool txToneEnabled, uint8_t txTone, VoicePromptQueueFlags_T flags);
|
void announceCTCSS(bool rxToneEnabled, uint8_t rxTone, bool txToneEnabled, uint8_t txTone, VoicePromptQueueFlags_T flags);
|
||||||
void anouncePower(float power, VoicePromptQueueFlags_T flags);
|
void anouncePower(float power, VoicePromptQueueFlags_T flags);
|
||||||
|
void announceBrightness(uint8_t brightness, VoicePromptQueueFlags_T flags);
|
||||||
|
void announceSquelch(uint8_t squelch, VoicePromptQueueFlags_T flags);
|
||||||
|
|
||||||
#endif //VOICE_PROMPT_UTILS_H_INCLUDED
|
#endif //VOICE_PROMPT_UTILS_H_INCLUDED
|
||||||
|
|
@ -115,6 +115,7 @@ PROMPT_TRANSMIT, // Transmit
|
||||||
PROMPT_MODE, // Mode
|
PROMPT_MODE, // Mode
|
||||||
PROMPT_BANDWIDTH, // bandwidth
|
PROMPT_BANDWIDTH, // bandwidth
|
||||||
PROMPT_POWER, // power
|
PROMPT_POWER, // power
|
||||||
|
PROMPT_SQUELCH, // squelch
|
||||||
PROMPT_SOURCE_ID, // Source ID
|
PROMPT_SOURCE_ID, // Source ID
|
||||||
PROMPT_DEST_ID, // Destination ID
|
PROMPT_DEST_ID, // Destination ID
|
||||||
PROMPT_DMR_ID, // DMR ID
|
PROMPT_DMR_ID, // DMR ID
|
||||||
|
|
@ -156,7 +157,13 @@ NUM_VOICE_PROMPTS,
|
||||||
// PROMPT_VOICE_NAME is always the very last prompt after the indexed prompts
|
// PROMPT_VOICE_NAME is always the very last prompt after the indexed prompts
|
||||||
// from the strings table.
|
// from the strings table.
|
||||||
#define PROMPT_VOICE_NAME (NUM_VOICE_PROMPTS + (sizeof(stringsTable_t)/sizeof(char*)))
|
#define PROMPT_VOICE_NAME (NUM_VOICE_PROMPTS + (sizeof(stringsTable_t)/sizeof(char*)))
|
||||||
|
/*
|
||||||
|
These flags govern how vpQueueString operates.
|
||||||
|
For example, when editing, it is desireable to hear spaces, capitals and
|
||||||
|
extended symbols.
|
||||||
|
When just arrowing through menus, spaces, extended symbols etc should not be
|
||||||
|
announced.
|
||||||
|
*/
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
vpAnnounceCaps=0x01,
|
vpAnnounceCaps=0x01,
|
||||||
|
|
@ -167,7 +174,14 @@ typedef enum
|
||||||
vpAnnounceASCIIValueForUnknownChars=0x20,
|
vpAnnounceASCIIValueForUnknownChars=0x20,
|
||||||
vpAnnouncePhoneticRendering=0x40,
|
vpAnnouncePhoneticRendering=0x40,
|
||||||
} VoicePromptFlags_T;
|
} VoicePromptFlags_T;
|
||||||
|
/*
|
||||||
|
These queuing flags determine if speech is interrupted, played immediately, whether prompts are queued for values, etc.
|
||||||
|
They are necessary because for example if you call the announceXX functions
|
||||||
|
consecutively, it is only desireable to initially stop speech in progress
|
||||||
|
and only play after the last prompt is queued.
|
||||||
|
If however calling an announceXX function in isolation, normally any prompt in
|
||||||
|
progress should be interrupted and play should be called immediately.
|
||||||
|
*/
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
vpqDefault = 0,
|
vpqDefault = 0,
|
||||||
|
|
@ -175,7 +189,12 @@ typedef enum
|
||||||
vpqPlayImmediately=0x02, // call play after queue.
|
vpqPlayImmediately=0x02, // call play after queue.
|
||||||
vpqIncludeDescriptions=0x04
|
vpqIncludeDescriptions=0x04
|
||||||
} VoicePromptQueueFlags_T;
|
} VoicePromptQueueFlags_T;
|
||||||
|
/*
|
||||||
|
These values correspond to prompts in the wordlistXX.csv file in the
|
||||||
|
voicePromptGenerator subproject.
|
||||||
|
They must not be reordered.
|
||||||
|
They correspond to prompts for which there are no string table entries.
|
||||||
|
*/
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
vpNone=0,
|
vpNone=0,
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ void anouncePower(float power, VoicePromptQueueFlags_T flags)
|
||||||
vpPlayIfNeeded(flags);
|
vpPlayIfNeeded(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void vpAnnounceChannelSummary(channel_t* channel, uint16_t channelIndex,
|
void announceChannelSummary(channel_t* channel, uint16_t channelIndex,
|
||||||
VoicePromptQueueFlags_T flags)
|
VoicePromptQueueFlags_T flags)
|
||||||
{
|
{
|
||||||
if (!channel) return;
|
if (!channel) return;
|
||||||
|
|
@ -302,3 +302,27 @@ void announceCTCSS(bool rxToneEnabled, uint8_t rxTone, bool txToneEnabled, uint8
|
||||||
|
|
||||||
vpPlayIfNeeded(flags);
|
vpPlayIfNeeded(flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void announceBrightness(uint8_t brightness, VoicePromptQueueFlags_T flags)
|
||||||
|
{
|
||||||
|
vpInitIfNeeded(flags);
|
||||||
|
|
||||||
|
if (flags & vpqIncludeDescriptions)
|
||||||
|
vpQueueStringTableEntry(¤tLanguage->brightness);
|
||||||
|
|
||||||
|
vpQueueInteger(brightness);
|
||||||
|
|
||||||
|
vpPlayIfNeeded(flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
void announceSquelch(uint8_t squelch, VoicePromptQueueFlags_T flags)
|
||||||
|
{
|
||||||
|
vpInitIfNeeded(flags);
|
||||||
|
|
||||||
|
if (flags & vpqIncludeDescriptions)
|
||||||
|
vpQueuePrompt(PROMPT_SQUELCH);
|
||||||
|
|
||||||
|
vpQueueInteger(squelch);
|
||||||
|
|
||||||
|
vpPlayIfNeeded(flags);
|
||||||
|
}
|
||||||
|
|
@ -845,9 +845,11 @@ void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx)
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
_ui_changeBrightness(-5);
|
_ui_changeBrightness(-5);
|
||||||
|
announceBrightness(state.settings.brightness, queueFlags);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
_ui_changeBrightness(+5);
|
_ui_changeBrightness(+5);
|
||||||
|
announceBrightness(state.settings.brightness, queueFlags);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -855,6 +857,7 @@ void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx)
|
||||||
if(msg.keys & KNOB_LEFT || msg.keys & KNOB_RIGHT) {
|
if(msg.keys & KNOB_LEFT || msg.keys & KNOB_RIGHT) {
|
||||||
state.settings.sqlLevel = platform_getChSelector() - 1;
|
state.settings.sqlLevel = platform_getChSelector() - 1;
|
||||||
*sync_rtx = true;
|
*sync_rtx = true;
|
||||||
|
announceSquelch(state.settings.sqlLevel, queueFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(msg.keys & KEY_LEFT || msg.keys & KEY_DOWN)
|
if(msg.keys & KEY_LEFT || msg.keys & KEY_DOWN)
|
||||||
|
|
@ -867,6 +870,7 @@ void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx)
|
||||||
{
|
{
|
||||||
state.settings.sqlLevel -= 1;
|
state.settings.sqlLevel -= 1;
|
||||||
*sync_rtx = true;
|
*sync_rtx = true;
|
||||||
|
announceSquelch(state.settings.sqlLevel, queueFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -880,6 +884,7 @@ void _ui_fsm_menuMacro(kbd_msg_t msg, bool *sync_rtx)
|
||||||
{
|
{
|
||||||
state.settings.sqlLevel += 1;
|
state.settings.sqlLevel += 1;
|
||||||
*sync_rtx = true;
|
*sync_rtx = true;
|
||||||
|
announceSquelch(state.settings.sqlLevel, queueFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue