aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>2019-06-14 14:24:31 +0900
committerzheng_wenlong <wenlong_zheng@nexty-ele.com>2019-06-14 14:24:31 +0900
commitc38d55fc0b43215f63c873e7578554f5942e69b3 (patch)
tree976b6db61a9347a98862617d81cc3849e6521fc1
parente3767af1a9d44abe2ea88ba85ff004cbdaefc21c (diff)
add vui display
-rw-r--r--homescreen/qml/main.qml9
-rw-r--r--homescreen/src/homescreenvoice.cpp14
-rw-r--r--homescreen/src/homescreenvoice.h1
3 files changed, 18 insertions, 6 deletions
diff --git a/homescreen/qml/main.qml b/homescreen/qml/main.qml
index de833a9..a0ff4f4 100644
--- a/homescreen/qml/main.qml
+++ b/homescreen/qml/main.qml
@@ -243,6 +243,15 @@ Window {
}
}
+ Connections {
+ target: homescreenVoice
+ onShowInformation: {
+ bottomText.text = info
+ bottomInformation.visible = true
+ informationTimer.restart()
+ }
+ }
+
Timer {
id:notificationTimer
interval: 3000
diff --git a/homescreen/src/homescreenvoice.cpp b/homescreen/src/homescreenvoice.cpp
index 4a376e1..f56625e 100644
--- a/homescreen/src/homescreenvoice.cpp
+++ b/homescreen/src/homescreenvoice.cpp
@@ -206,17 +206,19 @@ void HomescreenVoice::on_event(void *closure, const char *event, struct afb_wsj1
return;
}
- const char* corestatus = json_object_get_string(json_state);
+ const char* info = json_object_get_string(json_state);
- if (strcasecmp(corestatus, HomescreenVoice::state_lists[0].c_str()) == 0) {
+ if (strcasecmp(info, HomescreenVoice::state_lists[0].c_str()) == 0) {
emit statusChanged(true);
}
- else if ((strcasecmp(corestatus, HomescreenVoice::state_lists[1].c_str()) == 0)||
- (strcasecmp(corestatus, HomescreenVoice::state_lists[2].c_str()) == 0)||
- (strcasecmp(corestatus, HomescreenVoice::state_lists[3].c_str()) == 0)||
- (strcasecmp(corestatus, HomescreenVoice::state_lists[4].c_str()) == 0)){
+ else if ((strcasecmp(info, HomescreenVoice::state_lists[1].c_str()) == 0)||
+ (strcasecmp(info, HomescreenVoice::state_lists[2].c_str()) == 0)||
+ (strcasecmp(info, HomescreenVoice::state_lists[3].c_str()) == 0)||
+ (strcasecmp(info, HomescreenVoice::state_lists[4].c_str()) == 0)){
emit statusChanged(false);
}
+
+ emit showInformation(QString(QLatin1String(info)));
}
/**
diff --git a/homescreen/src/homescreenvoice.h b/homescreen/src/homescreenvoice.h
index 6a4f7e5..011280c 100644
--- a/homescreen/src/homescreenvoice.h
+++ b/homescreen/src/homescreenvoice.h
@@ -47,6 +47,7 @@ public:
Q_INVOKABLE int startListening(void);
signals:
void statusChanged(bool status);
+ void showInformation(QString info);
private:
int initialize_websocket(void);