mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-10 13:45:10 -05:00
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
This commit is contained in:
parent
983409383f
commit
611f2bc77a
4 changed files with 74 additions and 18 deletions
|
|
@ -78,39 +78,77 @@
|
||||||
<string>Generation options</string>
|
<string>Generation options</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" >
|
||||||
<item row="0" column="0" >
|
<item row="2" column="0" >
|
||||||
<widget class="QCheckBox" name="OverwriteWav" >
|
<widget class="QCheckBox" name="OverwriteWav" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Overwrite Wavefiles</string>
|
<string>Overwrite Wavefiles</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="checked" >
|
||||||
</item>
|
<bool>true</bool>
|
||||||
<item row="1" column="0" >
|
|
||||||
<widget class="QCheckBox" name="RemoveWav" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Remove Wavefiles</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0" >
|
|
||||||
<widget class="QCheckBox" name="recursive" >
|
|
||||||
<property name="text" >
|
|
||||||
<string>Run recursive</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" >
|
<item row="3" column="0" >
|
||||||
<widget class="QCheckBox" name="StripExtensions" >
|
<widget class="QCheckBox" name="RemoveWav" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Strip Extensions</string>
|
<string>Remove Wavefiles</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked" >
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0" >
|
<item row="4" column="0" >
|
||||||
|
<widget class="QCheckBox" name="recursive" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Run recursive</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked" >
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0" >
|
||||||
|
<widget class="QCheckBox" name="StripExtensions" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Strip Extensions</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked" >
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0" >
|
||||||
<widget class="QCheckBox" name="OverwriteTalk" >
|
<widget class="QCheckBox" name="OverwriteTalk" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Overwrite Talkfiles</string>
|
<string>Overwrite Talkfiles</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="checked" >
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" >
|
||||||
|
<widget class="QCheckBox" name="talkFolders" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Generate .talk files for Folders</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked" >
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0" >
|
||||||
|
<widget class="QCheckBox" name="talkFiles" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Generate .talk files for Files</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked" >
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="tristate" >
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
||||||
|
|
@ -131,6 +131,8 @@ void InstallTalkWindow::accept()
|
||||||
talkcreator->setRemoveWav(ui.RemoveWav->isChecked());
|
talkcreator->setRemoveWav(ui.RemoveWav->isChecked());
|
||||||
talkcreator->setRecursive(ui.recursive->isChecked());
|
talkcreator->setRecursive(ui.recursive->isChecked());
|
||||||
talkcreator->setStripExtensions(ui.StripExtensions->isChecked());
|
talkcreator->setStripExtensions(ui.StripExtensions->isChecked());
|
||||||
|
talkcreator->setTalkFolders(ui.talkFolders->isChecked());
|
||||||
|
talkcreator->setTalkFiles(ui.talkFiles->isChecked());
|
||||||
|
|
||||||
talkcreator->createTalkFiles(logger);
|
talkcreator->createTalkFiles(logger);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,11 +96,23 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
|
||||||
}
|
}
|
||||||
if(fileInf.isDir()) // if it is a dir
|
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();
|
toSpeak = fileInf.fileName();
|
||||||
filename = fileInf.absolutePath() + "/_dirname.talk";
|
filename = fileInf.absolutePath() + "/_dirname.talk";
|
||||||
}
|
}
|
||||||
else // if it is a file
|
else // if it is a file
|
||||||
{
|
{
|
||||||
|
// skip entry if file talking isnt enabled
|
||||||
|
if(m_talkFiles == false)
|
||||||
|
{
|
||||||
|
it.next();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if(m_stripExtensions)
|
if(m_stripExtensions)
|
||||||
toSpeak = fileInf.baseName();
|
toSpeak = fileInf.baseName();
|
||||||
else
|
else
|
||||||
|
|
@ -181,7 +193,7 @@ bool TalkFileCreator::encode(QString input,QString output)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TTSSapi::start()
|
bool TTSSapi::start()
|
||||||
{
|
{
|
||||||
QFileInfo tts(m_TTSexec);
|
QFileInfo tts(m_TTSexec);
|
||||||
if(!tts.exists())
|
if(!tts.exists())
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -244,4 +256,4 @@ bool TTSExes::voice(QString text,QString wavfile)
|
||||||
QProcess::execute(execstring);
|
QProcess::execute(execstring);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,8 @@ public:
|
||||||
void setRemoveWav(bool ov) {m_removeWav = ov;}
|
void setRemoveWav(bool ov) {m_removeWav = ov;}
|
||||||
void setRecursive(bool ov) {m_recursive = ov;}
|
void setRecursive(bool ov) {m_recursive = ov;}
|
||||||
void setStripExtensions(bool ov) {m_stripExtensions = ov;}
|
void setStripExtensions(bool ov) {m_stripExtensions = ov;}
|
||||||
|
void setTalkFolders(bool ov) {m_talkFolders = ov;}
|
||||||
|
void setTalkFiles(bool ov) {m_talkFiles = ov;}
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void abort();
|
void abort();
|
||||||
|
|
@ -106,6 +108,8 @@ private:
|
||||||
bool m_removeWav;
|
bool m_removeWav;
|
||||||
bool m_recursive;
|
bool m_recursive;
|
||||||
bool m_stripExtensions;
|
bool m_stripExtensions;
|
||||||
|
bool m_talkFolders;
|
||||||
|
bool m_talkFiles;
|
||||||
|
|
||||||
ProgressloggerInterface* m_logger;
|
ProgressloggerInterface* m_logger;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue