From a8c1934c9d8d3618b78a2a15788f6d3cf5040ca4 Mon Sep 17 00:00:00 2001 From: Dominik Wenger Date: Fri, 4 Jun 2010 21:22:25 +0000 Subject: rbutil: Make TTS and encoders run on all cores \n FS#11160 by Delyan Kratunov git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26558 a1c6a512-1295-4272-9138-f99709370657 --- rbutil/rbutilqt/base/talkgenerator.h | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'rbutil/rbutilqt/base/talkgenerator.h') diff --git a/rbutil/rbutilqt/base/talkgenerator.h b/rbutil/rbutilqt/base/talkgenerator.h index b139c1879b..cca196bc2e 100644 --- a/rbutil/rbutilqt/base/talkgenerator.h +++ b/rbutil/rbutilqt/base/talkgenerator.h @@ -49,14 +49,29 @@ public: QString target; bool voiced; bool encoded; + + /* We need the following members because + * 1) the QtConcurrent entry points are all static methods (and we + * need to communicate with the TalkGenerator) + * 2) we are not guaranteed to go through the list in any + * particular order, so we can't use the progress slot + * for error checking */ + struct + { + EncBase* encoder; + TTSBase* tts; + TalkGenerator* generator; + int wavtrim; + } refs; }; TalkGenerator(QObject* parent); - Status process(QList* list,int wavtrimth = -1); public slots: void abort(); + void encProgress(int value); + void ttsProgress(int value); signals: void done(bool); @@ -64,13 +79,21 @@ signals: void logProgress(int, int); //! set progress bar. private: + QFutureWatcher encFutureWatcher; + QFutureWatcher ttsFutureWatcher; + void encFailEntry(const TalkEntry& entry); + void ttsFailEntry(const TalkEntry& entry, TTSStatus status, QString error); + Status voiceList(QList* list,int wavetrimth); Status encodeList(QList* list); + static void encEntryPoint(TalkEntry& entry); + static void ttsEntryPoint(TalkEntry& entry); + TTSBase* m_tts; EncBase* m_enc; - bool m_abort; + bool m_ttsWarnings; }; -- cgit v1.2.3