summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/tts.h
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2007-12-15 13:13:57 +0000
committerDominik Wenger <domonoky@googlemail.com>2007-12-15 13:13:57 +0000
commitbebddd42c265bf63845f42bb29f48de5ed263f69 (patch)
treeb5dbb6e711d4d71034c4ee19ddfa7e0af043971b /rbutil/rbutilqt/tts.h
parent1e489e53b8d0807fc52423ae7453d4b1d047d370 (diff)
rbutil: reworked configuration of TTS engines to the new Style.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15932 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/tts.h')
-rw-r--r--rbutil/rbutilqt/tts.h116
1 files changed, 116 insertions, 0 deletions
diff --git a/rbutil/rbutilqt/tts.h b/rbutil/rbutilqt/tts.h
new file mode 100644
index 0000000000..83fcda35ac
--- /dev/null
+++ b/rbutil/rbutilqt/tts.h
@@ -0,0 +1,116 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ *
+ * Copyright (C) 2007 by Dominik Wenger
+ * $Id: tts.h 15212 2007-10-19 21:49:07Z domonoky $
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+
+#ifndef TTS_H
+#define TTS_H
+
+#include "ui_ttsexescfgfrm.h"
+#include "ui_sapicfgfrm.h"
+#include <QtGui>
+
+
+class TTSBase;
+
+//inits the tts List
+void initTTSList();
+// function to get a specific tts
+TTSBase* getTTS(QString ttsname);
+// get the list of tts, nice names
+QStringList getTTSList();
+
+
+class TTSBase : public QDialog
+{
+ Q_OBJECT
+public:
+ TTSBase(QWidget *parent );
+ virtual bool voice(QString text,QString wavfile) {return false;}
+ virtual bool start(){return false;}
+ virtual bool stop(){return false;}
+ virtual void showCfg(){}
+ virtual bool configOk(){return false;}
+
+ void setUserCfg(QSettings *uSettings){userSettings = uSettings;}
+
+public slots:
+ virtual void accept(void){}
+ virtual void reject(void){}
+ virtual void reset(void){}
+
+protected:
+ QSettings *userSettings;
+};
+
+class TTSSapi : public TTSBase
+{
+ Q_OBJECT
+public:
+ TTSSapi(QWidget *parent = NULL);
+ virtual bool voice(QString text,QString wavfile);
+ virtual bool start();
+ virtual bool stop();
+ virtual void showCfg();
+ virtual bool configOk();
+
+public slots:
+ virtual void accept(void);
+ virtual void reject(void);
+ virtual void reset(void);
+ void browse(void);
+
+private:
+ Ui::SapiCfgFrm ui;
+ QProcess* voicescript;
+
+ QString defaultLanguage;
+
+ QString m_TTSexec;
+ QString m_TTSOpts;
+ QString m_TTSTemplate;
+ QString m_TTSLanguage;
+};
+
+class TTSExes : public TTSBase
+{
+ Q_OBJECT
+public:
+ TTSExes(QString name,QWidget *parent = NULL);
+ virtual bool voice(QString text,QString wavfile);
+ virtual bool start();
+ virtual bool stop() {return true;}
+ virtual void showCfg();
+ virtual bool configOk();
+
+public slots:
+ virtual void accept(void);
+ virtual void reject(void);
+ virtual void reset(void);
+ void browse(void);
+
+private:
+ Ui::TTSExesCfgFrm ui;
+ QString m_name;
+ QString m_TTSexec;
+ QString m_TTSOpts;
+ QString m_TTSTemplate;
+ QMap<QString,QString> m_TemplateMap;
+};
+
+#endif