summaryrefslogtreecommitdiffstats
path: root/app/guidance_module.h
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2019-07-24 12:09:40 -0400
committerScott Murray <scott.murray@konsulko.com>2019-07-24 12:09:40 -0400
commit1f875de1d513c733550401ee40fa289fb2acb57e (patch)
tree9e6764cd4de63021285435e956f260b295cdbd7b /app/guidance_module.h
parent33258140525123d6a38900811c2df3e14f4e8337 (diff)
Initial import from github
Import from http://github.com/YoshitoMomiyama/aglqtnavigation.git as of commit a6930c2, with the following minor changes: - .gitignore tweaked to remove itself - .gitreview updated Bug-AGL: SPEC-2667 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I91fed0f6349bf1952e41132058929b70a2b0fe5b
Diffstat (limited to 'app/guidance_module.h')
-rw-r--r--app/guidance_module.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/app/guidance_module.h b/app/guidance_module.h
new file mode 100644
index 0000000..69b3d85
--- /dev/null
+++ b/app/guidance_module.h
@@ -0,0 +1,35 @@
+#ifndef GUIDANCE_MODULE_H
+#define GUIDANCE_MODULE_H
+#include <sys/stat.h>
+#include <QObject>
+#include <QString>
+#include <QDebug>
+
+#define SYS_LANGUAGE_INIT 0
+#define SYS_LANGUAGE_JP 1
+#define SYS_LANGUAGE_EN 2
+#define TTSMAX (2048)
+
+class Guidance_Module : public QObject
+{
+ Q_OBJECT
+public:
+ int g_voicelanguage = SYS_LANGUAGE_INIT;
+ QString g_voice_module = "";
+ Q_INVOKABLE void guidance(const QString &text){
+ char tts_voice[TTSMAX];
+ int len = 0;
+ memset(tts_voice,0,TTSMAX);
+
+ strncat(tts_voice, "sh flite '", (TTSMAX - len - 1));
+
+ len = strlen(tts_voice);
+ strncat(tts_voice, text.toUtf8().data(), (TTSMAX - len - 1));
+
+ len = strlen(tts_voice);
+ strncat(tts_voice, "'&", (TTSMAX - len - 1));
+
+ system(tts_voice);
+ }
+};
+#endif // GUIDANCE_MODULE_H