diff options
-rw-r--r-- | rbutil/rbutilqt/createvoicefrm.ui | 191 | ||||
-rw-r--r-- | rbutil/rbutilqt/createvoicewindow.cpp | 113 | ||||
-rw-r--r-- | rbutil/rbutilqt/createvoicewindow.h | 56 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutil.ini | 141 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.cpp | 16 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.h | 1 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.pro | 19 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.qrc | 3 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqtfrm.ui | 57 | ||||
-rw-r--r-- | rbutil/rbutilqt/tts.cpp | 4 | ||||
-rw-r--r-- | rbutil/rbutilqt/voicefile.cpp | 275 | ||||
-rw-r--r-- | rbutil/rbutilqt/voicefile.h | 84 |
12 files changed, 871 insertions, 89 deletions
diff --git a/rbutil/rbutilqt/createvoicefrm.ui b/rbutil/rbutilqt/createvoicefrm.ui new file mode 100644 index 0000000000..8847409f37 --- /dev/null +++ b/rbutil/rbutilqt/createvoicefrm.ui | |||
@@ -0,0 +1,191 @@ | |||
1 | <ui version="4.0" > | ||
2 | <class>CreateVoiceFrm</class> | ||
3 | <widget class="QDialog" name="CreateVoiceFrm" > | ||
4 | <property name="windowModality" > | ||
5 | <enum>Qt::WindowModal</enum> | ||
6 | </property> | ||
7 | <property name="geometry" > | ||
8 | <rect> | ||
9 | <x>0</x> | ||
10 | <y>0</y> | ||
11 | <width>637</width> | ||
12 | <height>421</height> | ||
13 | </rect> | ||
14 | </property> | ||
15 | <property name="windowTitle" > | ||
16 | <string>Create Voice File</string> | ||
17 | </property> | ||
18 | <layout class="QGridLayout" > | ||
19 | <item rowspan="5" row="0" column="0" > | ||
20 | <widget class="QLabel" name="label" > | ||
21 | <property name="text" > | ||
22 | <string/> | ||
23 | </property> | ||
24 | <property name="pixmap" > | ||
25 | <pixmap resource="rbutilqt.qrc" >:/icons/icons/wizard.xpm</pixmap> | ||
26 | </property> | ||
27 | <property name="alignment" > | ||
28 | <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> | ||
29 | </property> | ||
30 | </widget> | ||
31 | </item> | ||
32 | <item row="0" column="1" colspan="2" > | ||
33 | <widget class="QLabel" name="label_2" > | ||
34 | <property name="sizePolicy" > | ||
35 | <sizepolicy vsizetype="Minimum" hsizetype="Minimum" > | ||
36 | <horstretch>0</horstretch> | ||
37 | <verstretch>0</verstretch> | ||
38 | </sizepolicy> | ||
39 | </property> | ||
40 | <property name="text" > | ||
41 | <string>Select the Language you want to generate a voicefile for:</string> | ||
42 | </property> | ||
43 | </widget> | ||
44 | </item> | ||
45 | <item row="1" column="1" colspan="2" > | ||
46 | <widget class="QComboBox" name="comboLanguage" /> | ||
47 | </item> | ||
48 | <item row="2" column="1" colspan="2" > | ||
49 | <widget class="QGroupBox" name="groupBox_2" > | ||
50 | <property name="title" > | ||
51 | <string>Generation settings</string> | ||
52 | </property> | ||
53 | <layout class="QGridLayout" > | ||
54 | <item row="0" column="0" > | ||
55 | <widget class="QLabel" name="labelEncProfile" > | ||
56 | <property name="text" > | ||
57 | <string>Encoder profile:</string> | ||
58 | </property> | ||
59 | </widget> | ||
60 | </item> | ||
61 | <item row="1" column="0" > | ||
62 | <widget class="QLabel" name="labelTtsProfile" > | ||
63 | <property name="text" > | ||
64 | <string>TTS profile:</string> | ||
65 | </property> | ||
66 | </widget> | ||
67 | </item> | ||
68 | <item row="2" column="0" > | ||
69 | <widget class="QPushButton" name="change" > | ||
70 | <property name="sizePolicy" > | ||
71 | <sizepolicy vsizetype="Minimum" hsizetype="Minimum" > | ||
72 | <horstretch>0</horstretch> | ||
73 | <verstretch>0</verstretch> | ||
74 | </sizepolicy> | ||
75 | </property> | ||
76 | <property name="text" > | ||
77 | <string>Change</string> | ||
78 | </property> | ||
79 | </widget> | ||
80 | </item> | ||
81 | <item row="2" column="1" > | ||
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 | </layout> | ||
95 | </widget> | ||
96 | </item> | ||
97 | <item row="3" column="1" > | ||
98 | <spacer> | ||
99 | <property name="orientation" > | ||
100 | <enum>Qt::Vertical</enum> | ||
101 | </property> | ||
102 | <property name="sizeHint" > | ||
103 | <size> | ||
104 | <width>20</width> | ||
105 | <height>201</height> | ||
106 | </size> | ||
107 | </property> | ||
108 | </spacer> | ||
109 | </item> | ||
110 | <item row="4" column="1" > | ||
111 | <spacer> | ||
112 | <property name="orientation" > | ||
113 | <enum>Qt::Horizontal</enum> | ||
114 | </property> | ||
115 | <property name="sizeHint" > | ||
116 | <size> | ||
117 | <width>40</width> | ||
118 | <height>20</height> | ||
119 | </size> | ||
120 | </property> | ||
121 | </spacer> | ||
122 | </item> | ||
123 | <item row="4" column="2" > | ||
124 | <layout class="QHBoxLayout" > | ||
125 | <item> | ||
126 | <widget class="QPushButton" name="buttonOk" > | ||
127 | <property name="text" > | ||
128 | <string>&Install</string> | ||
129 | </property> | ||
130 | <property name="icon" > | ||
131 | <iconset resource="rbutilqt.qrc" >:/icons/icons/go-next.png</iconset> | ||
132 | </property> | ||
133 | </widget> | ||
134 | </item> | ||
135 | <item> | ||
136 | <widget class="QPushButton" name="buttonCancel" > | ||
137 | <property name="text" > | ||
138 | <string>&Cancel</string> | ||
139 | </property> | ||
140 | <property name="icon" > | ||
141 | <iconset resource="rbutilqt.qrc" >:/icons/icons/process-stop.png</iconset> | ||
142 | </property> | ||
143 | </widget> | ||
144 | </item> | ||
145 | </layout> | ||
146 | </item> | ||
147 | </layout> | ||
148 | </widget> | ||
149 | <tabstops> | ||
150 | <tabstop>change</tabstop> | ||
151 | <tabstop>buttonOk</tabstop> | ||
152 | <tabstop>buttonCancel</tabstop> | ||
153 | </tabstops> | ||
154 | <resources> | ||
155 | <include location="rbutilqt.qrc" /> | ||
156 | </resources> | ||
157 | <connections> | ||
158 | <connection> | ||
159 | <sender>buttonOk</sender> | ||
160 | <signal>clicked()</signal> | ||
161 | <receiver>CreateVoiceFrm</receiver> | ||
162 | <slot>accept()</slot> | ||
163 | <hints> | ||
164 | <hint type="sourcelabel" > | ||
165 | <x>472</x> | ||
166 | <y>418</y> | ||
167 | </hint> | ||
168 | <hint type="destinationlabel" > | ||
169 | <x>382</x> | ||
170 | <y>328</y> | ||
171 | </hint> | ||
172 | </hints> | ||
173 | </connection> | ||
174 | <connection> | ||
175 | <sender>buttonCancel</sender> | ||
176 | <signal>clicked()</signal> | ||
177 | <receiver>CreateVoiceFrm</receiver> | ||
178 | <slot>reject()</slot> | ||
179 | <hints> | ||
180 | <hint type="sourcelabel" > | ||
181 | <x>561</x> | ||
182 | <y>428</y> | ||
183 | </hint> | ||
184 | <hint type="destinationlabel" > | ||
185 | <x>522</x> | ||
186 | <y>332</y> | ||
187 | </hint> | ||
188 | </hints> | ||
189 | </connection> | ||
190 | </connections> | ||
191 | </ui> | ||
diff --git a/rbutil/rbutilqt/createvoicewindow.cpp b/rbutil/rbutilqt/createvoicewindow.cpp new file mode 100644 index 0000000000..b8a14498de --- /dev/null +++ b/rbutil/rbutilqt/createvoicewindow.cpp | |||
@@ -0,0 +1,113 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2007 by Dominik Riebeling | ||
10 | * $Id: createvoicewindow.cpp 15932 2007-12-15 13:13:57Z domonoky $ | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #include "createvoicewindow.h" | ||
21 | #include "ui_createvoicefrm.h" | ||
22 | |||
23 | #include "browsedirtree.h" | ||
24 | #include "configure.h" | ||
25 | |||
26 | CreateVoiceWindow::CreateVoiceWindow(QWidget *parent) : QDialog(parent) | ||
27 | { | ||
28 | ui.setupUi(this); | ||
29 | voicecreator = new VoiceFileCreator(this); | ||
30 | |||
31 | connect(ui.change,SIGNAL(clicked()),this,SLOT(change())); | ||
32 | } | ||
33 | |||
34 | void CreateVoiceWindow::change() | ||
35 | { | ||
36 | Config *cw = new Config(this,4); | ||
37 | cw->setUserSettings(userSettings); | ||
38 | cw->setDevices(devices); | ||
39 | cw->show(); | ||
40 | connect(cw, SIGNAL(settingsUpdated()), this, SIGNAL(settingsUpdated())); | ||
41 | } | ||
42 | |||
43 | void CreateVoiceWindow::accept() | ||
44 | { | ||
45 | logger = new ProgressLoggerGui(this); | ||
46 | logger->show(); | ||
47 | connect(logger,SIGNAL(closed()),this,SLOT(close())); | ||
48 | |||
49 | QString platform = userSettings->value("platform").toString(); | ||
50 | QString lang = ui.comboLanguage->currentText(); | ||
51 | |||
52 | //safe selected language | ||
53 | userSettings->setValue("voicelanguage",lang); | ||
54 | userSettings->sync(); | ||
55 | |||
56 | //configure voicecreator | ||
57 | voicecreator->setUserSettings(userSettings); | ||
58 | voicecreator->setDeviceSettings(devices); | ||
59 | voicecreator->setMountPoint(userSettings->value("mountpoint").toString()); | ||
60 | voicecreator->setTargetId(devices->value(platform + "/targetid").toInt()); | ||
61 | voicecreator->setLang(lang); | ||
62 | voicecreator->setProxy(m_proxy); | ||
63 | |||
64 | //start creating | ||
65 | voicecreator->createVoiceFile(logger); | ||
66 | } | ||
67 | |||
68 | |||
69 | |||
70 | void CreateVoiceWindow::setDeviceSettings(QSettings *dev) | ||
71 | { | ||
72 | devices = dev; | ||
73 | qDebug() << "Install::setDeviceSettings:" << devices; | ||
74 | |||
75 | // fill in language combobox | ||
76 | devices->beginGroup("languages"); | ||
77 | QStringList keys = devices->allKeys(); | ||
78 | QStringList languages; | ||
79 | for(int i =0 ; i < keys.size();i++) | ||
80 | { | ||
81 | languages << devices->value(keys.at(i)).toString(); | ||
82 | } | ||
83 | devices->endGroup(); | ||
84 | |||
85 | ui.comboLanguage->addItems(languages); | ||
86 | // set saved lang | ||
87 | ui.comboLanguage->setCurrentIndex(ui.comboLanguage->findText(userSettings->value("voicelanguage").toString())); | ||
88 | } | ||
89 | |||
90 | void CreateVoiceWindow::setUserSettings(QSettings *user) | ||
91 | { | ||
92 | userSettings = user; | ||
93 | |||
94 | QString ttsName = userSettings->value("tts", "none").toString(); | ||
95 | TTSBase* tts = getTTS(ttsName); | ||
96 | tts->setUserCfg(userSettings); | ||
97 | if(tts->configOk()) | ||
98 | ui.labelTtsProfile->setText(tr("Selected TTS engine : <b>%1</b>").arg(ttsName)); | ||
99 | else | ||
100 | ui.labelTtsProfile->setText(tr("Selected TTS Engine: <b>%1</b>").arg("Invalid TTS configuration!")); | ||
101 | |||
102 | QString encoder = userSettings->value("encoder", "none").toString(); | ||
103 | EncBase* enc = getEncoder(encoder); | ||
104 | enc->setUserCfg(userSettings); | ||
105 | if(enc->configOk()) | ||
106 | ui.labelEncProfile->setText(tr("Selected Encoder: <b>%1</b>").arg(encoder)); | ||
107 | else | ||
108 | ui.labelEncProfile->setText(tr("Selected Encoder: <b>%1</b>").arg("Invalid encoder configuration!")); | ||
109 | |||
110 | } | ||
111 | |||
112 | |||
113 | |||
diff --git a/rbutil/rbutilqt/createvoicewindow.h b/rbutil/rbutilqt/createvoicewindow.h new file mode 100644 index 0000000000..76472721fe --- /dev/null +++ b/rbutil/rbutilqt/createvoicewindow.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2007 by Dominik Wenger | ||
10 | * $Id: installtalkwindow.h 15926 2007-12-14 19:49:11Z domonoky $ | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #ifndef CREATEVOICEWINDOW_H | ||
21 | #define CREATEVOICEWINDOW_H | ||
22 | |||
23 | #include <QtGui> | ||
24 | |||
25 | #include <QSettings> | ||
26 | |||
27 | #include "ui_createvoicefrm.h" | ||
28 | #include "progressloggergui.h" | ||
29 | #include "voicefile.h" | ||
30 | |||
31 | class CreateVoiceWindow : public QDialog | ||
32 | { | ||
33 | Q_OBJECT | ||
34 | public: | ||
35 | CreateVoiceWindow(QWidget *parent = 0); | ||
36 | void setUserSettings(QSettings*); | ||
37 | void setDeviceSettings(QSettings*); | ||
38 | void setProxy(QUrl proxy){m_proxy = proxy;} | ||
39 | |||
40 | signals: | ||
41 | void settingsUpdated(void); | ||
42 | |||
43 | public slots: | ||
44 | void accept(void); | ||
45 | void change(void); | ||
46 | |||
47 | private: | ||
48 | VoiceFileCreator* voicecreator; | ||
49 | Ui::CreateVoiceFrm ui; | ||
50 | ProgressLoggerGui* logger; | ||
51 | QSettings *devices; | ||
52 | QSettings *userSettings; | ||
53 | QUrl m_proxy; | ||
54 | }; | ||
55 | |||
56 | #endif | ||
diff --git a/rbutil/rbutilqt/rbutil.ini b/rbutil/rbutilqt/rbutil.ini index 1c118a5959..2f2e904ab4 100644 --- a/rbutil/rbutilqt/rbutil.ini +++ b/rbutil/rbutilqt/rbutil.ini | |||
@@ -13,6 +13,7 @@ themes_url=http://www.rockbox-themes.org | |||
13 | manual_url=http://download.rockbox.org/manual | 13 | manual_url=http://download.rockbox.org/manual |
14 | doom_url=http://download.rockbox.org/useful/rockdoom.zip | 14 | doom_url=http://download.rockbox.org/useful/rockdoom.zip |
15 | voice_url=http://www.rockbox.org/voices/ | 15 | voice_url=http://www.rockbox.org/voices/ |
16 | genlang_url=http://www.rockbox.org/genlang/ | ||
16 | 17 | ||
17 | [platforms] | 18 | [platforms] |
18 | platform01=player | 19 | platform01=player |
@@ -56,6 +57,7 @@ resolution=11x2x1 | |||
56 | manualname= | 57 | manualname= |
57 | brand=Archos | 58 | brand=Archos |
58 | voicename=player | 59 | voicename=player |
60 | targetid=1 | ||
59 | 61 | ||
60 | [recorder] | 62 | [recorder] |
61 | name="Jukebox Recorder 6 / 10 / 15 / 20" | 63 | name="Jukebox Recorder 6 / 10 / 15 / 20" |
@@ -68,6 +70,7 @@ resolution=112x64x1 | |||
68 | manualname= | 70 | manualname= |
69 | brand=Archos | 71 | brand=Archos |
70 | voicename=recorder | 72 | voicename=recorder |
73 | targetid=2 | ||
71 | 74 | ||
72 | [recorder8mb] | 75 | [recorder8mb] |
73 | name="Jukebox Recorder 6 / 10 / 15 / 20 (with 8MiB memory)" | 76 | name="Jukebox Recorder 6 / 10 / 15 / 20 (with 8MiB memory)" |
@@ -80,6 +83,7 @@ resolution=112x64x1 | |||
80 | manualname=rockbox-recorder | 83 | manualname=rockbox-recorder |
81 | brand=Archos | 84 | brand=Archos |
82 | voicename=recorder | 85 | voicename=recorder |
86 | targetid=2 | ||
83 | 87 | ||
84 | [recorderv2] | 88 | [recorderv2] |
85 | name="Jukebox Recorder v2 (20GB)" | 89 | name="Jukebox Recorder v2 (20GB)" |
@@ -92,6 +96,7 @@ resolution=112x64x1 | |||
92 | manualname= | 96 | manualname= |
93 | brand=Archos | 97 | brand=Archos |
94 | voicename=recorderv2 | 98 | voicename=recorderv2 |
99 | targetid=4 | ||
95 | 100 | ||
96 | [fmrecorder] | 101 | [fmrecorder] |
97 | name="Jukebox Recorder FM" | 102 | name="Jukebox Recorder FM" |
@@ -104,6 +109,7 @@ resolution=112x64x1 | |||
104 | manualname= | 109 | manualname= |
105 | brand=Archos | 110 | brand=Archos |
106 | voicename=fmrecorder | 111 | voicename=fmrecorder |
112 | targetid=3 | ||
107 | 113 | ||
108 | [fmrecorder8mb] | 114 | [fmrecorder8mb] |
109 | name="Jukebox Recorder FM (with 8MiB memory)" | 115 | name="Jukebox Recorder FM (with 8MiB memory)" |
@@ -116,6 +122,7 @@ resolution=112x64x1 | |||
116 | manualname=rockbox-fmrecorder | 122 | manualname=rockbox-fmrecorder |
117 | brand=Archos | 123 | brand=Archos |
118 | voicename=fmrecorder | 124 | voicename=fmrecorder |
125 | targetid=3 | ||
119 | 126 | ||
120 | [ondiosp] | 127 | [ondiosp] |
121 | name="Ondio SP" | 128 | name="Ondio SP" |
@@ -128,6 +135,7 @@ resolution=112x64x1 | |||
128 | manualname= | 135 | manualname= |
129 | brand=Archos | 136 | brand=Archos |
130 | voicename=ondiosp | 137 | voicename=ondiosp |
138 | targetid=7 | ||
131 | 139 | ||
132 | [ondiofm] | 140 | [ondiofm] |
133 | name="Ondio FM" | 141 | name="Ondio FM" |
@@ -140,6 +148,7 @@ resolution=112x64x1 | |||
140 | manualname= | 148 | manualname= |
141 | brand=Archos | 149 | brand=Archos |
142 | voicename=ondiofm | 150 | voicename=ondiofm |
151 | targetid=8 | ||
143 | 152 | ||
144 | [h100] | 153 | [h100] |
145 | name="iHP100 / iHP110" | 154 | name="iHP100 / iHP110" |
@@ -153,6 +162,7 @@ manualname=rockbox-h100 | |||
153 | brand=Iriver | 162 | brand=Iriver |
154 | usbid=0x10063001 | 163 | usbid=0x10063001 |
155 | voicename=h100 | 164 | voicename=h100 |
165 | targetid=11 | ||
156 | 166 | ||
157 | [h120] | 167 | [h120] |
158 | name="iHP120 / iHP140 / H120 / H140" | 168 | name="iHP120 / iHP140 / H120 / H140" |
@@ -166,6 +176,7 @@ manualname=rockbox-h100 | |||
166 | brand=Iriver | 176 | brand=Iriver |
167 | usbid=0x10063002 | 177 | usbid=0x10063002 |
168 | voicename=h120 | 178 | voicename=h120 |
179 | targetid=9 | ||
169 | 180 | ||
170 | [h300] | 181 | [h300] |
171 | name="H320 / H340" | 182 | name="H320 / H340" |
@@ -179,6 +190,7 @@ manualname=rockbox-h300 | |||
179 | brand=Iriver | 190 | brand=Iriver |
180 | usbid=0x10063003 | 191 | usbid=0x10063003 |
181 | voicename=h300 | 192 | voicename=h300 |
193 | targetid=10 | ||
182 | 194 | ||
183 | [h10_5gbums] | 195 | [h10_5gbums] |
184 | name="H10 (5 / 6GB) UMS" | 196 | name="H10 (5 / 6GB) UMS" |
@@ -192,6 +204,7 @@ manualname= | |||
192 | brand=Iriver | 204 | brand=Iriver |
193 | usbid=0x41022002 | 205 | usbid=0x41022002 |
194 | voicename=h10_5gb | 206 | voicename=h10_5gb |
207 | targetid=24 | ||
195 | 208 | ||
196 | [h10_5gbmtp] | 209 | [h10_5gbmtp] |
197 | name="H10 (5 / 6GB) MTP" | 210 | name="H10 (5 / 6GB) MTP" |
@@ -205,6 +218,7 @@ manualname= | |||
205 | brand=Iriver | 218 | brand=Iriver |
206 | usbid=0x41022105 | 219 | usbid=0x41022105 |
207 | voicename=h10_5gb | 220 | voicename=h10_5gb |
221 | targetid=24 | ||
208 | 222 | ||
209 | [h10] | 223 | [h10] |
210 | name="H10 (20GB)" | 224 | name="H10 (20GB)" |
@@ -219,6 +233,7 @@ brand=Iriver | |||
219 | usbid=0x0b7000ba | 233 | usbid=0x0b7000ba |
220 | usberror=0x41022101 | 234 | usberror=0x41022101 |
221 | voicename=h10 | 235 | voicename=h10 |
236 | targetid=22 | ||
222 | 237 | ||
223 | [ipod1g2g] | 238 | [ipod1g2g] |
224 | name="Ipod (1st / 2nd gen)" | 239 | name="Ipod (1st / 2nd gen)" |
@@ -231,6 +246,7 @@ resolution=160x128x2 | |||
231 | manualname= | 246 | manualname= |
232 | brand=Apple | 247 | brand=Apple |
233 | voicename=ipod1g2g | 248 | voicename=ipod1g2g |
249 | targetid=29 | ||
234 | 250 | ||
235 | [ipodcolor] | 251 | [ipodcolor] |
236 | name="Ipod Colour / Photo / U2 (4th gen)" | 252 | name="Ipod Colour / Photo / U2 (4th gen)" |
@@ -243,6 +259,7 @@ resolution=220x176x16 | |||
243 | manualname= | 259 | manualname= |
244 | brand=Apple | 260 | brand=Apple |
245 | voicename=ipodcolor | 261 | voicename=ipodcolor |
262 | targetid=13 | ||
246 | 263 | ||
247 | [ipodnano] | 264 | [ipodnano] |
248 | name="Ipod Nano (1st gen)" | 265 | name="Ipod Nano (1st gen)" |
@@ -256,6 +273,7 @@ manualname= | |||
256 | brand=Apple | 273 | brand=Apple |
257 | usbid=0x05ac120a | 274 | usbid=0x05ac120a |
258 | voicename=ipodnano | 275 | voicename=ipodnano |
276 | targetid=14 | ||
259 | 277 | ||
260 | [ipod4gray] | 278 | [ipod4gray] |
261 | name="Ipod (4th gen, greyscale)" | 279 | name="Ipod (4th gen, greyscale)" |
@@ -268,6 +286,7 @@ resolution=160x128x2 | |||
268 | manualname= | 286 | manualname= |
269 | brand=Apple | 287 | brand=Apple |
270 | voicename=ipod4gray | 288 | voicename=ipod4gray |
289 | targetid=17 | ||
271 | 290 | ||
272 | [ipodvideo] | 291 | [ipodvideo] |
273 | name="Ipod Video (5th gen) 30GB" | 292 | name="Ipod Video (5th gen) 30GB" |
@@ -280,6 +299,7 @@ resolution=320x240x16 | |||
280 | manualname= | 299 | manualname= |
281 | brand=Apple | 300 | brand=Apple |
282 | voicename=ipodvideo | 301 | voicename=ipodvideo |
302 | targetid=15 | ||
283 | 303 | ||
284 | [ipodvideo64mb] | 304 | [ipodvideo64mb] |
285 | name="Ipod Video (5th gen) 60/80GB" | 305 | name="Ipod Video (5th gen) 60/80GB" |
@@ -292,6 +312,7 @@ resolution=320x240x16 | |||
292 | manualname= | 312 | manualname= |
293 | brand=Apple | 313 | brand=Apple |
294 | voicename=ipodvideo | 314 | voicename=ipodvideo |
315 | targetid=15 | ||
295 | 316 | ||
296 | [ipod3g] | 317 | [ipod3g] |
297 | name="Ipod (3rd gen)" | 318 | name="Ipod (3rd gen)" |
@@ -305,6 +326,7 @@ manualname= | |||
305 | brand=Apple | 326 | brand=Apple |
306 | usbid=0x05ac1201 | 327 | usbid=0x05ac1201 |
307 | voicename=ipod3g | 328 | voicename=ipod3g |
329 | targetid=16 | ||
308 | 330 | ||
309 | [ipodmini1g] | 331 | [ipodmini1g] |
310 | name="Ipod Mini (1st gen)" | 332 | name="Ipod Mini (1st gen)" |
@@ -317,6 +339,7 @@ resolution=138x110x2 | |||
317 | manualname=rockbox-ipodmini2g | 339 | manualname=rockbox-ipodmini2g |
318 | brand=Apple | 340 | brand=Apple |
319 | voicename=ipodmini1g | 341 | voicename=ipodmini1g |
342 | targetid=18 | ||
320 | 343 | ||
321 | [ipodmini2g] | 344 | [ipodmini2g] |
322 | name="Ipod Mini (2nd gen)" | 345 | name="Ipod Mini (2nd gen)" |
@@ -329,6 +352,7 @@ resolution=138x110x2 | |||
329 | manualname=rockbox-ipodmini2g | 352 | manualname=rockbox-ipodmini2g |
330 | brand=Apple | 353 | brand=Apple |
331 | voicename=ipodmini2g | 354 | voicename=ipodmini2g |
355 | targetid=21 | ||
332 | 356 | ||
333 | [iaudiox5] | 357 | [iaudiox5] |
334 | name="iAudio X5 / X5L" | 358 | name="iAudio X5 / X5L" |
@@ -343,6 +367,7 @@ brand=Cowon | |||
343 | usbid=0x0e210510 | 367 | usbid=0x0e210510 |
344 | usbid=0x0e210513 | 368 | usbid=0x0e210513 |
345 | voicename=iaudiox5 | 369 | voicename=iaudiox5 |
370 | targetid=12 | ||
346 | 371 | ||
347 | [iaudiox5v] | 372 | [iaudiox5v] |
348 | name="iAudio X5V" | 373 | name="iAudio X5V" |
@@ -355,6 +380,7 @@ resolution=160x128x2 | |||
355 | manualname= | 380 | manualname= |
356 | brand=Cowon | 381 | brand=Cowon |
357 | voicename=iaudiox5v | 382 | voicename=iaudiox5v |
383 | targetid=12 | ||
358 | 384 | ||
359 | [iaudiom5] | 385 | [iaudiom5] |
360 | name="iAudio M5 / M5L" | 386 | name="iAudio M5 / M5L" |
@@ -368,6 +394,7 @@ manualname= | |||
368 | brand=Cowon | 394 | brand=Cowon |
369 | usbid=0x0e210520 | 395 | usbid=0x0e210520 |
370 | voicename=iaudiom5 | 396 | voicename=iaudiom5 |
397 | targetid=28 | ||
371 | 398 | ||
372 | [gigabeatf] | 399 | [gigabeatf] |
373 | name="Gigabeat F / X" | 400 | name="Gigabeat F / X" |
@@ -380,6 +407,7 @@ manualname= | |||
380 | brand=Toshiba | 407 | brand=Toshiba |
381 | usbid=0x09300009 | 408 | usbid=0x09300009 |
382 | voicename=gigabeatf | 409 | voicename=gigabeatf |
410 | targetid=20 | ||
383 | 411 | ||
384 | [sansae200] | 412 | [sansae200] |
385 | name="Sansa E200" | 413 | name="Sansa E200" |
@@ -394,6 +422,7 @@ brand=Sandisk | |||
394 | usbid=0x07817421 | 422 | usbid=0x07817421 |
395 | usberror=0x07810720 | 423 | usberror=0x07810720 |
396 | voicename=sansae200 | 424 | voicename=sansae200 |
425 | targetid=23 | ||
397 | 426 | ||
398 | [sansac200] | 427 | [sansac200] |
399 | name="Sansa C200" | 428 | name="Sansa C200" |
@@ -406,80 +435,44 @@ resolution=132x80x16 | |||
406 | manualname= | 435 | manualname= |
407 | brand=Sandisk | 436 | brand=Sandisk |
408 | voicename=sansac200 | 437 | voicename=sansac200 |
438 | targetid=30 | ||
439 | |||
440 | [languages] | ||
441 | lang1=africaans | ||
442 | lang2=bulgarian | ||
443 | lang3=catala | ||
444 | lang4=chinese-simp | ||
445 | lang5=chinese-trad | ||
446 | lang6=czech | ||
447 | lang7=dansk | ||
448 | lang8=deutsch | ||
449 | lang9=eesti | ||
450 | lang10=english | ||
451 | lang11=espanol | ||
452 | lang12=esperanto | ||
453 | lang13=finnish | ||
454 | lang14=francais | ||
455 | lang15=galego | ||
456 | lang16=greek | ||
457 | lang17=hebrew | ||
458 | lang18=islenska | ||
459 | lang19=italiano | ||
460 | lang20=japanese | ||
461 | lang21=korean | ||
462 | lang22=magyar | ||
463 | lang23=nederlands | ||
464 | lang24=norsk | ||
465 | lang25=norsk-nynorsk | ||
466 | lang26=polski | ||
467 | lang27=portugues | ||
468 | lang28=portugues-brasileiro | ||
469 | lang29=romaneste | ||
470 | lang30=russian | ||
471 | lang31=slovenscina | ||
472 | lang32=svenska | ||
473 | lang33=thai | ||
474 | lang34=turkce | ||
475 | lang35=wallisertitsch | ||
409 | 476 | ||
410 | [tts] | ||
411 | ttspreset01 = "espeak (default)" | ||
412 | ttspreset02 = "espeak (user-adjusted)" | ||
413 | ttspreset03 = "flite (default)" | ||
414 | ttspreset04 = "flite (user-adjusted)" | ||
415 | ttspreset05 = "sapi (default)" | ||
416 | ttspreset06 = "sapi (user-adjusted)" | ||
417 | ttspreset07 = "swift (default)" | ||
418 | ttspreset08 = "swift (user-adjusted)" | ||
419 | |||
420 | |||
421 | [ttspreset01] | ||
422 | tts = "espeak" | ||
423 | options = "" | ||
424 | template = "\"%exe\" \"%options\" -w \"%wavfile\" \"%text\"" | ||
425 | edit = false | ||
426 | os = all | ||
427 | needslanguagecfg = false | ||
428 | |||
429 | [ttspreset02] | ||
430 | tts = "espeak" | ||
431 | options = "" | ||
432 | template = "\"%exe\" \"%options\" -w \"%wavfile\" \"%text\"" | ||
433 | edit = true | ||
434 | os = all | ||
435 | needslanguagecfg = false | ||
436 | |||
437 | [ttspreset03] | ||
438 | tts = "flite" | ||
439 | options = "" | ||
440 | template = "\"%exe\" \"%options\" -o \"%wavfile\" \"%text\"" | ||
441 | edit = false | ||
442 | os = all | ||
443 | needslanguagecfg = false | ||
444 | |||
445 | [ttspreset04] | ||
446 | tts = "flite" | ||
447 | options = "" | ||
448 | template = "\"%exe\" \"%options\" -o \"%wavfile\" \"%text\"" | ||
449 | edit = true | ||
450 | os = all | ||
451 | needslanguagecfg = false | ||
452 | |||
453 | [ttspreset05] | ||
454 | tts = "sapi" | ||
455 | options = "" | ||
456 | template = "cscript //nologo \"%exe\" /language:%lang \"%options\"" | ||
457 | edit = false | ||
458 | os = win32 | ||
459 | needslanguagecfg = true | ||
460 | |||
461 | [ttspreset06] | ||
462 | tts = "sapi" | ||
463 | options = "" | ||
464 | template = "cscript //nologo \"%exe\" /language:%lang \"%options\"" | ||
465 | edit = true | ||
466 | os = win32 | ||
467 | needslanguagecfg = true | ||
468 | |||
469 | [ttspreset07] | ||
470 | tts = "swift" | ||
471 | options = "" | ||
472 | template = "\"%exe\" \"%options\" -o \"%wavfile\" \"%text\"" | ||
473 | edit = false | ||
474 | os = all | ||
475 | needslanguagecfg = false | ||
476 | |||
477 | [ttspreset08] | ||
478 | tts = "swift" | ||
479 | options = "" | ||
480 | template = "\"%exe\" \"%options\" -o \"%wavfile\" \"%text\"" | ||
481 | edit = true | ||
482 | os = all | ||
483 | needslanguagecfg = false | ||
484 | 477 | ||
485 | 478 | ||
diff --git a/rbutil/rbutilqt/rbutilqt.cpp b/rbutil/rbutilqt/rbutilqt.cpp index 7d0a887849..a28defc413 100644 --- a/rbutil/rbutilqt/rbutilqt.cpp +++ b/rbutil/rbutilqt/rbutilqt.cpp | |||
@@ -26,6 +26,7 @@ | |||
26 | #include "configure.h" | 26 | #include "configure.h" |
27 | #include "install.h" | 27 | #include "install.h" |
28 | #include "installtalkwindow.h" | 28 | #include "installtalkwindow.h" |
29 | #include "createvoicewindow.h" | ||
29 | #include "httpget.h" | 30 | #include "httpget.h" |
30 | #include "installbootloader.h" | 31 | #include "installbootloader.h" |
31 | #include "installthemes.h" | 32 | #include "installthemes.h" |
@@ -89,6 +90,7 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent) | |||
89 | connect(ui.buttonFonts, SIGNAL(clicked()), this, SLOT(installFontsBtn())); | 90 | connect(ui.buttonFonts, SIGNAL(clicked()), this, SLOT(installFontsBtn())); |
90 | connect(ui.buttonGames, SIGNAL(clicked()), this, SLOT(installDoomBtn())); | 91 | connect(ui.buttonGames, SIGNAL(clicked()), this, SLOT(installDoomBtn())); |
91 | connect(ui.buttonTalk, SIGNAL(clicked()), this, SLOT(createTalkFiles())); | 92 | connect(ui.buttonTalk, SIGNAL(clicked()), this, SLOT(createTalkFiles())); |
93 | connect(ui.buttonCreateVoice, SIGNAL(clicked()), this, SLOT(createVoiceFile())); | ||
92 | connect(ui.buttonVoice, SIGNAL(clicked()), this, SLOT(installVoice())); | 94 | connect(ui.buttonVoice, SIGNAL(clicked()), this, SLOT(installVoice())); |
93 | connect(ui.buttonThemes, SIGNAL(clicked()), this, SLOT(installThemes())); | 95 | connect(ui.buttonThemes, SIGNAL(clicked()), this, SLOT(installThemes())); |
94 | connect(ui.buttonRemoveRockbox, SIGNAL(clicked()), this, SLOT(uninstall())); | 96 | connect(ui.buttonRemoveRockbox, SIGNAL(clicked()), this, SLOT(uninstall())); |
@@ -106,6 +108,7 @@ RbUtilQt::RbUtilQt(QWidget *parent) : QMainWindow(parent) | |||
106 | connect(ui.actionInstall_Themes, SIGNAL(triggered()), this, SLOT(installThemes())); | 108 | connect(ui.actionInstall_Themes, SIGNAL(triggered()), this, SLOT(installThemes())); |
107 | connect(ui.actionInstall_Game_Files, SIGNAL(triggered()), this, SLOT(installDoomBtn())); | 109 | connect(ui.actionInstall_Game_Files, SIGNAL(triggered()), this, SLOT(installDoomBtn())); |
108 | connect(ui.actionInstall_Voice_File, SIGNAL(triggered()), this, SLOT(installVoice())); | 110 | connect(ui.actionInstall_Voice_File, SIGNAL(triggered()), this, SLOT(installVoice())); |
111 | connect(ui.actionCreate_Voice_File, SIGNAL(triggered()), this, SLOT(createVoiceFile())); | ||
109 | connect(ui.actionCreate_Talk_Files, SIGNAL(triggered()), this, SLOT(createTalkFiles())); | 112 | connect(ui.actionCreate_Talk_Files, SIGNAL(triggered()), this, SLOT(createTalkFiles())); |
110 | connect(ui.actionRemove_bootloader, SIGNAL(triggered()), this, SLOT(uninstallBootloader())); | 113 | connect(ui.actionRemove_bootloader, SIGNAL(triggered()), this, SLOT(uninstallBootloader())); |
111 | connect(ui.actionUninstall_Rockbox, SIGNAL(triggered()), this, SLOT(uninstall())); | 114 | connect(ui.actionUninstall_Rockbox, SIGNAL(triggered()), this, SLOT(uninstall())); |
@@ -753,6 +756,19 @@ void RbUtilQt::createTalkFiles(void) | |||
753 | 756 | ||
754 | } | 757 | } |
755 | 758 | ||
759 | void RbUtilQt::createVoiceFile(void) | ||
760 | { | ||
761 | if(chkConfig(true)) return; | ||
762 | CreateVoiceWindow *installWindow = new CreateVoiceWindow(this); | ||
763 | installWindow->setUserSettings(userSettings); | ||
764 | installWindow->setDeviceSettings(devices); | ||
765 | installWindow->setProxy(proxy()); | ||
766 | |||
767 | installWindow->show(); | ||
768 | connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(downloadInfo())); | ||
769 | connect(installWindow, SIGNAL(settingsUpdated()), this, SLOT(updateSettings())); | ||
770 | } | ||
771 | |||
756 | void RbUtilQt::uninstall(void) | 772 | void RbUtilQt::uninstall(void) |
757 | { | 773 | { |
758 | if(chkConfig(true)) return; | 774 | if(chkConfig(true)) return; |
diff --git a/rbutil/rbutilqt/rbutilqt.h b/rbutil/rbutilqt/rbutilqt.h index f656caf451..f030d69f3c 100644 --- a/rbutil/rbutilqt/rbutilqt.h +++ b/rbutil/rbutilqt/rbutilqt.h | |||
@@ -91,6 +91,7 @@ class RbUtilQt : public QMainWindow | |||
91 | void installDoom(void); | 91 | void installDoom(void); |
92 | 92 | ||
93 | void createTalkFiles(void); | 93 | void createTalkFiles(void); |
94 | void createVoiceFile(void); | ||
94 | void downloadDone(bool); | 95 | void downloadDone(bool); |
95 | void downloadDone(int, bool); | 96 | void downloadDone(int, bool); |
96 | void downloadBleedingDone(bool); | 97 | void downloadBleedingDone(bool); |
diff --git a/rbutil/rbutilqt/rbutilqt.pro b/rbutil/rbutilqt/rbutilqt.pro index b240770c33..fe95a4c665 100644 --- a/rbutil/rbutilqt/rbutilqt.pro +++ b/rbutil/rbutilqt/rbutilqt.pro | |||
@@ -42,8 +42,12 @@ SOURCES += rbutilqt.cpp \ | |||
42 | browseof.cpp \ | 42 | browseof.cpp \ |
43 | preview.cpp \ | 43 | preview.cpp \ |
44 | encoders.cpp \ | 44 | encoders.cpp \ |
45 | tts.cpp | 45 | tts.cpp \ |
46 | 46 | ../../tools/wavtrim.c \ | |
47 | ../../tools/voicefont.c \ | ||
48 | voicefile.cpp \ | ||
49 | createvoicewindow.cpp | ||
50 | |||
47 | HEADERS += rbutilqt.h \ | 51 | HEADERS += rbutilqt.h \ |
48 | install.h \ | 52 | install.h \ |
49 | httpget.h \ | 53 | httpget.h \ |
@@ -80,10 +84,14 @@ HEADERS += rbutilqt.h \ | |||
80 | browseof.h \ | 84 | browseof.h \ |
81 | preview.h \ | 85 | preview.h \ |
82 | encoders.h \ | 86 | encoders.h \ |
83 | tts.h | 87 | tts.h \ |
88 | ../../tools/wavtrim.h \ | ||
89 | ../../tools/voicefont.h \ | ||
90 | voicefile.h \ | ||
91 | createvoicewindow.h | ||
84 | 92 | ||
85 | # Needed by QT on Win | 93 | # Needed by QT on Win |
86 | INCLUDEPATH = . irivertools zip zlib ../ipodpatcher ../sansapatcher ../../tools/rbspeex | 94 | INCLUDEPATH = . irivertools zip zlib ../ipodpatcher ../sansapatcher ../../tools/rbspeex ../../tools |
87 | 95 | ||
88 | LIBS += -L../../tools/rbspeex -lrbspeex | 96 | LIBS += -L../../tools/rbspeex -lrbspeex |
89 | 97 | ||
@@ -115,7 +123,8 @@ FORMS += rbutilqtfrm.ui \ | |||
115 | rbspeexcfgfrm.ui \ | 123 | rbspeexcfgfrm.ui \ |
116 | encexescfgfrm.ui \ | 124 | encexescfgfrm.ui \ |
117 | ttsexescfgfrm.ui \ | 125 | ttsexescfgfrm.ui \ |
118 | sapicfgfrm.ui | 126 | sapicfgfrm.ui \ |
127 | createvoicefrm.ui | ||
119 | 128 | ||
120 | RESOURCES += rbutilqt.qrc | 129 | RESOURCES += rbutilqt.qrc |
121 | win32 { | 130 | win32 { |
diff --git a/rbutil/rbutilqt/rbutilqt.qrc b/rbutil/rbutilqt/rbutilqt.qrc index 0e571d6585..71e4c93d19 100644 --- a/rbutil/rbutilqt/rbutilqt.qrc +++ b/rbutil/rbutilqt/rbutilqt.qrc | |||
@@ -3,6 +3,9 @@ | |||
3 | <file>CREDITS</file> | 3 | <file>CREDITS</file> |
4 | <file>gpl-2.0.html</file> | 4 | <file>gpl-2.0.html</file> |
5 | </qresource> | 5 | </qresource> |
6 | <qresource> | ||
7 | <file alias="builtin/VOICE_PAUSE.wav">../../tools/VOICE_PAUSE.wav</file> | ||
8 | </qresource> | ||
6 | <qresource prefix="/icons" > | 9 | <qresource prefix="/icons" > |
7 | <file>icons/audio-input-microphone.png</file> | 10 | <file>icons/audio-input-microphone.png</file> |
8 | <file>icons/bootloader_btn.png</file> | 11 | <file>icons/bootloader_btn.png</file> |
diff --git a/rbutil/rbutilqt/rbutilqtfrm.ui b/rbutil/rbutilqt/rbutilqtfrm.ui index fe929db54d..2eec1be54c 100644 --- a/rbutil/rbutilqt/rbutilqtfrm.ui +++ b/rbutil/rbutilqt/rbutilqtfrm.ui | |||
@@ -490,16 +490,16 @@ p, li { white-space: pre-wrap; } | |||
490 | <property name="text" > | 490 | <property name="text" > |
491 | <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> | 491 | <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> |
492 | p, li { white-space: pre-wrap; } | 492 | p, li { white-space: pre-wrap; } |
493 | </style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> | 493 | </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> |
494 | <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Install Voice file</span></p> | 494 | <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"><span style=" font-weight:600;">Install Voice file</span></p> |
495 | <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Voice files are needed to make Rockbox speak the user interface. Speaking is enabled by default, so if you installed the voice file Rockbox will speak.</p></body></html></string> | 495 | <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">Voice files are needed to make Rockbox speak the user interface. Speaking is enabled by default, so if you installed the voice file Rockbox will speak.</p></body></html></string> |
496 | </property> | 496 | </property> |
497 | <property name="wordWrap" > | 497 | <property name="wordWrap" > |
498 | <bool>true</bool> | 498 | <bool>true</bool> |
499 | </property> | 499 | </property> |
500 | </widget> | 500 | </widget> |
501 | </item> | 501 | </item> |
502 | <item row="1" column="0" > | 502 | <item row="2" column="0" > |
503 | <widget class="QToolButton" name="buttonTalk" > | 503 | <widget class="QToolButton" name="buttonTalk" > |
504 | <property name="text" > | 504 | <property name="text" > |
505 | <string>Install Talk files</string> | 505 | <string>Install Talk files</string> |
@@ -515,7 +515,7 @@ p, li { white-space: pre-wrap; } | |||
515 | </property> | 515 | </property> |
516 | </widget> | 516 | </widget> |
517 | </item> | 517 | </item> |
518 | <item row="1" column="1" > | 518 | <item row="2" column="1" > |
519 | <widget class="QLabel" name="labelTalk" > | 519 | <widget class="QLabel" name="labelTalk" > |
520 | <property name="text" > | 520 | <property name="text" > |
521 | <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> | 521 | <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> |
@@ -526,7 +526,7 @@ p, li { white-space: pre-wrap; } | |||
526 | </property> | 526 | </property> |
527 | </widget> | 527 | </widget> |
528 | </item> | 528 | </item> |
529 | <item row="2" column="0" > | 529 | <item row="3" column="0" > |
530 | <spacer> | 530 | <spacer> |
531 | <property name="orientation" > | 531 | <property name="orientation" > |
532 | <enum>Qt::Vertical</enum> | 532 | <enum>Qt::Vertical</enum> |
@@ -539,7 +539,7 @@ p, li { white-space: pre-wrap; } | |||
539 | </property> | 539 | </property> |
540 | </spacer> | 540 | </spacer> |
541 | </item> | 541 | </item> |
542 | <item row="2" column="1" > | 542 | <item row="3" column="1" > |
543 | <spacer> | 543 | <spacer> |
544 | <property name="orientation" > | 544 | <property name="orientation" > |
545 | <enum>Qt::Vertical</enum> | 545 | <enum>Qt::Vertical</enum> |
@@ -552,6 +552,34 @@ p, li { white-space: pre-wrap; } | |||
552 | </property> | 552 | </property> |
553 | </spacer> | 553 | </spacer> |
554 | </item> | 554 | </item> |
555 | <item row="1" column="0" > | ||
556 | <widget class="QToolButton" name="buttonCreateVoice" > | ||
557 | <property name="text" > | ||
558 | <string>Install Voice files</string> | ||
559 | </property> | ||
560 | <property name="icon" > | ||
561 | <iconset resource="rbutilqt.qrc" >:/icons/icons/talkfile_btn.png</iconset> | ||
562 | </property> | ||
563 | <property name="iconSize" > | ||
564 | <size> | ||
565 | <width>56</width> | ||
566 | <height>46</height> | ||
567 | </size> | ||
568 | </property> | ||
569 | </widget> | ||
570 | </item> | ||
571 | <item row="1" column="1" > | ||
572 | <widget class="QLabel" name="labelCreateVoice" > | ||
573 | <property name="text" > | ||
574 | <string><html><head><meta name="qrichtext" content="1" /><style type="text/css"> | ||
575 | p, li { white-space: pre-wrap; } | ||
576 | </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> | ||
577 | <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"><span style=" font-size:9pt; font-weight:600;">Create Voice file</span></p> | ||
578 | <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;">Voice files are needed to make Rockbox speak the user interface. Speaking is enabled by default, so</p> | ||
579 | <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-size:9pt;"> if you installed the voice file Rockbox will speak.</p></body></html></string> | ||
580 | </property> | ||
581 | </widget> | ||
582 | </item> | ||
555 | </layout> | 583 | </layout> |
556 | </widget> | 584 | </widget> |
557 | <widget class="QWidget" name="uninstall" > | 585 | <widget class="QWidget" name="uninstall" > |
@@ -801,7 +829,7 @@ p, li { white-space: pre-wrap; } | |||
801 | <x>0</x> | 829 | <x>0</x> |
802 | <y>0</y> | 830 | <y>0</y> |
803 | <width>662</width> | 831 | <width>662</width> |
804 | <height>29</height> | 832 | <height>21</height> |
805 | </rect> | 833 | </rect> |
806 | </property> | 834 | </property> |
807 | <widget class="QMenu" name="menu_File" > | 835 | <widget class="QMenu" name="menu_File" > |
@@ -853,6 +881,7 @@ p, li { white-space: pre-wrap; } | |||
853 | <string>Accessibility</string> | 881 | <string>Accessibility</string> |
854 | </property> | 882 | </property> |
855 | <addaction name="actionInstall_Voice_File" /> | 883 | <addaction name="actionInstall_Voice_File" /> |
884 | <addaction name="actionCreate_Voice_File" /> | ||
856 | <addaction name="actionCreate_Talk_Files" /> | 885 | <addaction name="actionCreate_Talk_Files" /> |
857 | </widget> | 886 | </widget> |
858 | <widget class="QMenu" name="menuUninstallation" > | 887 | <widget class="QMenu" name="menuUninstallation" > |
@@ -1024,6 +1053,18 @@ p, li { white-space: pre-wrap; } | |||
1024 | <string>Download HTML manual (zip)</string> | 1053 | <string>Download HTML manual (zip)</string> |
1025 | </property> | 1054 | </property> |
1026 | </action> | 1055 | </action> |
1056 | <action name="actionCreate_Voice_File" > | ||
1057 | <property name="icon" > | ||
1058 | <iconset resource="rbutilqt.qrc" >:/icons/icons/talkfile_btn.png</iconset> | ||
1059 | </property> | ||
1060 | <property name="text" > | ||
1061 | <string>Create Voice File</string> | ||
1062 | </property> | ||
1063 | <property name="iconText" > | ||
1064 | <string>Create Voic<resource type="image" qrc="C:/cygwin/home/Domonoky/rockbox-svn/rockbox-rbspeex/rbutil/rbutilqt/rbutilqt.qrc" file=":/icons/icons/talkfile_btn.png" /> | ||
1065 | e File</string> | ||
1066 | </property> | ||
1067 | </action> | ||
1027 | </widget> | 1068 | </widget> |
1028 | <tabstops> | 1069 | <tabstops> |
1029 | <tabstop>tabWidget</tabstop> | 1070 | <tabstop>tabWidget</tabstop> |
diff --git a/rbutil/rbutilqt/tts.cpp b/rbutil/rbutilqt/tts.cpp index aa5f661fcb..b7c89ecbe9 100644 --- a/rbutil/rbutilqt/tts.cpp +++ b/rbutil/rbutilqt/tts.cpp | |||
@@ -284,7 +284,7 @@ bool TTSSapi::voice(QString text,QString wavfile) | |||
284 | { | 284 | { |
285 | QString query = "SPEAK\t"+wavfile+"\t"+text+"\r\n"; | 285 | QString query = "SPEAK\t"+wavfile+"\t"+text+"\r\n"; |
286 | qDebug() << "voicing" << query; | 286 | qDebug() << "voicing" << query; |
287 | voicescript->write(query.toLocal8Bit()); | 287 | voicescript->write(query.toUtf8()); |
288 | voicescript->write("SYNC\tbla\r\n"); | 288 | voicescript->write("SYNC\tbla\r\n"); |
289 | voicescript->waitForReadyRead(); | 289 | voicescript->waitForReadyRead(); |
290 | return true; | 290 | return true; |
@@ -293,7 +293,7 @@ bool TTSSapi::voice(QString text,QString wavfile) | |||
293 | bool TTSSapi::stop() | 293 | bool TTSSapi::stop() |
294 | { | 294 | { |
295 | QString query = "QUIT\r\n"; | 295 | QString query = "QUIT\r\n"; |
296 | voicescript->write(query.toLocal8Bit()); | 296 | voicescript->write(query.toUtf8()); |
297 | voicescript->waitForFinished(); | 297 | voicescript->waitForFinished(); |
298 | delete voicescript; | 298 | delete voicescript; |
299 | return true; | 299 | return true; |
diff --git a/rbutil/rbutilqt/voicefile.cpp b/rbutil/rbutilqt/voicefile.cpp new file mode 100644 index 0000000000..9390fa2fe9 --- /dev/null +++ b/rbutil/rbutilqt/voicefile.cpp | |||
@@ -0,0 +1,275 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2007 by Dominik Wenger | ||
10 | * $Id: voicefile.h 15932 2007-12-15 13:13:57Z domonoky $ | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | #include "voicefile.h" | ||
21 | |||
22 | #define STATE_INVALID 0 | ||
23 | #define STATE_PHRASE 1 | ||
24 | #define STATE_VOICE 2 | ||
25 | |||
26 | |||
27 | VoiceFileCreator::VoiceFileCreator(QObject* parent) :QObject(parent) | ||
28 | { | ||
29 | |||
30 | } | ||
31 | |||
32 | void VoiceFileCreator::abort() | ||
33 | { | ||
34 | m_abort = true; | ||
35 | } | ||
36 | |||
37 | bool VoiceFileCreator::createVoiceFile(ProgressloggerInterface* logger) | ||
38 | { | ||
39 | m_abort = false; | ||
40 | m_logger = logger; | ||
41 | m_logger->addItem("Starting Voicefile generation",LOGINFO); | ||
42 | |||
43 | // test if tempdir exists | ||
44 | if(!QDir(QDir::tempPath()+"/rbvoice/").exists()) | ||
45 | { | ||
46 | QDir(QDir::tempPath()).mkdir("rbvoice"); | ||
47 | } | ||
48 | |||
49 | m_path = QDir::tempPath() + "/rbvoice/"; | ||
50 | |||
51 | // read rockbox-info.txt | ||
52 | QFile info(m_mountpoint+"/.rockbox/rockbox-info.txt"); | ||
53 | if(!info.open(QIODevice::ReadOnly)) | ||
54 | { | ||
55 | m_logger->addItem("failed to open rockbox-info.txt",LOGERROR); | ||
56 | return false; | ||
57 | } | ||
58 | |||
59 | QString target, features,version; | ||
60 | while (!info.atEnd()) { | ||
61 | QString line = info.readLine(); | ||
62 | |||
63 | if(line.contains("Target:")) | ||
64 | { | ||
65 | target = line.remove("Target:").trimmed(); | ||
66 | } | ||
67 | else if(line.contains("Features:")) | ||
68 | { | ||
69 | features = line.remove("Features:").trimmed(); | ||
70 | } | ||
71 | else if(line.contains("Version:")) | ||
72 | { | ||
73 | version = line.remove("Version:").trimmed(); | ||
74 | version = version.left(version.indexOf("-")).remove(0,1); | ||
75 | } | ||
76 | } | ||
77 | info.close(); | ||
78 | |||
79 | //prepare download url | ||
80 | QUrl genlangUrl = deviceSettings->value("genlang_url").toString() +"?lang=" +m_lang+"&t="+target+"&rev="+version+"&f="+features; | ||
81 | |||
82 | qDebug() << "downloading " << genlangUrl; | ||
83 | |||
84 | //download the correct genlang output | ||
85 | QTemporaryFile *downloadFile = new QTemporaryFile(this); | ||
86 | downloadFile->open(); | ||
87 | filename = downloadFile->fileName(); | ||
88 | downloadFile->close(); | ||
89 | // get the real file. | ||
90 | getter = new HttpGet(this); | ||
91 | getter->setProxy(m_proxy); | ||
92 | getter->setFile(downloadFile); | ||
93 | getter->getFile(genlangUrl); | ||
94 | |||
95 | connect(getter, SIGNAL(done(bool)), this, SLOT(downloadDone(bool))); | ||
96 | connect(getter, SIGNAL(downloadDone(int, bool)), this, SLOT(downloadRequestFinished(int, bool))); | ||
97 | connect(getter, SIGNAL(dataReadProgress(int, int)), this, SLOT(updateDataReadProgress(int, int))); | ||
98 | connect(m_logger, SIGNAL(aborted()), getter, SLOT(abort())); | ||
99 | return true; | ||
100 | } | ||
101 | |||
102 | |||
103 | void VoiceFileCreator::downloadRequestFinished(int id, bool error) | ||
104 | { | ||
105 | qDebug() << "Install::downloadRequestFinished" << id << error; | ||
106 | qDebug() << "error:" << getter->errorString(); | ||
107 | |||
108 | downloadDone(error); | ||
109 | } | ||
110 | |||
111 | |||
112 | void VoiceFileCreator::downloadDone(bool error) | ||
113 | { | ||
114 | qDebug() << "Voice creator::downloadDone, error:" << error; | ||
115 | |||
116 | // update progress bar | ||
117 | int max = m_logger->getProgressMax(); | ||
118 | if(max == 0) { | ||
119 | max = 100; | ||
120 | m_logger->setProgressMax(max); | ||
121 | } | ||
122 | m_logger->setProgressValue(max); | ||
123 | if(getter->httpResponse() != 200 && !getter->isCached()) { | ||
124 | m_logger->addItem(tr("Download error: received HTTP error %1.").arg(getter->httpResponse()),LOGERROR); | ||
125 | m_logger->abort(); | ||
126 | return; | ||
127 | } | ||
128 | if(getter->isCached()) m_logger->addItem(tr("Cached file used."), LOGINFO); | ||
129 | if(error) { | ||
130 | m_logger->addItem(tr("Download error: %1").arg(getter->errorString()),LOGERROR); | ||
131 | m_logger->abort(); | ||
132 | return; | ||
133 | } | ||
134 | else m_logger->addItem(tr("Download finished."),LOGOK); | ||
135 | QApplication::processEvents(); | ||
136 | |||
137 | |||
138 | m_logger->setProgressMax(0); | ||
139 | //open downloaded file | ||
140 | QFile genlang(filename); | ||
141 | if(!genlang.open(QIODevice::ReadOnly)) | ||
142 | { | ||
143 | m_logger->addItem("failed to open downloaded file",LOGERROR); | ||
144 | m_logger->abort(); | ||
145 | return; | ||
146 | } | ||
147 | |||
148 | //tts | ||
149 | m_tts = getTTS(userSettings->value("tts").toString()); | ||
150 | m_tts->setUserCfg(userSettings); | ||
151 | |||
152 | if(!m_tts->start()) | ||
153 | { | ||
154 | m_logger->addItem("Init of TTS engine failed",LOGERROR); | ||
155 | m_logger->abort(); | ||
156 | return; | ||
157 | } | ||
158 | |||
159 | // Encoder | ||
160 | m_enc = getEncoder(userSettings->value("encoder").toString()); | ||
161 | m_enc->setUserCfg(userSettings); | ||
162 | |||
163 | if(!m_enc->start()) | ||
164 | { | ||
165 | m_logger->addItem("Init of Encoder engine failed",LOGERROR); | ||
166 | m_tts->stop(); | ||
167 | m_logger->abort(); | ||
168 | return; | ||
169 | } | ||
170 | |||
171 | QApplication::processEvents(); | ||
172 | |||
173 | connect(m_logger,SIGNAL(aborted()),this,SLOT(abort())); | ||
174 | QStringList mp3files; | ||
175 | |||
176 | QTextStream in(&genlang); | ||
177 | in.setCodec("UTF-8"); | ||
178 | |||
179 | bool emptyfile = true; | ||
180 | while (!in.atEnd()) | ||
181 | { | ||
182 | if(m_abort) | ||
183 | { | ||
184 | m_logger->addItem("aborted.",LOGERROR); | ||
185 | break; | ||
186 | } | ||
187 | |||
188 | QString comment = in.readLine(); | ||
189 | QString id = in.readLine(); | ||
190 | QString voice = in.readLine(); | ||
191 | |||
192 | id = id.remove("id:").remove('"').trimmed(); | ||
193 | voice = voice.remove("voice:").remove('"').trimmed(); | ||
194 | |||
195 | QString wavname = m_path + "/" + id + ".wav"; | ||
196 | QString toSpeak = voice; | ||
197 | QString encodedname = m_path + "/" + id +".mp3"; | ||
198 | |||
199 | // todo PAUSE | ||
200 | if(id == "VOICE_PAUSE") | ||
201 | { | ||
202 | QFile::copy(":/builtin/builtin/VOICE_PAUSE.wav",m_path + "/VOICE_PAUSE.wav"); | ||
203 | |||
204 | } | ||
205 | else | ||
206 | { | ||
207 | if(voice == "") continue; | ||
208 | |||
209 | m_logger->addItem(tr("creating ")+toSpeak,LOGINFO); | ||
210 | QApplication::processEvents(); | ||
211 | m_tts->voice(toSpeak,wavname); // generate wav | ||
212 | } | ||
213 | |||
214 | // todo strip | ||
215 | char buffer[255]; | ||
216 | |||
217 | wavtrim((char*)qPrintable(wavname),500,buffer,255); | ||
218 | |||
219 | // encode wav | ||
220 | m_enc->encode(wavname,encodedname); | ||
221 | // remove the wav file | ||
222 | QFile::remove(wavname); | ||
223 | // remember the mp3 file for later removing | ||
224 | mp3files << encodedname; | ||
225 | // remember that we have done something | ||
226 | emptyfile = false; | ||
227 | |||
228 | } | ||
229 | genlang.close(); | ||
230 | |||
231 | if(emptyfile) | ||
232 | { | ||
233 | m_logger->addItem(tr("The downloaded file was empty!"),LOGERROR); | ||
234 | m_logger->abort(); | ||
235 | return; | ||
236 | } | ||
237 | |||
238 | //make voicefile | ||
239 | FILE* ids2 = fopen(filename.toUtf8(), "r"); | ||
240 | if (ids2 == NULL) | ||
241 | { | ||
242 | m_logger->addItem("Error opening downloaded file",LOGERROR); | ||
243 | m_logger->abort(); | ||
244 | return; | ||
245 | } | ||
246 | |||
247 | FILE* output = fopen(QString(m_mountpoint + "/.rockbox/langs/" + m_lang + ".voice").toUtf8(), "wb"); | ||
248 | if (output == NULL) | ||
249 | { | ||
250 | m_logger->addItem("Error opening output file",LOGERROR); | ||
251 | return; | ||
252 | } | ||
253 | |||
254 | voicefont(ids2,m_targetid,(char*)(const char*)m_path.toUtf8(), output); | ||
255 | |||
256 | //remove .mp3 files | ||
257 | for(int i=0;i< mp3files.size(); i++) | ||
258 | { | ||
259 | QFile::remove(mp3files.at(i)); | ||
260 | } | ||
261 | |||
262 | m_logger->setProgressMax(100); | ||
263 | m_logger->setProgressValue(100); | ||
264 | m_logger->addItem("successfully created.",LOGOK); | ||
265 | m_logger->abort(); | ||
266 | } | ||
267 | |||
268 | void VoiceFileCreator::updateDataReadProgress(int read, int total) | ||
269 | { | ||
270 | m_logger->setProgressMax(total); | ||
271 | m_logger->setProgressValue(read); | ||
272 | //qDebug() << "progress:" << read << "/" << total; | ||
273 | |||
274 | } | ||
275 | |||
diff --git a/rbutil/rbutilqt/voicefile.h b/rbutil/rbutilqt/voicefile.h new file mode 100644 index 0000000000..b82f0373c7 --- /dev/null +++ b/rbutil/rbutilqt/voicefile.h | |||
@@ -0,0 +1,84 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * | ||
9 | * Copyright (C) 2007 by Dominik Wenger | ||
10 | * $Id: voicefile.h 15932 2007-12-15 13:13:57Z domonoky $ | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | |||
20 | |||
21 | #ifndef VOICEFILE_H | ||
22 | #define VOICEFILE_H | ||
23 | |||
24 | #include <QtGui> | ||
25 | #include "progressloggerinterface.h" | ||
26 | |||
27 | #include "encoders.h" | ||
28 | #include "tts.h" | ||
29 | #include "httpget.h" | ||
30 | |||
31 | extern "C" | ||
32 | { | ||
33 | #include "wavtrim.h" | ||
34 | #include "voicefont.h" | ||
35 | } | ||
36 | |||
37 | class VoiceFileCreator :public QObject | ||
38 | { | ||
39 | Q_OBJECT | ||
40 | public: | ||
41 | VoiceFileCreator(QObject* parent=0); | ||
42 | |||
43 | //start creation | ||
44 | bool createVoiceFile(ProgressloggerInterface* logger); | ||
45 | |||
46 | // set infos | ||
47 | void setUserSettings(QSettings* setting) { userSettings = setting;} | ||
48 | void setDeviceSettings(QSettings* setting) { deviceSettings = setting;} | ||
49 | |||
50 | void setMountPoint(QString mountpoint) {m_mountpoint =mountpoint; } | ||
51 | void setTargetId(int id){m_targetid = id;} | ||
52 | void setLang(QString name){m_lang =name;} | ||
53 | void setProxy(QUrl proxy){m_proxy = proxy;} | ||
54 | |||
55 | private slots: | ||
56 | void abort(); | ||
57 | void downloadRequestFinished(int id, bool error); | ||
58 | void downloadDone(bool error); | ||
59 | void updateDataReadProgress(int read, int total); | ||
60 | |||
61 | private: | ||
62 | |||
63 | // ptr to encoder, tts and settings | ||
64 | TTSBase* m_tts; | ||
65 | EncBase* m_enc; | ||
66 | QSettings *userSettings; | ||
67 | QSettings *deviceSettings; | ||
68 | |||
69 | HttpGet *getter; | ||
70 | |||
71 | QUrl m_proxy; //proxy | ||
72 | QString filename; //the temporary file | ||
73 | |||
74 | QString m_mountpoint; //mountpoint of the device | ||
75 | QString m_path; //path where the wav and mp3 files are stored to | ||
76 | int m_targetid; //the target id | ||
77 | QString m_lang; // the language which will be spoken | ||
78 | |||
79 | ProgressloggerInterface* m_logger; | ||
80 | |||
81 | bool m_abort; | ||
82 | }; | ||
83 | |||
84 | #endif | ||