aboutsummaryrefslogtreecommitdiffstats
path: root/homescreen/src/chromecontroller.h
blob: 27c26cb7d357720a1fe6f2114dd9dc84c9333802 (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
#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;
};