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"
24 #if defined(Q_OS_MACX)
25 #include "ttscarbon.h"
28 // list of tts names and identifiers
29 QMap
<QString
,QString
> TTSBase::ttsList
;
31 TTSBase::TTSBase(QObject
* parent
): EncTtsSettingInterface(parent
)
37 void TTSBase::initTTSList()
39 #if !defined(Q_OS_WIN)
40 ttsList
["espeak"] = tr("Espeak TTS Engine");
42 ttsList
["flite"] = tr("Flite TTS Engine");
43 ttsList
["swift"] = tr("Swift TTS Engine");
45 ttsList
["sapi"] = tr("SAPI TTS Engine");
47 #if defined(Q_OS_LINUX)
48 ttsList
["festival"] = tr("Festival TTS Engine");
50 #if defined(Q_OS_MACX)
51 ttsList
["carbon"] = tr("OS X System Engine");
55 // function to get a specific encoder
56 TTSBase
* TTSBase::getTTS(QObject
* parent
,QString ttsName
)
63 tts
= new TTSSapi(parent
);
68 #if defined(Q_OS_LINUX)
69 if (ttsName
== "festival")
71 tts
= new TTSFestival(parent
);
76 #if defined(Q_OS_MACX)
77 if(ttsName
== "carbon")
79 tts
= new TTSCarbon(parent
);
84 if (true) // fix for OS other than WIN or LINUX
86 tts
= new TTSExes(ttsName
,parent
);
91 // get the list of encoders, nice names
92 QStringList
TTSBase::getTTSList()
94 // init list if its empty
95 if(ttsList
.count() == 0)
98 return ttsList
.keys();
101 // get nice name of a specific tts
102 QString
TTSBase::getTTSName(QString tts
)
104 if(ttsList
.isEmpty())
106 return ttsList
.value(tts
);