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 ****************************************************************************/
24 #include "progressloggerinterface.h"
26 class TTSBase
: public QObject
32 virtual bool voice(QString text
,QString wavfile
){(void)text
; (void)wavfile
; return false;}
33 virtual bool start(){return false;}
34 virtual bool stop(){return false;}
36 void setTTSexe(QString exe
){m_TTSexec
=exe
;}
37 void setTTsOpts(QString opts
) {m_TTSOpts
=opts
;}
38 void setTTsLanguage(QString language
) {m_TTSLanguage
= language
;}
39 void setTTsTemplate(QString t
) { m_TTSTemplate
= t
; }
44 QString m_TTSTemplate
;
45 QString m_TTSLanguage
;
49 class TalkFileCreator
:public QObject
54 TalkFileCreator(QObject
* parent
=0);
56 bool createTalkFiles(ProgressloggerInterface
* logger
);
58 void setTTSexe(QString exe
){m_TTSexec
=exe
;}
59 void setEncexe(QString exe
){m_EncExec
=exe
;}
61 void setTTsType(QString tts
) { m_curTTS
= tts
; }
62 void setTTsOpts(QString opts
) {m_TTSOpts
=opts
;}
63 void setTTsLanguage(QString language
) {m_TTSLanguage
= language
;}
64 void setTTsTemplate(QString t
) { m_curTTSTemplate
= t
; }
66 void setEncType(QString enc
) { m_curEnc
= enc
; }
67 void setEncOpts(QString opts
) {m_EncOpts
=opts
;}
68 void setEncTemplate(QString t
) { m_curEncTemplate
= t
; }
70 void setDir(QDir dir
){m_dir
= dir
; }
71 void setMountPoint(QString mountpoint
) {m_mountpoint
=mountpoint
; }
73 void setOverwriteTalk(bool ov
) {m_overwriteTalk
= ov
;}
74 void setOverwriteWav(bool ov
) {m_overwriteWav
= ov
;}
75 void setRemoveWav(bool ov
) {m_removeWav
= ov
;}
76 void setRecursive(bool ov
) {m_recursive
= ov
;}
77 void setStripExtensions(bool ov
) {m_stripExtensions
= ov
;}
78 void setTalkFolders(bool ov
) {m_talkFolders
= ov
;}
79 void setTalkFiles(bool ov
) {m_talkFiles
= ov
;}
88 bool encode(QString input
,QString output
);
95 QString m_TTSLanguage
;
96 QString m_curTTSTemplate
;
101 QString m_curEncTemplate
;
103 bool m_overwriteTalk
;
107 bool m_stripExtensions
;
111 ProgressloggerInterface
* m_logger
;
116 class TTSSapi
: public TTSBase
120 virtual bool voice(QString text
,QString wavfile
);
121 virtual bool start();
125 QProcess
* voicescript
;
128 class TTSExes
: public TTSBase
132 virtual bool voice(QString text
,QString wavfile
);
133 virtual bool start();
134 virtual bool stop() {return true;}