From f3de2f5cad06a772ee55f58694d559a7cb012c02 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, Change-Id: I2052e345baaf4306e8e3f27a01bc6940f4d27d88 Signed-off-by: Naveen Bobbili Signed-off-by: Jan-Simon Moeller Signed-off-by: Scott Murray --- homescreen/src/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'homescreen/src/main.cpp') diff --git a/homescreen/src/main.cpp b/homescreen/src/main.cpp index 5f283fb..5c819f9 100644 --- a/homescreen/src/main.cpp +++ b/homescreen/src/main.cpp @@ -32,6 +32,7 @@ #include "mastervolume.h" #include "homescreenhandler.h" #include "hmi-debug.h" +#include "chromecontroller.h" // XXX: We want this DBus connection to be shared across the different // QML objects, is there another way to do this, a nice way, perhaps? @@ -91,6 +92,8 @@ int main(int argc, char *argv[]) // qmlRegisterType("HomeScreen", 1, 0, "ApplicationLauncher"); qmlRegisterType("HomeScreen", 1, 0, "StatusBarModel"); qmlRegisterType("MasterVolume", 1, 0, "MasterVolume"); + qmlRegisterUncreatableType("SpeechChrome", 1, 0, "SpeechChromeController", + QLatin1String("SpeechChromeController is uncreatable.")); ApplicationLauncher *launcher = new ApplicationLauncher(); QLibWindowmanager* layoutHandler = new QLibWindowmanager(); @@ -140,6 +143,7 @@ int main(int argc, char *argv[]) engine.rootContext()->setContextProperty("launcher", launcher); engine.rootContext()->setContextProperty("weather", new Weather(bindingAddress)); engine.rootContext()->setContextProperty("bluetooth", new Bluetooth(bindingAddress, engine.rootContext())); + engine.rootContext()->setContextProperty("speechChromeController", new ChromeController(bindingAddress, &engine)); engine.rootContext()->setContextProperty("screenInfo", &screenInfo); engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); -- cgit 1.2.3-korg