Replaygain pre-amp can be set in 0.5 dB steps.
[kugel-rb.git] / rbutil / rbutilqt / base / ttsbase.cpp
blobd68c1816abedb553aa37fd4248a8a91c9c6c1656
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
9 * Copyright (C) 2007 by Dominik Wenger
10 * $Id$
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 ****************************************************************************/
20 #include "ttsbase.h"
22 #include "ttsfestival.h"
23 #include "ttssapi.h"
24 #include "ttsexes.h"
25 #if defined(Q_OS_MACX)
26 #include "ttscarbon.h"
27 #endif
29 // list of tts names and identifiers
30 QMap<QString,QString> TTSBase::ttsList;
32 TTSBase::TTSBase(QObject* parent): EncTtsSettingInterface(parent)
37 // static functions
38 void TTSBase::initTTSList()
40 ttsList["espeak"] = "Espeak TTS Engine";
41 ttsList["flite"] = "Flite TTS Engine";
42 ttsList["swift"] = "Swift TTS Engine";
43 #if defined(Q_OS_WIN)
44 ttsList["sapi"] = "Sapi TTS Engine";
45 #endif
46 #if defined(Q_OS_LINUX)
47 ttsList["festival"] = "Festival TTS Engine";
48 #endif
49 #if defined(Q_OS_MACX)
50 ttsList["carbon"] = "OS X System Engine";
51 #endif
54 // function to get a specific encoder
55 TTSBase* TTSBase::getTTS(QObject* parent,QString ttsName)
58 TTSBase* tts;
59 #if defined(Q_OS_WIN)
60 if(ttsName == "sapi")
62 tts = new TTSSapi(parent);
63 return tts;
65 else
66 #endif
67 #if defined(Q_OS_LINUX)
68 if (ttsName == "festival")
70 tts = new TTSFestival(parent);
71 return tts;
73 else
74 #endif
75 #if defined(Q_OS_MACX)
76 if(ttsName == "carbon")
78 tts = new TTSCarbon(parent);
79 return tts;
81 else
82 #endif
83 if (true) // fix for OS other than WIN or LINUX
85 tts = new TTSExes(ttsName,parent);
86 return tts;
90 // get the list of encoders, nice names
91 QStringList TTSBase::getTTSList()
93 // init list if its empty
94 if(ttsList.count() == 0)
95 initTTSList();
97 return ttsList.keys();
100 // get nice name of a specific tts
101 QString TTSBase::getTTSName(QString tts)
103 if(ttsList.isEmpty())
104 initTTSList();
105 return ttsList.value(tts);