1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
9 * Copyright (C) 2007 by Dominik Wenger
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
27 #include "rbsettings.h"
33 #include "ttsguicli.h"
37 class TTSBase
: public QObject
42 virtual bool voice(QString text
,QString wavfile
)
43 { (void)text
; (void)wavfile
; return false; }
44 virtual bool start(QString
*errStr
) { (void)errStr
; return false; }
45 virtual bool stop() { return false; }
46 virtual void showCfg(){}
47 virtual bool configOk() { return false; }
49 virtual void setCfg(RbSettings
* sett
) { settings
= sett
; }
51 static TTSBase
* getTTS(QString ttsname
);
52 static QStringList
getTTSList();
53 static QString
getTTSName(QString tts
);
56 virtual void accept(void){}
57 virtual void reject(void){}
58 virtual void reset(void){}
62 static void initTTSList();
66 static QMap
<QString
,QString
> ttsList
;
67 static QMap
<QString
,TTSBase
*> ttsCache
;
70 class TTSSapi
: public TTSBase
75 virtual bool voice(QString text
,QString wavfile
);
76 virtual bool start(QString
*errStr
);
78 virtual void showCfg();
79 virtual bool configOk();
81 QStringList
getVoiceList(QString language
);
83 QProcess
* voicescript
;
85 QString defaultLanguage
;
89 QString m_TTSTemplate
;
90 QString m_TTSLanguage
;
97 class TTSExes
: public TTSBase
101 TTSExes(QString name
);
102 virtual bool voice(QString text
,QString wavfile
);
103 virtual bool start(QString
*errStr
);
104 virtual bool stop() {return true;}
105 virtual void showCfg();
106 virtual bool configOk();
108 virtual void setCfg(RbSettings
* sett
);
114 QString m_TTSTemplate
;
115 QMap
<QString
,QString
> m_TemplateMap
;