1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 * Copyright (C) 2007 by Dominik Wenger
10 * $Id: tts.h 15212 2007-10-19 21:49:07Z domonoky $
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 ****************************************************************************/
25 #include "rbsettings.h"
31 #include "ttsguicli.h"
35 class TTSBase
: public QObject
40 virtual bool voice(QString text
,QString wavfile
)
41 { (void)text
; (void)wavfile
; return false; }
42 virtual bool start(QString
*errStr
) { (void)errStr
; return false; }
43 virtual bool stop() { return false; }
44 virtual void showCfg(){}
45 virtual bool configOk() { return false; }
47 void setCfg(RbSettings
* sett
) { settings
= sett
; }
49 static TTSBase
* getTTS(QString ttsname
);
50 static QStringList
getTTSList();
51 static QString
getTTSName(QString tts
);
54 virtual void accept(void){}
55 virtual void reject(void){}
56 virtual void reset(void){}
60 static void initTTSList();
64 static QMap
<QString
,QString
> ttsList
;
65 static QMap
<QString
,TTSBase
*> ttsCache
;
68 class TTSSapi
: public TTSBase
73 virtual bool voice(QString text
,QString wavfile
);
74 virtual bool start(QString
*errStr
);
76 virtual void showCfg();
77 virtual bool configOk();
79 QStringList
getVoiceList(QString language
);
81 QProcess
* voicescript
;
83 QString defaultLanguage
;
87 QString m_TTSTemplate
;
88 QString m_TTSLanguage
;
95 class TTSExes
: public TTSBase
99 TTSExes(QString name
);
100 virtual bool voice(QString text
,QString wavfile
);
101 virtual bool start(QString
*errStr
);
102 virtual bool stop() {return true;}
103 virtual void showCfg();
104 virtual bool configOk();
110 QString m_TTSTemplate
;
111 QMap
<QString
,QString
> m_TemplateMap
;