summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/ttssapi.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-01-11 20:18:26 +0100
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-01-14 12:14:49 +0100
commit42fa2a8d0f6891f2d64eeb4de1920655f784e79a (patch)
tree45ca0d5b5f162aa705b5376347171dcc59f08a41 /rbutil/rbutilqt/base/ttssapi.cpp
parentb17bdb93493eec82fa60f5e0f008aa292aed6f10 (diff)
downloadrockbox-42fa2a8d0f6891f2d64eeb4de1920655f784e79a.tar.gz
rockbox-42fa2a8d0f6891f2d64eeb4de1920655f784e79a.tar.bz2
rockbox-42fa2a8d0f6891f2d64eeb4de1920655f784e79a.zip
Improve error handling and logging.
- Fix a warning - Log an error if the file to encode cannot be read. - Adjust some log strings.
Diffstat (limited to 'rbutil/rbutilqt/base/ttssapi.cpp')
-rw-r--r--rbutil/rbutilqt/base/ttssapi.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/rbutil/rbutilqt/base/ttssapi.cpp b/rbutil/rbutilqt/base/ttssapi.cpp
index 4c18ceff2a..b5e6a69624 100644
--- a/rbutil/rbutilqt/base/ttssapi.cpp
+++ b/rbutil/rbutilqt/base/ttssapi.cpp
@@ -103,7 +103,7 @@ bool TTSSapi::start(QString *errStr)
QFileInfo tts(m_TTSexec);
if(!tts.exists())
{
- *errStr = tr("Could not copy the Sapi-script");
+ *errStr = tr("Could not copy the SAPI script");
return false;
}
// create the voice process
@@ -117,14 +117,15 @@ bool TTSSapi::start(QString *errStr)
if(m_sapi4)
execstring.append(" /sapi4 ");
- qDebug() << "init" << execstring;
+ qDebug() << "[TTSSapi] Start:" << execstring;
voicescript = new QProcess(NULL);
//connect(voicescript,SIGNAL(readyReadStandardError()),this,SLOT(error()));
-
voicescript->start(execstring);
+ qDebug() << "[TTSSapi] wait for process";
if(!voicescript->waitForStarted())
{
- *errStr = tr("Could not start the Sapi-script");
+ *errStr = tr("Could not start SAPI process");
+ qDebug() << "[TTSSapi] starting process timed out!";
return false;
}
@@ -181,12 +182,14 @@ QStringList TTSSapi::getVoiceList(QString language)
if(RbSettings::value(RbSettings::TtsUseSapi4).toBool())
execstring.append(" /sapi4 ");
- qDebug() << "init" << execstring;
+ qDebug() << "[TTSSapi] Start:" << execstring;
voicescript = new QProcess(NULL);
voicescript->start(execstring);
- qDebug() << "wait for started";
- if(!voicescript->waitForStarted())
+ qDebug() << "[TTSSapi] wait for process";
+ if(!voicescript->waitForStarted()) {
+ qDebug() << "[TTSSapi] process startup timed out!";
return result;
+ }
voicescript->closeWriteChannel();
voicescript->waitForReadyRead();