aboutsummaryrefslogtreecommitdiffstats
path: root/homescreen/src/chromecontroller.h
diff options
context:
space:
mode:
Diffstat (limited to 'homescreen/src/chromecontroller.h')
-rw-r--r--homescreen/src/chromecontroller.h38
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;
+};