diff options
author | Dominik Wenger <domonoky@googlemail.com> | 2009-06-26 21:52:08 +0000 |
---|---|---|
committer | Dominik Wenger <domonoky@googlemail.com> | 2009-06-26 21:52:08 +0000 |
commit | 07a55a747d161f164c4cb1c73e2d697a84e4e5de (patch) | |
tree | 0b66c591fb534b4dc14272a3300ebdbbd5e32a54 | |
parent | 20bf8aaf181dc5f24bad2628953c4d53782533cb (diff) | |
download | rockbox-07a55a747d161f164c4cb1c73e2d697a84e4e5de.tar.gz 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
-rw-r--r-- | rbutil/rbutilqt/configure.cpp | 35 | ||||
-rw-r--r-- | rbutil/rbutilqt/configure.h | 1 | ||||
-rw-r--r-- | rbutil/rbutilqt/configurefrm.ui | 9 | ||||
-rw-r--r-- | rbutil/rbutilqt/encexescfgfrm.ui | 158 |
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) | |||
85 | connect(ui.configEncoder, SIGNAL(clicked()), this, SLOT(configEnc())); | 85 | connect(ui.configEncoder, SIGNAL(clicked()), this, SLOT(configEnc())); |
86 | connect(ui.comboTts, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTtsState(int))); | 86 | connect(ui.comboTts, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTtsState(int))); |
87 | connect(ui.treeDevices, SIGNAL(itemSelectionChanged()), this, SLOT(updateEncState())); | 87 | connect(ui.treeDevices, SIGNAL(itemSelectionChanged()), this, SLOT(updateEncState())); |
88 | 88 | connect(ui.testTTS,SIGNAL(clicked()),this,SLOT(testTts())); | |
89 | setUserSettings(); | 89 | setUserSettings(); |
90 | setDevices(); | 90 | setDevices(); |
91 | } | 91 | } |
@@ -660,6 +660,39 @@ void Config::configTts() | |||
660 | updateTtsState(ui.comboTts->currentIndex()); | 660 | updateTtsState(ui.comboTts->currentIndex()); |
661 | } | 661 | } |
662 | 662 | ||
663 | void Config::testTts() | ||
664 | { | ||
665 | QString errstr; | ||
666 | int index = ui.comboTts->currentIndex(); | ||
667 | TTSBase* tts = TTSBase::getTTS(this,ui.comboTts->itemData(index).toString()); | ||
668 | if(!tts->configOk()) | ||
669 | { | ||
670 | QMessageBox::warning(this,tr("TTS configuration invalid"),tr("TTS configuration invalid. \n Please configure TTS engine.")); | ||
671 | return; | ||
672 | } | ||
673 | |||
674 | if(!tts->start(&errstr)) | ||
675 | { | ||
676 | QMessageBox::warning(this,tr("Could not start TTS engine"),tr("Could not start TTS engine.\n") + errstr | ||
677 | +tr("\nPlease configure TTS engine.")); | ||
678 | return; | ||
679 | } | ||
680 | |||
681 | QTemporaryFile file(this); | ||
682 | file.open(); | ||
683 | QString filename = file.fileName(); | ||
684 | file.close(); | ||
685 | |||
686 | if(tts->voice(tr("Rockbox Utility Voice Test"),filename,&errstr) == FatalError) | ||
687 | { | ||
688 | tts->stop(); | ||
689 | QMessageBox::warning(this,tr("Could not voice test string"),tr("Could not voice test string.\n") + errstr | ||
690 | +tr("\nPlease configure TTS engine.")); | ||
691 | return; | ||
692 | } | ||
693 | tts->stop(); | ||
694 | QSound::play(filename); | ||
695 | } | ||
663 | 696 | ||
664 | void Config::configEnc() | 697 | void Config::configEnc() |
665 | { | 698 | { |
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 | |||
70 | void configEnc(void); | 70 | void configEnc(void); |
71 | void updateTtsState(int); | 71 | void updateTtsState(int); |
72 | void updateEncState(); | 72 | void updateEncState(); |
73 | void testTts(); | ||
73 | }; | 74 | }; |
74 | 75 | ||
75 | #endif | 76 | #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 @@ | |||
380 | </property> | 380 | </property> |
381 | </widget> | 381 | </widget> |
382 | </item> | 382 | </item> |
383 | <item row="0" column="1" colspan="3" > | 383 | <item row="0" column="1" colspan="2" > |
384 | <widget class="QComboBox" name="comboTts" /> | 384 | <widget class="QComboBox" name="comboTts" /> |
385 | </item> | 385 | </item> |
386 | <item row="1" column="0" > | 386 | <item row="1" column="0" > |
@@ -418,6 +418,13 @@ | |||
418 | </property> | 418 | </property> |
419 | </widget> | 419 | </widget> |
420 | </item> | 420 | </item> |
421 | <item row="0" column="3"> | ||
422 | <widget class="QPushButton" name="testTTS"> | ||
423 | <property name="text"> | ||
424 | <string>Test TTS</string> | ||
425 | </property> | ||
426 | </widget> | ||
427 | </item> | ||
421 | </layout> | 428 | </layout> |
422 | </widget> | 429 | </widget> |
423 | </item> | 430 | </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 @@ | |||
1 | <ui version="4.0" > | ||
2 | <class>EncExesCfgFrm</class> | ||
3 | <widget class="QDialog" name="EncExesCfgFrm" > | ||
4 | <property name="geometry" > | ||
5 | <rect> | ||
6 | <x>0</x> | ||
7 | <y>0</y> | ||
8 | <width>463</width> | ||
9 | <height>214</height> | ||
10 | </rect> | ||
11 | </property> | ||
12 | <property name="windowTitle" > | ||
13 | <string>Configuration</string> | ||
14 | </property> | ||
15 | <layout class="QHBoxLayout" > | ||
16 | <item> | ||
17 | <widget class="QGroupBox" name="groupBox" > | ||
18 | <property name="title" > | ||
19 | <string>Configure Encoder</string> | ||
20 | </property> | ||
21 | <layout class="QVBoxLayout" > | ||
22 | <item> | ||
23 | <widget class="QLabel" name="label" > | ||
24 | <property name="sizePolicy" > | ||
25 | <sizepolicy vsizetype="Preferred" hsizetype="Preferred" > | ||
26 | <horstretch>0</horstretch> | ||
27 | <verstretch>255</verstretch> | ||
28 | </sizepolicy> | ||
29 | </property> | ||
30 | <property name="text" > | ||
31 | <string>Path to Encoder</string> | ||
32 | </property> | ||
33 | </widget> | ||
34 | </item> | ||
35 | <item> | ||
36 | <layout class="QHBoxLayout" > | ||
37 | <item> | ||
38 | <widget class="QLineEdit" name="encoderpath" /> | ||
39 | </item> | ||
40 | <item> | ||
41 | <widget class="QPushButton" name="browse" > | ||
42 | <property name="text" > | ||
43 | <string>&Browse</string> | ||
44 | </property> | ||
45 | </widget> | ||
46 | </item> | ||
47 | </layout> | ||
48 | </item> | ||
49 | <item> | ||
50 | <widget class="QLabel" name="label_2" > | ||
51 | <property name="text" > | ||
52 | <string>Encoder options</string> | ||
53 | </property> | ||
54 | </widget> | ||
55 | </item> | ||
56 | <item> | ||
57 | <widget class="QLineEdit" name="encoderoptions" /> | ||
58 | </item> | ||
59 | <item> | ||
60 | <spacer> | ||
61 | <property name="orientation" > | ||
62 | <enum>Qt::Vertical</enum> | ||
63 | </property> | ||
64 | <property name="sizeHint" > | ||
65 | <size> | ||
66 | <width>20</width> | ||
67 | <height>40</height> | ||
68 | </size> | ||
69 | </property> | ||
70 | </spacer> | ||
71 | </item> | ||
72 | <item> | ||
73 | <layout class="QHBoxLayout" > | ||
74 | <item> | ||
75 | <widget class="QPushButton" name="reset" > | ||
76 | <property name="text" > | ||
77 | <string>Reset</string> | ||
78 | </property> | ||
79 | </widget> | ||
80 | </item> | ||
81 | <item> | ||
82 | <spacer> | ||
83 | <property name="orientation" > | ||
84 | <enum>Qt::Horizontal</enum> | ||
85 | </property> | ||
86 | <property name="sizeHint" > | ||
87 | <size> | ||
88 | <width>40</width> | ||
89 | <height>20</height> | ||
90 | </size> | ||
91 | </property> | ||
92 | </spacer> | ||
93 | </item> | ||
94 | <item> | ||
95 | <widget class="QPushButton" name="buttonOk" > | ||
96 | <property name="text" > | ||
97 | <string>&Ok</string> | ||
98 | </property> | ||
99 | <property name="icon" > | ||
100 | <iconset resource="rbutilqt.qrc" >:/icons/go-next.png</iconset> | ||
101 | </property> | ||
102 | </widget> | ||
103 | </item> | ||
104 | <item> | ||
105 | <widget class="QPushButton" name="buttonCancel" > | ||
106 | <property name="text" > | ||
107 | <string>&Cancel</string> | ||
108 | </property> | ||
109 | <property name="icon" > | ||
110 | <iconset resource="rbutilqt.qrc" >:/icons/process-stop.png</iconset> | ||
111 | </property> | ||
112 | </widget> | ||
113 | </item> | ||
114 | </layout> | ||
115 | </item> | ||
116 | </layout> | ||
117 | </widget> | ||
118 | </item> | ||
119 | </layout> | ||
120 | </widget> | ||
121 | <resources> | ||
122 | <include location="rbutilqt.qrc" /> | ||
123 | </resources> | ||
124 | <connections> | ||
125 | <connection> | ||
126 | <sender>buttonOk</sender> | ||
127 | <signal>clicked()</signal> | ||
128 | <receiver>EncExesCfgFrm</receiver> | ||
129 | <slot>accept()</slot> | ||
130 | <hints> | ||
131 | <hint type="sourcelabel" > | ||
132 | <x>253</x> | ||
133 | <y>147</y> | ||
134 | </hint> | ||
135 | <hint type="destinationlabel" > | ||
136 | <x>203</x> | ||
137 | <y>86</y> | ||
138 | </hint> | ||
139 | </hints> | ||
140 | </connection> | ||
141 | <connection> | ||
142 | <sender>buttonCancel</sender> | ||
143 | <signal>clicked()</signal> | ||
144 | <receiver>EncExesCfgFrm</receiver> | ||
145 | <slot>reject()</slot> | ||
146 | <hints> | ||
147 | <hint type="sourcelabel" > | ||
148 | <x>352</x> | ||
149 | <y>147</y> | ||
150 | </hint> | ||
151 | <hint type="destinationlabel" > | ||
152 | <x>203</x> | ||
153 | <y>86</y> | ||
154 | </hint> | ||
155 | </hints> | ||
156 | </connection> | ||
157 | </connections> | ||
158 | </ui> | ||