summaryrefslogtreecommitdiff
path: root/utils/rbutilqt/base/ttsfestival.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/rbutilqt/base/ttsfestival.h')
-rw-r--r--utils/rbutilqt/base/ttsfestival.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/utils/rbutilqt/base/ttsfestival.h b/utils/rbutilqt/base/ttsfestival.h
new file mode 100644
index 0000000000..5f6dc13ab5
--- /dev/null
+++ b/utils/rbutilqt/base/ttsfestival.h
@@ -0,0 +1,72 @@
1/***************************************************************************
2* __________ __ ___.
3* Open \______ \ ____ ____ | | _\_ |__ _______ ___
4* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7* \/ \/ \/ \/ \/
8*
9* Copyright (C) 2009 by Dominik Wenger
10*
11* This program is free software; you can redistribute it and/or
12* modify it under the terms of the GNU General Public License
13* as published by the Free Software Foundation; either version 2
14* of the License, or (at your option) any later version.
15*
16* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17* KIND, either express or implied.
18*
19****************************************************************************/
20
21#ifndef TTSFESTIVAL_H
22#define TTSFESTIVAL_H
23
24#include <QTemporaryFile>
25#include "ttsbase.h"
26
27class TTSFestival : public TTSBase
28{
29 enum ESettings
30 {
31 eSERVERPATH,
32 eCLIENTPATH,
33 eVOICE,
34 eVOICEDESC
35 };
36
37 Q_OBJECT
38 public:
39 TTSFestival(QObject* parent=nullptr) : TTSBase(parent) {}
40 ~TTSFestival();
41 bool start(QString *errStr);
42 bool stop();
43 TTSStatus voice(QString text,QString wavfile, QString *errStr);
44 QString voiceVendor(void) { return QString(); }
45 Capabilities capabilities();
46
47 // for settings
48 bool configOk();
49 void generateSettings();
50 void saveSettings();
51
52 private slots:
53 void updateVoiceList();
54 void updateVoiceDescription();
55 void clearVoiceDescription();
56 private:
57 QTemporaryFile prologFile;
58 QString prologPath;
59 QString currentPath;
60 QStringList getVoiceList();
61 QString getVoiceInfo(QString voice);
62
63 inline void startServer();
64 inline bool ensureServerRunning();
65 QString queryServer(QString query, int timeout = -1);
66 QProcess serverProcess;
67 QStringList voices;
68 QMap<QString, QString> voiceDescriptions;
69};
70
71
72#endif