summaryrefslogtreecommitdiffstats
path: root/rbutil
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2008-05-27 20:02:25 +0000
committerDominik Wenger <domonoky@googlemail.com>2008-05-27 20:02:25 +0000
commitae4b677736032176459f7adbb65c5386cfc089fb (patch)
tree91d7998b2118eb0368ba383f9507709cfff385c9 /rbutil
parent819a39a22eb33fda4f3605258f3ca1416590b405 (diff)
downloadrockbox-ae4b677736032176459f7adbb65c5386cfc089fb.tar.gz
rockbox-ae4b677736032176459f7adbb65c5386cfc089fb.tar.bz2
rockbox-ae4b677736032176459f7adbb65c5386cfc089fb.zip
rbutil: improve talkfile generation. remove the options to keep and overwrite the wavfiles.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17637 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/rbutilqt/encoders.cpp2
-rw-r--r--rbutil/rbutilqt/installtalkfrm.ui58
-rw-r--r--rbutil/rbutilqt/installtalkwindow.cpp8
-rw-r--r--rbutil/rbutilqt/rbutilqt.cpp2
-rw-r--r--rbutil/rbutilqt/talkfile.cpp32
5 files changed, 47 insertions, 55 deletions
diff --git a/rbutil/rbutilqt/encoders.cpp b/rbutil/rbutilqt/encoders.cpp
index f9ce05479a..6532a0c65b 100644
--- a/rbutil/rbutilqt/encoders.cpp
+++ b/rbutil/rbutilqt/encoders.cpp
@@ -182,7 +182,7 @@ bool EncRbSpeex::start()
bool EncRbSpeex::encode(QString input,QString output)
{
- //qDebug() << "encoding
+ qDebug() << "encoding " << input << " to "<< output;
char errstr[512];
FILE *fin,*fout;
diff --git a/rbutil/rbutilqt/installtalkfrm.ui b/rbutil/rbutilqt/installtalkfrm.ui
index 5a899f8c74..9e183e15a9 100644
--- a/rbutil/rbutilqt/installtalkfrm.ui
+++ b/rbutil/rbutilqt/installtalkfrm.ui
@@ -15,7 +15,7 @@
<property name="windowTitle" >
<string>Install Talk Files</string>
</property>
- <layout class="QGridLayout" >
+ <layout class="QGridLayout" name="gridLayout_2" >
<item rowspan="6" row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
@@ -45,7 +45,8 @@
<string>&amp;Browse</string>
</property>
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/system-search.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/system-search.png</normaloff>:/icons/system-search.png</iconset>
</property>
</widget>
</item>
@@ -87,7 +88,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@@ -103,28 +104,8 @@
<property name="title" >
<string>Generation options</string>
</property>
- <layout class="QGridLayout" >
- <item row="2" column="0" >
- <widget class="QCheckBox" name="OverwriteWav" >
- <property name="text" >
- <string>Overwrite Wavefiles</string>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="3" column="0" >
- <widget class="QCheckBox" name="RemoveWav" >
- <property name="text" >
- <string>Remove Wavefiles</string>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="4" column="0" >
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="2" column="0" colspan="2" >
<widget class="QCheckBox" name="recursive" >
<property name="text" >
<string>Run recursive</string>
@@ -134,7 +115,7 @@
</property>
</widget>
</item>
- <item row="5" column="0" >
+ <item row="3" column="0" colspan="2" >
<widget class="QCheckBox" name="StripExtensions" >
<property name="text" >
<string>Strip Extensions</string>
@@ -144,7 +125,7 @@
</property>
</widget>
</item>
- <item row="6" column="0" >
+ <item row="4" column="0" colspan="2" >
<widget class="QCheckBox" name="OverwriteTalk" >
<property name="text" >
<string>Overwrite Talkfiles</string>
@@ -154,7 +135,7 @@
</property>
</widget>
</item>
- <item row="1" column="0" >
+ <item row="1" column="0" colspan="2" >
<widget class="QCheckBox" name="talkFolders" >
<property name="text" >
<string>Generate .talk files for Folders</string>
@@ -164,7 +145,7 @@
</property>
</widget>
</item>
- <item row="0" column="0" >
+ <item row="0" column="0" colspan="2" >
<widget class="QCheckBox" name="talkFiles" >
<property name="text" >
<string>Generate .talk files for Files</string>
@@ -178,6 +159,13 @@
</widget>
</item>
</layout>
+ <zorder>recursive</zorder>
+ <zorder>StripExtensions</zorder>
+ <zorder>OverwriteTalk</zorder>
+ <zorder>talkFolders</zorder>
+ <zorder>talkFiles</zorder>
+ <zorder>label_3</zorder>
+ <zorder>fileFilter</zorder>
</widget>
</item>
<item row="4" column="2" >
@@ -185,7 +173,7 @@
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
@@ -198,7 +186,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0" >
<size>
<width>40</width>
<height>20</height>
@@ -214,7 +202,8 @@
<string>&amp;Install</string>
</property>
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/go-next.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/go-next.png</normaloff>:/icons/go-next.png</iconset>
</property>
</widget>
</item>
@@ -224,7 +213,8 @@
<string>&amp;Cancel</string>
</property>
<property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/process-stop.png</iconset>
+ <iconset resource="rbutilqt.qrc" >
+ <normaloff>:/icons/process-stop.png</normaloff>:/icons/process-stop.png</iconset>
</property>
</widget>
</item>
@@ -238,8 +228,6 @@
<tabstop>change</tabstop>
<tabstop>talkFiles</tabstop>
<tabstop>talkFolders</tabstop>
- <tabstop>OverwriteWav</tabstop>
- <tabstop>RemoveWav</tabstop>
<tabstop>recursive</tabstop>
<tabstop>StripExtensions</tabstop>
<tabstop>OverwriteTalk</tabstop>
diff --git a/rbutil/rbutilqt/installtalkwindow.cpp b/rbutil/rbutilqt/installtalkwindow.cpp
index 1246d53876..16b3b83f21 100644
--- a/rbutil/rbutilqt/installtalkwindow.cpp
+++ b/rbutil/rbutilqt/installtalkwindow.cpp
@@ -31,8 +31,6 @@ InstallTalkWindow::InstallTalkWindow(QWidget *parent) : QDialog(parent)
connect(ui.buttonBrowse, SIGNAL(clicked()), this, SLOT(browseFolder()));
connect(ui.change,SIGNAL(clicked()),this,SLOT(change()));
- ui.OverwriteWav->setChecked(true);
- ui.RemoveWav->setChecked(true);
ui.recursive->setChecked(true);
ui.OverwriteTalk->setChecked(true);
ui.StripExtensions->setChecked(true);
@@ -99,13 +97,13 @@ void InstallTalkWindow::accept()
talkcreator->setMountPoint(settings->mountpoint());
talkcreator->setOverwriteTalk(ui.OverwriteTalk->isChecked());
- talkcreator->setOverwriteWav(ui.OverwriteWav->isChecked());
- talkcreator->setRemoveWav(ui.RemoveWav->isChecked());
+ talkcreator->setOverwriteWav(true);
+ talkcreator->setRemoveWav(true);
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/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp
index 510feb4743..c1523cb92e 100644
--- a/rbutil/rbutilqt/rbutilqt.cpp
+++ b/rbutil/rbutilqt/rbutilqt.cpp
@@ -172,7 +172,7 @@ void RbUtilQt::downloadDone(bool error)
QMessageBox::critical(this, tr("Configuration error"),
tr("Your configuration is invalid. This is most likely due "
"to a new installation of Rockbox Utility or a changed device "
- "path. The configuation dialog will now open to allow you "
+ "path. The configuration dialog will now open to allow you "
"correcting the problem."));
configDialog();
}
diff --git a/rbutil/rbutilqt/talkfile.cpp b/rbutil/rbutilqt/talkfile.cpp
index 7e5b6a2a0c..37a584e28c 100644
--- a/rbutil/rbutilqt/talkfile.cpp
+++ b/rbutil/rbutilqt/talkfile.cpp
@@ -83,11 +83,12 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
QString toSpeak;
QString filename;
QString wavfilename;
+ QString filepath;
QString path = fileInf.filePath();
qDebug() << path;
- if( path.endsWith("..") || path.endsWith(".talk") )
+ if( path.endsWith("..") || path.endsWith(".") || path.endsWith(".talk") )
{
it.next();
continue;
@@ -102,13 +103,12 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
it.next();
continue;
}
- int index1 = path.lastIndexOf("/");
- int index2 = path.lastIndexOf("/",index1-1);
-
- toSpeak = path.mid(index2+1,(index1-index2)-1);
-
- filename = path.left(index1) + "/_dirname.talk";
- qDebug() << "toSpeak: " << toSpeak << "filename: " << filename;
+
+ toSpeak = fileInf.fileName();
+
+ filepath = fileInf.filePath() + "/";
+ filename = "_dirname.talk";
+ qDebug() << "toSpeak: " << toSpeak << "filename: " << filename << " path: " <<filepath;
}
else // if it is a file
{
@@ -118,15 +118,21 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
it.next();
continue;
}
+
+ // create toSpeak string
if(m_stripExtensions)
toSpeak = fileInf.baseName();
else
toSpeak = fileInf.fileName();
- filename = fileInf.absoluteFilePath() + ".talk";
+ // create filename and path
+ filepath = fileInf.absolutePath();
+ filename = fileInf.fileName() + ".talk";
+
}
- wavfilename = filename + ".wav";
+
+ wavfilename = QDir::tempPath()+ "/"+ filename + ".wav";
- QFileInfo filenameInf(filename);
+ QFileInfo filenameInf(filepath+filename);
QFileInfo wavfilenameInf(wavfilename);
//! the actual generation of the .talk files
@@ -147,7 +153,7 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
QCoreApplication::processEvents();
}
m_logger->addItem(tr("Encoding of %1").arg(toSpeak),LOGINFO);
- if(!m_enc->encode(wavfilename,filename))
+ if(!m_enc->encode(wavfilename,filepath+filename))
{
m_logger->addItem(tr("Encoding of %1 failed").arg(wavfilename),LOGERROR);
m_logger->abort();
@@ -171,7 +177,7 @@ bool TalkFileCreator::createTalkFiles(ProgressloggerInterface* logger)
installlog.setValue(wavfilename.remove(0,m_mountpoint.length()),now);
//! add the .talk file to the install log
- installlog.setValue(filename.remove(0,m_mountpoint.length()),now);
+ installlog.setValue(QString(filepath+filename).remove(0,m_mountpoint.length()),now);
it.next();
}