summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/ttsbase.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-10-06 13:44:39 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-10-06 13:53:09 +0200
commit2c3b8bd1e2887b8c5c825fa42cced6f8490493b5 (patch)
tree151bbca70fac0f0e90b99f436a60a422f0903091 /rbutil/rbutilqt/base/ttsbase.cpp
parent7f76bb48b352984c4de8f40509618763e39f181f (diff)
downloadrockbox-2c3b8bd1e2887b8c5c825fa42cced6f8490493b5.tar.gz
rockbox-2c3b8bd1e2887b8c5c825fa42cced6f8490493b5.tar.bz2
rockbox-2c3b8bd1e2887b8c5c825fa42cced6f8490493b5.zip
Factor out executable based TTS engines to separate subclasses.
Similar as done with SAPI / MSSP make the current implementation for executable based TTS engines a base class and create derived classes for each supported TTS. Removes the need for the implementation to know about the individual TTS engines. Add support for speaking directly (i.e. without going through a temporary wave file, currently only used by espeak). Change-Id: I59bbbd6ee4c2c009b2a8d8e0ab4a9b39ea723d6e
Diffstat (limited to 'rbutil/rbutilqt/base/ttsbase.cpp')
-rw-r--r--rbutil/rbutilqt/base/ttsbase.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/rbutil/rbutilqt/base/ttsbase.cpp b/rbutil/rbutilqt/base/ttsbase.cpp
index ae2a78f606..3b8384f534 100644
--- a/rbutil/rbutilqt/base/ttsbase.cpp
+++ b/rbutil/rbutilqt/base/ttsbase.cpp
@@ -16,6 +16,7 @@
*
****************************************************************************/
+#include <QtCore>
#include "ttsbase.h"
#include "ttsfestival.h"
@@ -23,6 +24,9 @@
#include "ttssapi4.h"
#include "ttsmssp.h"
#include "ttsexes.h"
+#include "ttsespeak.h"
+#include "ttsflite.h"
+#include "ttsswift.h"
#if defined(Q_OS_MACX)
#include "ttscarbon.h"
#endif
@@ -32,7 +36,6 @@ QMap<QString,QString> TTSBase::ttsList;
TTSBase::TTSBase(QObject* parent): EncTtsSettingInterface(parent)
{
-
}
// static functions
@@ -80,9 +83,15 @@ TTSBase* TTSBase::getTTS(QObject* parent,QString ttsName)
tts = new TTSCarbon(parent);
else
#endif
- // fix for OS other than WIN or LINUX
- if (true)
- tts = new TTSExes(ttsName, parent);
+ if(ttsName == "espeak")
+ tts = new TTSEspeak(parent);
+ else if(ttsName == "flite")
+ tts = new TTSFlite(parent);
+ else if(ttsName == "swift")
+ tts = new TTSSwift(parent);
+ else if(ttsName == "user")
+ tts = new TTSExes(parent);
+
return tts;
}