Implement rebuffering for seeking outside of buffered data boudaries
[Rockbox.git] / rbutil / rbutilqt / talkfile.h
blob54819c80f800eb2c569e177c3bb9b3bac7c986bf
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 ****************************************************************************/
21 #ifndef TALKFILE_H
22 #define TALKFILE_H
24 #include "progressloggerinterface.h"
26 class TTSBase : public QObject
28 Q_OBJECT
29 public:
30 TTSBase(){}
31 virtual ~TTSBase(){}
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; }
41 protected:
42 QString m_TTSexec;
43 QString m_TTSOpts;
44 QString m_TTSTemplate;
45 QString m_TTSLanguage;
49 class TalkFileCreator :public QObject
51 Q_OBJECT
53 public:
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;}
81 private slots:
82 void abort();
84 private:
85 TTSBase* m_tts;
86 bool initEncoder();
88 bool encode(QString input,QString output);
90 QDir m_dir;
91 QString m_mountpoint;
92 QString m_curTTS;
93 QString m_TTSexec;
94 QString m_TTSOpts;
95 QString m_TTSLanguage;
96 QString m_curTTSTemplate;
98 QString m_curEnc;
99 QString m_EncExec;
100 QString m_EncOpts;
101 QString m_curEncTemplate;
103 bool m_overwriteTalk;
104 bool m_overwriteWav;
105 bool m_removeWav;
106 bool m_recursive;
107 bool m_stripExtensions;
108 bool m_talkFolders;
109 bool m_talkFiles;
111 ProgressloggerInterface* m_logger;
113 bool m_abort;
116 class TTSSapi : public TTSBase
118 public:
119 TTSSapi() {};
120 virtual bool voice(QString text,QString wavfile);
121 virtual bool start();
122 virtual bool stop();
124 private:
125 QProcess* voicescript;
128 class TTSExes : public TTSBase
130 public:
131 TTSExes() {};
132 virtual bool voice(QString text,QString wavfile);
133 virtual bool start();
134 virtual bool stop() {return true;}
136 private:
140 #endif