diff options
author | Dominik Wenger <domonoky@googlemail.com> | 2010-06-04 21:22:25 +0000 |
---|---|---|
committer | Dominik Wenger <domonoky@googlemail.com> | 2010-06-04 21:22:25 +0000 |
commit | a8c1934c9d8d3618b78a2a15788f6d3cf5040ca4 (patch) | |
tree | 4d0b742e0cae5230529f9bdb933321f3b9336347 /rbutil/rbutilqt/base/talkgenerator.h | |
parent | 081bda8ab258c763e654067740f365be68269340 (diff) | |
download | rockbox-a8c1934c9d8d3618b78a2a15788f6d3cf5040ca4.tar.gz rockbox-a8c1934c9d8d3618b78a2a15788f6d3cf5040ca4.zip |
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
Diffstat (limited to 'rbutil/rbutilqt/base/talkgenerator.h')
-rw-r--r-- | rbutil/rbutilqt/base/talkgenerator.h | 27 |
1 files changed, 25 insertions, 2 deletions
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: | |||
49 | QString target; | 49 | QString target; |
50 | bool voiced; | 50 | bool voiced; |
51 | bool encoded; | 51 | bool encoded; |
52 | |||
53 | /* We need the following members because | ||
54 | * 1) the QtConcurrent entry points are all static methods (and we | ||
55 | * need to communicate with the TalkGenerator) | ||
56 | * 2) we are not guaranteed to go through the list in any | ||
57 | * particular order, so we can't use the progress slot | ||
58 | * for error checking */ | ||
59 | struct | ||
60 | { | ||
61 | EncBase* encoder; | ||
62 | TTSBase* tts; | ||
63 | TalkGenerator* generator; | ||
64 | int wavtrim; | ||
65 | } refs; | ||
52 | }; | 66 | }; |
53 | 67 | ||
54 | TalkGenerator(QObject* parent); | 68 | TalkGenerator(QObject* parent); |
55 | |||
56 | Status process(QList<TalkEntry>* list,int wavtrimth = -1); | 69 | Status process(QList<TalkEntry>* list,int wavtrimth = -1); |
57 | 70 | ||
58 | public slots: | 71 | public slots: |
59 | void abort(); | 72 | void abort(); |
73 | void encProgress(int value); | ||
74 | void ttsProgress(int value); | ||
60 | 75 | ||
61 | signals: | 76 | signals: |
62 | void done(bool); | 77 | void done(bool); |
@@ -64,13 +79,21 @@ signals: | |||
64 | void logProgress(int, int); //! set progress bar. | 79 | void logProgress(int, int); //! set progress bar. |
65 | 80 | ||
66 | private: | 81 | private: |
82 | QFutureWatcher<void> encFutureWatcher; | ||
83 | QFutureWatcher<void> ttsFutureWatcher; | ||
84 | void encFailEntry(const TalkEntry& entry); | ||
85 | void ttsFailEntry(const TalkEntry& entry, TTSStatus status, QString error); | ||
86 | |||
67 | Status voiceList(QList<TalkEntry>* list,int wavetrimth); | 87 | Status voiceList(QList<TalkEntry>* list,int wavetrimth); |
68 | Status encodeList(QList<TalkEntry>* list); | 88 | Status encodeList(QList<TalkEntry>* list); |
69 | 89 | ||
90 | static void encEntryPoint(TalkEntry& entry); | ||
91 | static void ttsEntryPoint(TalkEntry& entry); | ||
92 | |||
70 | TTSBase* m_tts; | 93 | TTSBase* m_tts; |
71 | EncBase* m_enc; | 94 | EncBase* m_enc; |
72 | 95 | ||
73 | bool m_abort; | 96 | bool m_ttsWarnings; |
74 | }; | 97 | }; |
75 | 98 | ||
76 | 99 | ||