code police.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14504 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Dominik Riebeling 2007-08-29 09:27:35 +00:00
parent 9226ffd351
commit 177716c2f9
2 changed files with 29 additions and 29 deletions

View file

@ -21,7 +21,7 @@
TalkFileCreator::TalkFileCreator(QObject* parent): QObject(parent) TalkFileCreator::TalkFileCreator(QObject* parent): QObject(parent)
{ {
} }
@ -54,7 +54,7 @@ bool TalkFileCreator::initTTS()
bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger) bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
{ {
m_abort = false; m_abort = false;
m_logger = logger; m_logger = logger;
m_logger->addItem("Starting Talkfile generation",LOGINFO); m_logger->addItem("Starting Talkfile generation",LOGINFO);
if(!initTTS()) if(!initTTS())
@ -77,21 +77,21 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
// iterate over all entrys // iterate over all entrys
while (it.hasNext()) while (it.hasNext())
{ {
if(m_abort) if(m_abort)
{ {
m_logger->addItem("Talkfile creation aborted",LOGERROR); m_logger->addItem("Talkfile creation aborted",LOGERROR);
return false; return false;
} }
QApplication::processEvents(); QApplication::processEvents();
QFileInfo fileInf = it.fileInfo(); QFileInfo fileInf = it.fileInfo();
QString toSpeak; QString toSpeak;
QString filename; QString filename;
QString wavfilename; QString wavfilename;
if(fileInf.fileName() == "." || fileInf.fileName() == ".." || fileInf.suffix() == "talk") if(fileInf.fileName() == "." || fileInf.fileName() == ".." || fileInf.suffix() == "talk")
{ {
it.next(); it.next();
continue; continue;
} }
if(fileInf.isDir()) // if it is a dir if(fileInf.isDir()) // if it is a dir
@ -158,35 +158,35 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
void TalkFileCreator::abort() void TalkFileCreator::abort()
{ {
m_abort = true; m_abort = true;
} }
bool TalkFileCreator::voice(QString text,QString wavfile) bool TalkFileCreator::voice(QString text,QString wavfile)
{ {
QString execstring = m_curTTSTemplate; QString execstring = m_curTTSTemplate;
execstring.replace("%exe",m_TTSexec); execstring.replace("%exe",m_TTSexec);
execstring.replace("%options",m_TTSOpts); execstring.replace("%options",m_TTSOpts);
execstring.replace("%wavfile",wavfile); execstring.replace("%wavfile",wavfile);
execstring.replace("%text",text); execstring.replace("%text",text);
QProcess::execute(execstring); QProcess::execute(execstring);
return true; return true;
} }
bool TalkFileCreator::encode(QString input,QString output) bool TalkFileCreator::encode(QString input,QString output)
{ {
QString execstring = m_curEncTemplate; QString execstring = m_curEncTemplate;
execstring.replace("%exe",m_EncExec); execstring.replace("%exe",m_EncExec);
execstring.replace("%options",m_EncOpts); execstring.replace("%options",m_EncOpts);
execstring.replace("%input",input); execstring.replace("%input",input);
execstring.replace("%output",output); execstring.replace("%output",output);
QProcess::execute(execstring); QProcess::execute(execstring);
return true; return true;
} }

View file

@ -53,7 +53,7 @@ public:
void setStripExtensions(bool ov) {m_stripExtensions = ov;} void setStripExtensions(bool ov) {m_stripExtensions = ov;}
private slots: private slots:
void abort(); void abort();
private: private: