diff options
author | Naveen Bobbili <nbobbili@amazon.com> | 2019-04-28 20:51:16 -0700 |
---|---|---|
committer | Jan-Simon Möller <jsmoeller@linuxfoundation.org> | 2019-06-24 14:14:42 +0200 |
commit | 9f02e451dd2f91c217d73c8029bb939b3a211672 (patch) | |
tree | d79eb0f93e835746169b3a96454cf8da70c0c037 /homescreen/src/chromecontroller.h | |
parent | 2509e623a5f95a612a715818f15daddf2ca77f12 (diff) |
Code commit by ICS team to add Alexa Voice Chrome to Homescreen App.sandbox/jsmoeller/speechdemo
Change-Id: I2052e345baaf4306e8e3f27a01bc6940f4d27d88
Signed-off-by: Naveen Bobbili <nbobbili@amazon.com>
Diffstat (limited to 'homescreen/src/chromecontroller.h')
-rw-r--r-- | homescreen/src/chromecontroller.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/homescreen/src/chromecontroller.h b/homescreen/src/chromecontroller.h new file mode 100644 index 0000000..27c26cb --- /dev/null +++ b/homescreen/src/chromecontroller.h @@ -0,0 +1,38 @@ +#pragma once + +#include <QObject> +#include <QUrl> + +class AglSocketWrapper; +class ChromeController : public QObject +{ + Q_OBJECT + + Q_PROPERTY(int chromeState READ chromeState NOTIFY chromeStateChanged) + +public: + enum ChromeState { + Idle = 0, + Listening, + Thinking, + Speaking, + MicrophoneOff + }; + Q_ENUM(ChromeState) + + explicit ChromeController(const QUrl &bindingUrl, QObject *parent = nullptr); + int chromeState() const { return m_chromeState; } + +public slots: + void pushToTalk(); + +signals: + void chromeStateChanged(); + +private: + void setChromeState(ChromeState state); + + AglSocketWrapper *m_aglSocket; + QString m_voiceAgentId; + ChromeState m_chromeState = Idle; +}; |