forked from len0rd/rockbox
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
This commit is contained in:
parent
20bf8aaf18
commit
07a55a747d
4 changed files with 43 additions and 160 deletions
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ class Config : public QDialog
|
|||
void configEnc(void);
|
||||
void updateTtsState(int);
|
||||
void updateEncState();
|
||||
void testTts();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>&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>&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>&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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue