1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 * Copyright (C) 2007 by Dominik Wenger
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
22 #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 ttsList
["espeak"] = "Espeak TTS Engine";
41 ttsList
["flite"] = "Flite TTS Engine";
42 ttsList
["swift"] = "Swift TTS Engine";
44 ttsList
["sapi"] = "Sapi TTS Engine";
46 #if defined(Q_OS_LINUX)
47 ttsList
["festival"] = "Festival TTS Engine";
49 #if defined(Q_OS_MACX)
50 ttsList
["carbon"] = "OS X System Engine";
54 // function to get a specific encoder
55 TTSBase
* TTSBase::getTTS(QObject
* parent
,QString ttsName
)
62 tts
= new TTSSapi(parent
);
67 #if defined(Q_OS_LINUX)
68 if (ttsName
== "festival")
70 tts
= new TTSFestival(parent
);
75 #if defined(Q_OS_MACX)
76 if(ttsName
== "carbon")
78 tts
= new TTSCarbon(parent
);
83 if (true) // fix for OS other than WIN or LINUX
85 tts
= new TTSExes(ttsName
,parent
);
90 // get the list of encoders, nice names
91 QStringList
TTSBase::getTTSList()
93 // init list if its empty
94 if(ttsList
.count() == 0)
97 return ttsList
.keys();
100 // get nice name of a specific tts
101 QString
TTSBase::getTTSName(QString tts
)
103 if(ttsList
.isEmpty())
105 return ttsList
.value(tts
);