1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 * Copyright (C) 2007 by Dominik Wenger
11 * All files in this archive are subject to the GNU General Public License.
12 * See the file COPYING in the source tree root for full license agreement.
14 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
15 * KIND, either express or implied.
17 ****************************************************************************/
21 #include "ttsfestival.h"
25 #if defined(Q_OS_MACX)
26 #include "ttscarbon.h"
29 // list of tts names and identifiers
30 QMap
<QString
,QString
> TTSBase::ttsList
;
32 TTSBase::TTSBase(QObject
* parent
): EncTtsSettingInterface(parent
)
38 void TTSBase::initTTSList()
40 #if !defined(Q_OS_WIN)
41 ttsList
["espeak"] = tr("Espeak TTS Engine");
43 ttsList
["flite"] = tr("Flite TTS Engine");
44 ttsList
["swift"] = tr("Swift TTS Engine");
46 #if 0 /* SAPI4 has been disabled since long. Keep support for now. */
47 ttsList
["sapi4"] = tr("SAPI4 TTS Engine");
49 ttsList
["sapi"] = tr("SAPI5 TTS Engine");
51 #if defined(Q_OS_LINUX)
52 ttsList
["festival"] = tr("Festival TTS Engine");
54 #if defined(Q_OS_MACX)
55 ttsList
["carbon"] = tr("OS X System Engine");
59 // function to get a specific encoder
60 TTSBase
* TTSBase::getTTS(QObject
* parent
,QString ttsName
)
66 tts
= new TTSSapi(parent
);
67 else if (ttsName
== "sapi4")
68 tts
= new TTSSapi4(parent
);
70 #elif defined(Q_OS_LINUX)
71 if (ttsName
== "festival")
72 tts
= new TTSFestival(parent
);
74 #elif defined(Q_OS_MACX)
75 if(ttsName
== "carbon")
76 tts
= new TTSCarbon(parent
);
79 // fix for OS other than WIN or LINUX
81 tts
= new TTSExes(ttsName
, parent
);
85 // get the list of encoders, nice names
86 QStringList
TTSBase::getTTSList()
88 // init list if its empty
89 if(ttsList
.count() == 0)
92 return ttsList
.keys();
95 // get nice name of a specific tts
96 QString
TTSBase::getTTSName(QString tts
)
100 return ttsList
.value(tts
);