summaryrefslogtreecommitdiff
path: root/rbutil/rbutilqt/tts.h
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2008-02-12 21:45:50 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2008-02-12 21:45:50 +0000
commit8820c0114b4ae30dc5ec8df90b0b1f10b720126e (patch)
tree63710c771c4278b85d95459b165417bd3f1196e7 /rbutil/rbutilqt/tts.h
parent341188d68d266c1522c278ed425ffea6b4015a2e (diff)
Make TTS name conversion functions static members.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16294 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/tts.h')
-rw-r--r--rbutil/rbutilqt/tts.h126
1 files changed, 62 insertions, 64 deletions
diff --git a/rbutil/rbutilqt/tts.h b/rbutil/rbutilqt/tts.h
index a5427fe05f..251b9b4c6a 100644
--- a/rbutil/rbutilqt/tts.h
+++ b/rbutil/rbutilqt/tts.h
@@ -31,86 +31,84 @@
#include "ttsguicli.h"
#endif
-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();
-QString getTTSName(QString tts);
-
class TTSBase : public QObject
{
Q_OBJECT
-public:
- TTSBase();
- virtual bool voice(QString text,QString wavfile) {(void)text; (void)wavfile; return false;}
- virtual bool start(QString *errStr){(void)errStr; return false;}
- virtual bool stop(){return false;}
- virtual void showCfg(){}
- virtual bool configOk(){return false;}
-
- void setCfg(RbSettings* sett){settings = sett;}
-
-public slots:
- virtual void accept(void){}
- virtual void reject(void){}
- virtual void reset(void){}
+ public:
+ TTSBase();
+ virtual bool voice(QString text,QString wavfile)
+ { (void)text; (void)wavfile; return false; }
+ virtual bool start(QString *errStr) { (void)errStr; return false; }
+ virtual bool stop() { return false; }
+ virtual void showCfg(){}
+ virtual bool configOk() { return false; }
-protected:
- RbSettings* settings;
+ void setCfg(RbSettings* sett) { settings = sett; }
+
+ static TTSBase* getTTS(QString ttsname);
+ static QStringList getTTSList();
+ static QString getTTSName(QString tts);
+
+ public slots:
+ virtual void accept(void){}
+ virtual void reject(void){}
+ virtual void reset(void){}
+
+ private:
+ //inits the tts List
+ static void initTTSList();
+
+ protected:
+ RbSettings* settings;
+ static QMap<QString,QString> ttsList;
+ static QMap<QString,TTSBase*> ttsCache;
};
class TTSSapi : public TTSBase
{
Q_OBJECT
-public:
- TTSSapi();
- virtual bool voice(QString text,QString wavfile);
- virtual bool start(QString *errStr);
- virtual bool stop();
- virtual void showCfg();
- virtual bool configOk();
-
- QStringList getVoiceList(QString language);
-private:
-
- QProcess* voicescript;
-
- QString defaultLanguage;
+ public:
+ TTSSapi();
+ virtual bool voice(QString text,QString wavfile);
+ virtual bool start(QString *errStr);
+ virtual bool stop();
+ virtual void showCfg();
+ virtual bool configOk();
- QString m_TTSexec;
- QString m_TTSOpts;
- QString m_TTSTemplate;
- QString m_TTSLanguage;
- QString m_TTSVoice;
- QString m_TTSSpeed;
- bool m_sapi4;
+ QStringList getVoiceList(QString language);
+ private:
+ QProcess* voicescript;
+
+ QString defaultLanguage;
+
+ QString m_TTSexec;
+ QString m_TTSOpts;
+ QString m_TTSTemplate;
+ QString m_TTSLanguage;
+ QString m_TTSVoice;
+ QString m_TTSSpeed;
+ bool m_sapi4;
};
+
class TTSExes : public TTSBase
{
- Q_OBJECT
-public:
- TTSExes(QString name);
- virtual bool voice(QString text,QString wavfile);
- virtual bool start(QString *errStr);
- virtual bool stop() {return true;}
- virtual void showCfg();
- virtual bool configOk();
-
-
-
-private:
+ Q_OBJECT
+ public:
+ TTSExes(QString name);
+ virtual bool voice(QString text,QString wavfile);
+ virtual bool start(QString *errStr);
+ virtual bool stop() {return true;}
+ virtual void showCfg();
+ virtual bool configOk();
- QString m_name;
- QString m_TTSexec;
- QString m_TTSOpts;
- QString m_TTSTemplate;
- QMap<QString,QString> m_TemplateMap;
+ private:
+ QString m_name;
+ QString m_TTSexec;
+ QString m_TTSOpts;
+ QString m_TTSTemplate;
+ QMap<QString,QString> m_TemplateMap;
};
#endif