blob: 047ddd91c3a6f9fe9f923c98ed922b4ae593ae42 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#pragma once
#include <QObject>
#include <QUrl>
class AglSocketWrapper;
class ChromeController : public QObject
{
Q_OBJECT
Q_PROPERTY(bool agentPresent READ agentPresent NOTIFY agentPresentChanged)
Q_PROPERTY(QString agentName READ agentName NOTIFY agentNameChanged)
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);
bool agentPresent() const { return m_agentPresent; }
int chromeState() const { return m_chromeState; }
QString agentName() const { return m_voiceAgentName; }
public slots:
void pushToTalk();
signals:
void agentPresentChanged();
void agentNameChanged();
void chromeStateChanged();
private:
void setChromeState(ChromeState state);
AglSocketWrapper *m_aglSocket;
QString m_voiceAgentId = "";
QString m_voiceAgentName = "";
bool m_agentPresent = false;
ChromeState m_chromeState = Idle;
};
|