From 611f2bc77abfbe268caa7c5239256b0570401335 Mon Sep 17 00:00:00 2001 From: Dominik Wenger Date: Fri, 12 Oct 2007 15:52:04 +0000 Subject: [PATCH] rbutil: add options to create .talk files only for Folders or only for Files or for Both. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15087 a1c6a512-1295-4272-9138-f99709370657 --- rbutil/rbutilqt/installtalkfrm.ui | 70 +++++++++++++++++++++------ rbutil/rbutilqt/installtalkwindow.cpp | 2 + rbutil/rbutilqt/talkfile.cpp | 16 +++++- rbutil/rbutilqt/talkfile.h | 4 ++ 4 files changed, 74 insertions(+), 18 deletions(-) diff --git a/rbutil/rbutilqt/installtalkfrm.ui b/rbutil/rbutilqt/installtalkfrm.ui index ddb5e877cc..d38784c130 100644 --- a/rbutil/rbutilqt/installtalkfrm.ui +++ b/rbutil/rbutilqt/installtalkfrm.ui @@ -78,39 +78,77 @@ Generation options - + Overwrite Wavefiles - - - - - - Remove Wavefiles - - - - - - - Run recursive + + true - + - Strip Extensions + Remove Wavefiles + + + true + + + Run recursive + + + true + + + + + + + Strip Extensions + + + false + + + + Overwrite Talkfiles + + true + + + + + + + Generate .talk files for Folders + + + true + + + + + + + Generate .talk files for Files + + + true + + + false + diff --git a/rbutil/rbutilqt/installtalkwindow.cpp b/rbutil/rbutilqt/installtalkwindow.cpp index 4c341fa793..fbe2a2749b 100644 --- a/rbutil/rbutilqt/installtalkwindow.cpp +++ b/rbutil/rbutilqt/installtalkwindow.cpp @@ -131,6 +131,8 @@ void InstallTalkWindow::accept() talkcreator->setRemoveWav(ui.RemoveWav->isChecked()); talkcreator->setRecursive(ui.recursive->isChecked()); talkcreator->setStripExtensions(ui.StripExtensions->isChecked()); + talkcreator->setTalkFolders(ui.talkFolders->isChecked()); + talkcreator->setTalkFiles(ui.talkFiles->isChecked()); talkcreator->createTalkFiles(logger); } diff --git a/rbutil/rbutilqt/talkfile.cpp b/rbutil/rbutilqt/talkfile.cpp index 5b484079f9..3b99b2c52c 100644 --- a/rbutil/rbutilqt/talkfile.cpp +++ b/rbutil/rbutilqt/talkfile.cpp @@ -96,11 +96,23 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger) } if(fileInf.isDir()) // if it is a dir { + // skip entry if folder talking isnt enabled + if(m_talkFolders == false) + { + it.next(); + continue; + } toSpeak = fileInf.fileName(); filename = fileInf.absolutePath() + "/_dirname.talk"; } else // if it is a file { + // skip entry if file talking isnt enabled + if(m_talkFiles == false) + { + it.next(); + continue; + } if(m_stripExtensions) toSpeak = fileInf.baseName(); else @@ -181,7 +193,7 @@ bool TalkFileCreator::encode(QString input,QString output) } bool TTSSapi::start() -{ +{ QFileInfo tts(m_TTSexec); if(!tts.exists()) return false; @@ -244,4 +256,4 @@ bool TTSExes::voice(QString text,QString wavfile) QProcess::execute(execstring); return true; -} \ No newline at end of file +} diff --git a/rbutil/rbutilqt/talkfile.h b/rbutil/rbutilqt/talkfile.h index b02060a708..1b8d9ca2e2 100644 --- a/rbutil/rbutilqt/talkfile.h +++ b/rbutil/rbutilqt/talkfile.h @@ -75,6 +75,8 @@ public: void setRemoveWav(bool ov) {m_removeWav = ov;} void setRecursive(bool ov) {m_recursive = ov;} void setStripExtensions(bool ov) {m_stripExtensions = ov;} + void setTalkFolders(bool ov) {m_talkFolders = ov;} + void setTalkFiles(bool ov) {m_talkFiles = ov;} private slots: void abort(); @@ -106,6 +108,8 @@ private: bool m_removeWav; bool m_recursive; bool m_stripExtensions; + bool m_talkFolders; + bool m_talkFiles; ProgressloggerInterface* m_logger;