summaryrefslogtreecommitdiffstats
path: root/rbutil
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2009-06-26 21:52:08 +0000
committerDominik Wenger <domonoky@googlemail.com>2009-06-26 21:52:08 +0000
commit07a55a747d161f164c4cb1c73e2d697a84e4e5de (patch)
tree0b66c591fb534b4dc14272a3300ebdbbd5e32a54 /rbutil
parent20bf8aaf181dc5f24bad2628953c4d53782533cb (diff)
downloadrockbox-07a55a747d161f164c4cb1c73e2d697a84e4e5de.tar.gz
rockbox-07a55a747d161f164c4cb1c73e2d697a84e4e5de.tar.bz2
rockbox-07a55a747d161f164c4cb1c73e2d697a84e4e5de.zip
rbutil: add a Button to test a TTS Engine. Remove a old .ui file.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21525 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/rbutilqt/configure.cpp35
-rw-r--r--rbutil/rbutilqt/configure.h1
-rw-r--r--rbutil/rbutilqt/configurefrm.ui9
-rw-r--r--rbutil/rbutilqt/encexescfgfrm.ui158
4 files changed, 43 insertions, 160 deletions
diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp
index 7669a103ae..fae537b367 100644
--- a/rbutil/rbutilqt/configure.cpp
+++ b/rbutil/rbutilqt/configure.cpp
@@ -85,7 +85,7 @@ Config::Config(QWidget *parent,int index) : QDialog(parent)
connect(ui.configEncoder, SIGNAL(clicked()), this, SLOT(configEnc()));
connect(ui.comboTts, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTtsState(int)));
connect(ui.treeDevices, SIGNAL(itemSelectionChanged()), this, SLOT(updateEncState()));
-
+ connect(ui.testTTS,SIGNAL(clicked()),this,SLOT(testTts()));
setUserSettings();
setDevices();
}
@@ -660,6 +660,39 @@ void Config::configTts()
updateTtsState(ui.comboTts->currentIndex());
}
+void Config::testTts()
+{
+ QString errstr;
+ int index = ui.comboTts->currentIndex();
+ TTSBase* tts = TTSBase::getTTS(this,ui.comboTts->itemData(index).toString());
+ if(!tts->configOk())
+ {
+ QMessageBox::warning(this,tr("TTS configuration invalid"),tr("TTS configuration invalid. \n Please configure TTS engine."));
+ return;
+ }
+
+ if(!tts->start(&errstr))
+ {
+ QMessageBox::warning(this,tr("Could not start TTS engine"),tr("Could not start TTS engine.\n") + errstr
+ +tr("\nPlease configure TTS engine."));
+ return;
+ }
+
+ QTemporaryFile file(this);
+ file.open();
+ QString filename = file.fileName();
+ file.close();
+
+ if(tts->voice(tr("Rockbox Utility Voice Test"),filename,&errstr) == FatalError)
+ {
+ tts->stop();
+ QMessageBox::warning(this,tr("Could not voice test string"),tr("Could not voice test string.\n") + errstr
+ +tr("\nPlease configure TTS engine."));
+ return;
+ }
+ tts->stop();
+ QSound::play(filename);
+}
void Config::configEnc()
{
diff --git a/rbutil/rbutilqt/configure.h b/rbutil/rbutilqt/configure.h
index 15e2d1b31c..6ae92b5b04 100644
--- a/rbutil/rbutilqt/configure.h
+++ b/rbutil/rbutilqt/configure.h
@@ -70,6 +70,7 @@ class Config : public QDialog
void configEnc(void);
void updateTtsState(int);
void updateEncState();
+ void testTts();
};
#endif
diff --git a/rbutil/rbutilqt/configurefrm.ui b/rbutil/rbutilqt/configurefrm.ui
index 857372c011..bfd87cb5bc 100644
--- a/rbutil/rbutilqt/configurefrm.ui
+++ b/rbutil/rbutilqt/configurefrm.ui
@@ -380,7 +380,7 @@
</property>
</widget>
</item>
- <item row="0" column="1" colspan="3" >
+ <item row="0" column="1" colspan="2" >
<widget class="QComboBox" name="comboTts" />
</item>
<item row="1" column="0" >
@@ -418,6 +418,13 @@
</property>
</widget>
</item>
+ <item row="0" column="3">
+ <widget class="QPushButton" name="testTTS">
+ <property name="text">
+ <string>Test TTS</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
diff --git a/rbutil/rbutilqt/encexescfgfrm.ui b/rbutil/rbutilqt/encexescfgfrm.ui
deleted file mode 100644
index c1b8e31429..0000000000
--- a/rbutil/rbutilqt/encexescfgfrm.ui
+++ /dev/null
@@ -1,158 +0,0 @@
-<ui version="4.0" >
- <class>EncExesCfgFrm</class>
- <widget class="QDialog" name="EncExesCfgFrm" >
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>463</width>
- <height>214</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string>Configuration</string>
- </property>
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QGroupBox" name="groupBox" >
- <property name="title" >
- <string>Configure Encoder</string>
- </property>
- <layout class="QVBoxLayout" >
- <item>
- <widget class="QLabel" name="label" >
- <property name="sizePolicy" >
- <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
- <horstretch>0</horstretch>
- <verstretch>255</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Path to Encoder</string>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QLineEdit" name="encoderpath" />
- </item>
- <item>
- <widget class="QPushButton" name="browse" >
- <property name="text" >
- <string>&amp;Browse</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QLabel" name="label_2" >
- <property name="text" >
- <string>Encoder options</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="encoderoptions" />
- </item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <item>
- <widget class="QPushButton" name="reset" >
- <property name="text" >
- <string>Reset</string>
- </property>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="buttonOk" >
- <property name="text" >
- <string>&amp;Ok</string>
- </property>
- <property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/go-next.png</iconset>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="buttonCancel" >
- <property name="text" >
- <string>&amp;Cancel</string>
- </property>
- <property name="icon" >
- <iconset resource="rbutilqt.qrc" >:/icons/process-stop.png</iconset>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- <resources>
- <include location="rbutilqt.qrc" />
- </resources>
- <connections>
- <connection>
- <sender>buttonOk</sender>
- <signal>clicked()</signal>
- <receiver>EncExesCfgFrm</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>253</x>
- <y>147</y>
- </hint>
- <hint type="destinationlabel" >
- <x>203</x>
- <y>86</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonCancel</sender>
- <signal>clicked()</signal>
- <receiver>EncExesCfgFrm</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>352</x>
- <y>147</y>
- </hint>
- <hint type="destinationlabel" >
- <x>203</x>
- <y>86</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>