From 0349f05f5885987952a2d8de03983b36722b264e Mon Sep 17 00:00:00 2001 From: Naveen Bobbili Date: Sun, 28 Apr 2019 20:51:16 -0700 Subject: Add push to talk support to homescreen Reworked version of Alexa specific changes from ICS to add push to talk button for voice services to homescreen media area. v2: change config.xml to audiomixer v3: reworked to not be Alexa specific: - Now use the default voiceagent if available, instead of hard-coding Alexa usage - The Alexa logo for the button has been replaced with a generic microphone icon derived from the radio application's launcher icon. This is a placeholder until a new icon is provided by LF graphics team. Meeting any Amazon requirements around Alexa chrome is now envisioned as being provided for with a TBD voiceagent API enhancement. - The QML for the PTT button has been moved to MediaAreaBlank.qml, which seems a more logical location for it ATM. It is likely that the MediaArea QML should be simplified in a future change, as it currently contains a signficant amount of unused code. - The PTT button has been moved to the left hand side of the media area, as this seems more sensible if demonstrating driver usage. - The delay on fade-out of the master volume slider has been lowered to 3 seconds from 5, with the PTT button present it started seeming excessive during testing. - Some extra debug messages have been added to make tracking the voiceagent state more straightforward. Bug-AGL: SPEC-2764, Signed-off-by: Naveen Bobbili Signed-off-by: Jan-Simon Moeller Signed-off-by: Scott Murray Change-Id: I398bf7aebc5c9b459b1fce94511eee3698c08347 --- homescreen/src/constants.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 homescreen/src/constants.h (limited to 'homescreen/src/constants.h') diff --git a/homescreen/src/constants.h b/homescreen/src/constants.h new file mode 100644 index 0000000..a43bf6d --- /dev/null +++ b/homescreen/src/constants.h @@ -0,0 +1,42 @@ +#ifndef CONSTANTS_H +#define CONSTANTS_H + +#include +#include +#include + +namespace vshl { +const QString API = QLatin1String("vshl-core"); +const QString VOICE_AGENT_ENUMERATION_VERB = QLatin1String("enumerateVoiceAgents"); +const QString SUBSCRIBE_VERB = QLatin1String("subscribe"); +const QString TAP_TO_TALK_VERB = QLatin1String("startListening"); + +const QString ALEXA_AGENT_NAME = QLatin1String("Alexa"); + +const QString DATA_TAG = QLatin1String("data"); +const QString RESPONSE_TAG = QLatin1String("response"); +const QString AGENTS_TAG = QLatin1String("agents"); +const QString DEFAULT_TAG = QLatin1String("default"); +const QString NAME_TAG = QLatin1String("name"); +const QString ID_TAG = QLatin1String("id"); +const QString STATE_TAG = QLatin1String("state"); + +const QString VOICE_AGENT_ID_ARG = QLatin1String("va_id"); +const QString VOICE_AGENT_EVENTS_ARG = QLatin1String("events"); +const QString VOICE_AGENT_ACTIONS_ARG = QLatin1String("actions"); + +const QJsonArray VOICE_AGENT_EVENTS_ARRAY = { + QLatin1String("voice_authstate_event"), + QLatin1String("voice_dialogstate_event"), + QLatin1String("voice_connectionstate_event") +}; + +const QString VOICE_DIALOG_STATE_EVENT = QLatin1String("vshl-core/voice_dialogstate_event#"); +const QString VOICE_DIALOG_IDLE = QLatin1String("IDLE"); +const QString VOICE_DIALOG_LISTENING = QLatin1String("LISTENING"); +const QString VOICE_DIALOG_THINKING = QLatin1String("THINKING"); +const QString VOICE_DIALOG_SPEAKING = QLatin1String("SPEAKING"); +const QString VOICE_DIALOG_MICROPHONEOFF = QLatin1String("MICROPHONEOFF"); +} + +#endif // CONSTANTS_H -- cgit 1.2.3-korg