リビジョン | 1974 (tree) |
---|---|
日時 | 2012-01-26 06:14:19 |
作者 | ![]() |
[stand2.0/StandConverter] TranscriberWindow::表示を適正なものに変更.
@@ -38,6 +38,11 @@ | ||
38 | 38 | delete ui; |
39 | 39 | } |
40 | 40 | |
41 | +void TranscriberWidget::settingChanged() | |
42 | +{ | |
43 | + emit changed(this); | |
44 | +} | |
45 | + | |
41 | 46 | QString TranscriberWidget::dir() |
42 | 47 | { |
43 | 48 | return ui->DirectoryName->text(); |
@@ -67,3 +72,8 @@ | ||
67 | 72 | { |
68 | 73 | return QTextCodec::codecForName(ui->EncodeComboBox->currentText().toLocal8Bit().data()); |
69 | 74 | } |
75 | + | |
76 | +QString TranscriberWidget::colorName() | |
77 | +{ | |
78 | + return ui->ColorSelector->currentText(); | |
79 | +} |
@@ -3,10 +3,20 @@ | ||
3 | 3 | #include <QPaintEvent> |
4 | 4 | #include <QPainter> |
5 | 5 | |
6 | +#include <math.h> | |
7 | + | |
6 | 8 | using namespace stand::gui; |
7 | 9 | |
8 | 10 | const int MappingView::_MAPPING_SIZE = 128; |
9 | 11 | |
12 | +// min, max macro | |
13 | +#ifndef min | |
14 | +#define min(a,b) (((a)<(b))?(a):(b)) | |
15 | +#endif | |
16 | +#ifndef max | |
17 | +#define max(a,b) (((a)<(b))?(b):(a)) | |
18 | +#endif | |
19 | + | |
10 | 20 | MappingView::MappingView(QWidget *parent) : |
11 | 21 | QWidget(parent) |
12 | 22 | { |
@@ -54,17 +64,111 @@ | ||
54 | 64 | p.drawLine(x, y, x + w, y); |
55 | 65 | } |
56 | 66 | } |
67 | + for(int i = 0; i < _data.size(); i++) | |
68 | + { | |
69 | + int x = _data.at(i).note / (double)_MAPPING_SIZE * width(); | |
70 | + int w = (1 + _data.at(i).note) / (double)_MAPPING_SIZE * width() - x; | |
71 | + int y = (_MAPPING_SIZE - 1 - _data.at(i).brightness) / (double)_MAPPING_SIZE * height(); | |
72 | + int h = (1 + _MAPPING_SIZE - 1 - _data.at(i).brightness) / (double)_MAPPING_SIZE * height() - y; | |
73 | + p.setPen(Qt::white); | |
74 | + p.drawLine(x, y, x, y + h); | |
75 | + p.drawLine(x, y, x + w, y); | |
76 | + p.drawLine(x, y + h, x + w, y + h); | |
77 | + p.drawLine(x + w, y, x + w, y + h); | |
78 | + } | |
57 | 79 | } |
58 | 80 | |
59 | -void MappingView::setMapping(QVector<Map> &mapping) | |
81 | +void MappingView::setMapping(QVector<stand::gui::MappingView::Map> &mapping) | |
60 | 82 | { |
61 | 83 | _data = mapping; |
62 | - for(unsigned int i = 0; i < mapping.size(); i++) | |
84 | + unsigned int i; | |
85 | + for(i = 0; i < _data.size(); i++) | |
63 | 86 | { |
87 | + Map m = _data.at(i), tmp; | |
88 | + int index = i; | |
89 | + for(int j = i + 1; j < _data.size(); j++) | |
90 | + { | |
91 | + if(m.brightness > _data.at(j).brightness) | |
92 | + { | |
93 | + m = _data.at(j); | |
94 | + index = j; | |
95 | + } | |
96 | + } | |
97 | + tmp = _data.at(i); | |
98 | + _data.replace(i, m); | |
99 | + _data.replace(index, tmp); | |
100 | + } | |
101 | + | |
102 | + int r = _data.at(0).color.red(); | |
103 | + int g = _data.at(0).color.green(); | |
104 | + int b = _data.at(0).color.blue(); | |
105 | + for(i = 0; i <= _data.at(0).brightness; i++) | |
106 | + { | |
107 | + int y = 127 - i; | |
108 | + | |
109 | + for(int j = 0; j < _MAPPING_SIZE; j++) | |
110 | + { | |
111 | + _map[j][y].r = r; | |
112 | + _map[j][y].g = g; | |
113 | + _map[j][y].b = b; | |
114 | + } | |
115 | + } | |
116 | + for(int index = 1; index < _data.size(); index++) | |
117 | + { | |
118 | + int pbri = _data.at(index - 1).brightness; | |
119 | + int bri = _data.at(index).brightness; | |
120 | + for(; i <= (bri + pbri) / 2 && i < _MAPPING_SIZE; i++) | |
121 | + { | |
122 | + int y = 127 - i; | |
123 | + int c = (1 + i - pbri) * 2; | |
124 | + int d = bri - pbri; | |
125 | + int cr = r + _data.at(index).color.red() * log((double)c) / log((double)d); | |
126 | + int cg = g + _data.at(index).color.green() * log((double)c) / log((double)d); | |
127 | + int cb = b + _data.at(index).color.blue() * log((double)c) / log((double)d); | |
128 | + for(int j = 0; j < _MAPPING_SIZE; j++) | |
129 | + { | |
130 | + _map[j][y].r = min(255, cr); | |
131 | + _map[j][y].g = min(255, cg); | |
132 | + _map[j][y].b = min(255, cb); | |
133 | + } | |
134 | + } | |
135 | + for(; i < bri && i < _MAPPING_SIZE; i++) | |
136 | + { | |
137 | + int y = 127 - i; | |
138 | + int c = (bri - i) * 2; | |
139 | + int d = bri - pbri; | |
140 | + int cr = r * log((double)c) / log((double)d) + _data.at(index).color.red(); | |
141 | + int cg = g * log((double)c) / log((double)d) + _data.at(index).color.green(); | |
142 | + int cb = b * log((double)c) / log((double)d) + _data.at(index).color.blue(); | |
143 | + for(int j = 0; j < _MAPPING_SIZE; j++) | |
144 | + { | |
145 | + _map[j][y].r = min(255, cr); | |
146 | + _map[j][y].g = min(255, cg); | |
147 | + _map[j][y].b = min(255, cb); | |
148 | + } | |
149 | + } | |
150 | + r = _data.at(index).color.red(); | |
151 | + g = _data.at(index).color.green(); | |
152 | + b = _data.at(index).color.blue(); | |
153 | + } | |
154 | + for(; i < _MAPPING_SIZE; i++) | |
155 | + { | |
156 | + int y = 127 - i; | |
157 | + for(int j = 0; j < _MAPPING_SIZE; j++) | |
158 | + { | |
159 | + _map[j][y].r = _data.last().color.red(); | |
160 | + _map[j][y].g = _data.last().color.green(); | |
161 | + _map[j][y].b = _data.last().color.blue(); | |
162 | + } | |
163 | + } | |
164 | + | |
165 | + for(int i = 0; i < _data.size(); i++) | |
166 | + { | |
64 | 167 | int x = mapping.at(i).note; |
65 | - int y = 127 - mapping.at(i).brightness; | |
66 | - _map[x][y].r = mapping.at(i).color.red(); | |
67 | - _map[x][y].g = mapping.at(i).color.green(); | |
68 | - _map[x][y].b = mapping.at(i).color.blue(); | |
168 | + int y = 127 - _data.at(i).brightness; | |
169 | + _map[x][y].r = _data.at(i).color.red(); | |
170 | + _map[x][y].g = _data.at(i).color.green(); | |
171 | + _map[x][y].b = _data.at(i).color.blue(); | |
69 | 172 | } |
173 | + update(); | |
70 | 174 | } |
@@ -23,18 +23,39 @@ | ||
23 | 23 | ui->SettingTabs->removeTab(0); |
24 | 24 | delete p; |
25 | 25 | } |
26 | - ui->SettingTabs->addTab(new TranscriberWidget(this), tr("Base")); | |
26 | + TranscriberWidget *w = new TranscriberWidget(ui->SettingTabs); | |
27 | + ui->SettingTabs->addTab(w, tr("Base")); | |
27 | 28 | |
29 | + connect(w, SIGNAL(changed(QWidget*)), this, SLOT(settingChanged())); | |
30 | + connect(this, SIGNAL(mappingChanged(QVector<stand::gui::MappingView::Map>&)), ui->MappingView, SLOT(setMapping(QVector<stand::gui::MappingView::Map>&))); | |
31 | + | |
28 | 32 | isAnalyzing = false; |
29 | 33 | current = NULL; |
34 | + settingChanged(); | |
30 | 35 | _setItemEnabled(); |
31 | 36 | } |
32 | 37 | |
33 | 38 | TranscriberWindow::~TranscriberWindow() |
34 | 39 | { |
40 | + disconnect(); | |
35 | 41 | delete ui; |
36 | 42 | } |
37 | 43 | |
44 | +void TranscriberWindow::settingChanged() | |
45 | +{ | |
46 | + QVector<stand::gui::MappingView::Map> mapping; | |
47 | + stand::gui::MappingView::Map m; | |
48 | + for(int i = 0; i < ui->SettingTabs->count(); i++) | |
49 | + { | |
50 | + TranscriberWidget *w = dynamic_cast<TranscriberWidget *>(ui->SettingTabs->widget(i)); | |
51 | + m.brightness = w->bri(); | |
52 | + m.note = w->note(); | |
53 | + m.color = QColor(w->colorName()); | |
54 | + mapping.push_back(m); | |
55 | + } | |
56 | + emit mappingChanged(mapping); | |
57 | +} | |
58 | + | |
38 | 59 | void TranscriberWindow::closeEvent(QCloseEvent *e) |
39 | 60 | { |
40 | 61 | QMessageBox::StandardButton val = QMessageBox::Yes; |
@@ -67,7 +88,11 @@ | ||
67 | 88 | QString num; |
68 | 89 | num.setNum(index); |
69 | 90 | |
70 | - ui->SettingTabs->addTab(new TranscriberWidget(this, index), tr("Opt. ") + num); | |
91 | + TranscriberWidget *w = new TranscriberWidget(ui->SettingTabs, index); | |
92 | + ui->SettingTabs->addTab(w, tr("Opt. ") + num); | |
93 | + connect(w, SIGNAL(changed(QWidget*)), this, SLOT(settingChanged())); | |
94 | + connect(this, SIGNAL(mappingChanged(QVector<stand::gui::MappingView::Map>&)), ui->MappingView, SLOT(setMapping(QVector<stand::gui::MappingView::Map>&))); | |
95 | + settingChanged(); | |
71 | 96 | } |
72 | 97 | |
73 | 98 | void TranscriberWindow::removeTab() |
@@ -88,6 +113,7 @@ | ||
88 | 113 | } |
89 | 114 | QWidget *p = ui->SettingTabs->widget(index); |
90 | 115 | ui->SettingTabs->removeTab(index); |
116 | + settingChanged(); | |
91 | 117 | delete p; |
92 | 118 | } |
93 | 119 |
@@ -129,8 +155,10 @@ | ||
129 | 155 | QMessageBox::critical(this, tr("Error"), tr("Some settings are invalid.")); |
130 | 156 | return; |
131 | 157 | } |
132 | - current = new stand::synthesis::Transcriber(s, this); | |
158 | + ui->ProgressBar->setMaximum(s.base.lib->size()); | |
159 | + current = new stand::synthesis::Transcriber(&s, this); | |
133 | 160 | connect(this, SIGNAL(sendCancelToTranscriber()), current, SLOT(cancel())); |
161 | + connect(current, SIGNAL(progressChanged(int)), ui->ProgressBar, SLOT(setValue(int))); | |
134 | 162 | connect(current, SIGNAL(finish(bool)), SLOT(transcriptionFinished(bool))); |
135 | 163 | |
136 | 164 | current->start(); |
@@ -157,40 +185,63 @@ | ||
157 | 185 | bool TranscriberWindow::_createSetting(stand::synthesis::TranscriberSetting &s) |
158 | 186 | { |
159 | 187 | s.numThreads = ui->NumThreads->value(); |
160 | - s.base = new stand::io::UtauLibrary(); | |
188 | + s.base.lib = new stand::io::UtauLibrary(); | |
161 | 189 | |
162 | 190 | TranscriberWidget *w = dynamic_cast<TranscriberWidget *>(ui->SettingTabs->widget(0)); |
163 | 191 | QString filename = w->dir() + QDir::separator() + "oto.ini"; |
164 | - if(!s.base->readFromOtoIni(filename, w->codec())) | |
192 | + if(!s.base.lib->readFromOtoIni(filename, w->codec())) | |
165 | 193 | { |
166 | 194 | QMessageBox::critical(this, tr("Error"), tr("Base file path is invalid\n") + filename); |
167 | - delete s.base; | |
195 | + delete s.base.lib; | |
168 | 196 | return false; |
169 | 197 | } |
170 | - s.optionals.clear(); | |
198 | + s.base.brightness = w->bri(); | |
199 | + s.base.note = w->note(); | |
171 | 200 | |
172 | 201 | for(int i = 0; i < ui->SettingTabs->count() - 1; i++) |
173 | 202 | { |
203 | + stand::synthesis::Transcriber::TranscriberItem item; | |
174 | 204 | w = dynamic_cast<TranscriberWidget *>(ui->SettingTabs->widget(i + 1)); |
175 | 205 | QString filename = w->dir() + QDir::separator() + "oto.ini"; |
176 | 206 | stand::io::UtauLibrary *lib = new stand::io::UtauLibrary(); |
177 | 207 | if(lib->readFromOtoIni(filename, w->codec())) |
178 | 208 | { |
179 | - s.optionals.push_back(lib); | |
209 | + item.lib = lib; | |
210 | + item.brightness = w->bri(); | |
211 | + item.note = w->note(); | |
212 | + s.optionals.push_back(item); | |
180 | 213 | } |
181 | 214 | else |
182 | 215 | { |
183 | 216 | QMessageBox::critical(this, tr("Error"), tr("Invalid file path\n") + filename); |
184 | 217 | delete lib; |
185 | - delete s.base; | |
218 | + delete s.base.lib; | |
186 | 219 | for(int i = 0; i < s.optionals.size(); i++) |
187 | 220 | { |
188 | - delete s.optionals.at(i); | |
221 | + delete s.optionals.at(i).lib; | |
189 | 222 | } |
190 | 223 | return false; |
191 | 224 | } |
192 | 225 | } |
193 | - // ToDo::ばぶるそーーーーと!! | |
226 | + // ToDo::そーーーーと!! | |
227 | + for(int i = 0; i < s.optionals.size(); i++) | |
228 | + { | |
229 | + int minimum = s.optionals.at(i).brightness; | |
230 | + int index = i; | |
231 | + for(int j = i + 1; j < s.optionals.size(); j++) | |
232 | + { | |
233 | + if(minimum < s.optionals.at(j).brightness) | |
234 | + { | |
235 | + minimum = s.optionals.at(j).brightness; | |
236 | + index = j; | |
237 | + } | |
238 | + } | |
239 | + stand::synthesis::Transcriber::TranscriberItem item, tmp; | |
240 | + item = s.optionals.at(index); | |
241 | + tmp = s.optionals.at(i); | |
242 | + s.optionals.replace(i, item); | |
243 | + s.optionals.replace(index, tmp); | |
244 | + } | |
194 | 245 | |
195 | 246 | return true; |
196 | 247 | } |
@@ -19,12 +19,17 @@ | ||
19 | 19 | Q_OBJECT |
20 | 20 | public slots: |
21 | 21 | void openDirDialog(); |
22 | + void settingChanged(); | |
22 | 23 | |
24 | +signals: | |
25 | + void changed(QWidget *); | |
26 | + | |
23 | 27 | public: |
24 | 28 | explicit TranscriberWidget(QWidget *parent = 0, int index = 0ULL); |
25 | 29 | ~TranscriberWidget(); |
26 | 30 | |
27 | 31 | QString dir(); |
32 | + QString colorName(); | |
28 | 33 | int bri(); |
29 | 34 | int note(); |
30 | 35 | QTextCodec *codec(); |
@@ -27,7 +27,7 @@ | ||
27 | 27 | void paintEvent(QPaintEvent *e); |
28 | 28 | |
29 | 29 | public slots: |
30 | - void setMapping(QVector<Map> &mapping); | |
30 | + void setMapping(QVector<stand::gui::MappingView::Map> &mapping); | |
31 | 31 | |
32 | 32 | signals: |
33 | 33 |
@@ -2,7 +2,10 @@ | ||
2 | 2 | #define TRANSCRIBERWINDOW_H |
3 | 3 | |
4 | 4 | #include <QMainWindow> |
5 | +#include <QVector> | |
5 | 6 | |
7 | +#include "MappingView.h" | |
8 | + | |
6 | 9 | namespace Ui { |
7 | 10 | class TranscriberWindow; |
8 | 11 | } |
@@ -22,11 +25,13 @@ | ||
22 | 25 | Q_OBJECT |
23 | 26 | signals: |
24 | 27 | void sendCancelToTranscriber(); |
28 | + void mappingChanged(QVector<stand::gui::MappingView::Map> &mapping); | |
25 | 29 | public slots: |
26 | 30 | void addTab(); |
27 | 31 | void removeTab(); |
28 | 32 | |
29 | 33 | void pushAnalyze(); |
34 | + void settingChanged(); | |
30 | 35 | void transcriptionFinished(bool); |
31 | 36 | public: |
32 | 37 | explicit TranscriberWindow(QWidget *parent = 0); |
@@ -1,10 +1,11 @@ | ||
1 | 1 | #include "Transcriber.h" |
2 | +#include "TranscriberSetting.h" | |
2 | 3 | #include "TranscriberElement.h" |
3 | 4 | #include "../io/UtauLibrary.h" |
4 | 5 | |
5 | 6 | using namespace stand::synthesis; |
6 | 7 | |
7 | -Transcriber::Transcriber(const TranscriberSetting &s, QObject *parent) : | |
8 | +Transcriber::Transcriber(const TranscriberSetting *s, QObject *parent) : | |
8 | 9 | QThread(parent) |
9 | 10 | { |
10 | 11 | setting = s; |
@@ -12,10 +13,10 @@ | ||
12 | 13 | |
13 | 14 | Transcriber::~Transcriber() |
14 | 15 | { |
15 | - delete setting.base; | |
16 | - for(int i = 0; i < setting.optionals.size();i ++) | |
16 | + delete setting->base.lib; | |
17 | + for(int i = 0; i < setting->optionals.size();i ++) | |
17 | 18 | { |
18 | - delete setting.optionals.at(i); | |
19 | + delete setting->optionals.at(i).lib; | |
19 | 20 | } |
20 | 21 | for(int i = 0; i < elements.size(); i++) |
21 | 22 | { |
@@ -33,9 +34,9 @@ | ||
33 | 34 | QMutex mutex; |
34 | 35 | mutex.lock(); |
35 | 36 | elements.clear(); |
36 | - for(int i = 0; i < setting.numThreads && i < setting.base->size(); i++) | |
37 | + for(int i = 0; i < setting->numThreads && i < setting->base.lib->size(); i++) | |
37 | 38 | { |
38 | - TranscriberElement *e = new TranscriberElement(i, &setting, &mutex, this); | |
39 | + TranscriberElement *e = new TranscriberElement(i, setting, &mutex, this); | |
39 | 40 | elements.push_back(e); |
40 | 41 | e->start(); |
41 | 42 | currentIndex = i; |
@@ -54,7 +55,7 @@ | ||
54 | 55 | void Transcriber::elementFinished(TranscriberElement *e) |
55 | 56 | { |
56 | 57 | currentFinished++; |
57 | - if(currentIndex < setting.base->size()) | |
58 | + if(currentIndex < setting->base.lib->size()) | |
58 | 59 | { |
59 | 60 | e->setIndex(currentIndex); |
60 | 61 | currentIndex++; |
@@ -64,13 +65,14 @@ | ||
64 | 65 | e->finishTranscription(); |
65 | 66 | } |
66 | 67 | // SafeGuard (要るかな?) |
67 | - if(currentFinished == setting.base->size() - 1) | |
68 | + if(currentFinished == setting->base.lib->size() - 1) | |
68 | 69 | { |
69 | - for(int i = 0; i < setting.numThreads; i++) | |
70 | + for(int i = 0; i < setting->numThreads; i++) | |
70 | 71 | { |
71 | 72 | |
72 | 73 | } |
73 | 74 | } |
75 | + emit progressChanged(currentFinished); | |
74 | 76 | } |
75 | 77 | |
76 | 78 | void Transcriber::cancel() |
@@ -2,6 +2,7 @@ | ||
2 | 2 | #define TRANSCRIBERSETTING_H |
3 | 3 | |
4 | 4 | #include <QVector> |
5 | +#include "Transcriber.h" | |
5 | 6 | |
6 | 7 | namespace stand |
7 | 8 | { |
@@ -15,12 +16,9 @@ | ||
15 | 16 | class TranscriberSetting |
16 | 17 | { |
17 | 18 | public: |
18 | - stand::io::UtauLibrary *base; | |
19 | - QVector<stand::io::UtauLibrary *> optionals; | |
19 | + Transcriber::TranscriberItem base; | |
20 | + QVector<Transcriber::TranscriberItem> optionals; | |
20 | 21 | |
21 | - int note; | |
22 | - int brightness; | |
23 | - | |
24 | 22 | unsigned int numThreads; |
25 | 23 | }; |
26 | 24 |
@@ -6,14 +6,17 @@ | ||
6 | 6 | #include <QWaitCondition> |
7 | 7 | #include <QVector> |
8 | 8 | |
9 | -#include "TranscriberSetting.h" | |
10 | - | |
11 | 9 | namespace stand |
12 | 10 | { |
11 | +namespace io | |
12 | +{ | |
13 | +class UtauLibrary; | |
14 | +} | |
13 | 15 | namespace synthesis |
14 | 16 | { |
15 | 17 | |
16 | 18 | class TranscriberElement; |
19 | +class TranscriberSetting; | |
17 | 20 | |
18 | 21 | class Transcriber : public QThread |
19 | 22 | { |
@@ -27,13 +30,20 @@ | ||
27 | 30 | void elementFinished(stand::synthesis::TranscriberElement *e); |
28 | 31 | |
29 | 32 | public: |
30 | - explicit Transcriber(const TranscriberSetting &s, QObject *parent = 0); | |
33 | + struct TranscriberItem | |
34 | + { | |
35 | + stand::io::UtauLibrary *lib; | |
36 | + int note; | |
37 | + int brightness; | |
38 | + }; | |
39 | + | |
40 | + explicit Transcriber(const TranscriberSetting *s, QObject *parent = 0); | |
31 | 41 | ~Transcriber(); |
32 | 42 | |
33 | 43 | void run(); |
34 | 44 | |
35 | 45 | private: |
36 | - TranscriberSetting setting; | |
46 | + const TranscriberSetting *setting; | |
37 | 47 | int currentFinished; |
38 | 48 | int currentIndex; |
39 | 49 | QVector<TranscriberElement *> elements; |
@@ -18,10 +18,10 @@ | ||
18 | 18 | this->mutex = m; |
19 | 19 | this->transcriber = t; |
20 | 20 | |
21 | - libs.push_back(s->base); | |
21 | + items.push_back(s->base); | |
22 | 22 | for(int i = 0; i < s->optionals.size(); i++) |
23 | 23 | { |
24 | - libs.push_back(s->optionals.at(i)); | |
24 | + items.push_back(s->optionals.at(i)); | |
25 | 25 | } |
26 | 26 | isFinished = false; |
27 | 27 | } |
@@ -44,7 +44,7 @@ | ||
44 | 44 | { |
45 | 45 | stand::io::StandFile *prev, *current = NULL; |
46 | 46 | prev = new stand::io::StandFile(); |
47 | - QString filename = libs.at(0)->directory().absolutePath() + QDir::separator() + libs.at(0)->at(index)->filename; | |
47 | + QString filename = items.at(0).lib->directory().absolutePath() + QDir::separator() + items.at(0).lib->at(index)->filename; | |
48 | 48 | // 簡単だけど拡張子チェック |
49 | 49 | if(filename.contains(".vvd") && !prev->read(QDir::toNativeSeparators(filename).toLocal8Bit().data())) |
50 | 50 | { |
@@ -52,12 +52,12 @@ | ||
52 | 52 | delete prev; |
53 | 53 | prev = NULL; |
54 | 54 | } |
55 | - for(int i = 1; i < libs.size(); i++) | |
55 | + for(int i = 1; i < items.size(); i++) | |
56 | 56 | { |
57 | - const stand::io::UtauPhoneme *phoneme = libs.at(i)->find(libs.at(0)->at(index)->pronounce); | |
57 | + const stand::io::UtauPhoneme *phoneme = items.at(i).lib->find(items.at(0).lib->at(index)->pronounce); | |
58 | 58 | if(phoneme) |
59 | 59 | { |
60 | - filename = libs.at(i)->directory().absolutePath() + QDir::separator() + phoneme->filename; | |
60 | + filename = items.at(i).lib->directory().absolutePath() + QDir::separator() + phoneme->filename; | |
61 | 61 | current = new stand::io::StandFile(); |
62 | 62 | // 現在のファイルを読み込む→現在のファイルがよめていて,前回もファイルが読めていた場合だけ分析を行う. |
63 | 63 | if(filename.contains(".vvd") && current->read(QDir::toNativeSeparators(filename).toLocal8Bit().data()) && prev) |
@@ -64,6 +64,8 @@ | ||
64 | 64 | { |
65 | 65 | // ToDo:: 写像関数の計算と保存 |
66 | 66 | stand::io::StandFile::matching(prev, current); |
67 | + // ファイルへ保存. | |
68 | + current->write(QDir::toNativeSeparators(filename).toLocal8Bit().data()); | |
67 | 69 | } |
68 | 70 | else |
69 | 71 | { |
@@ -4,6 +4,8 @@ | ||
4 | 4 | #include <QThread> |
5 | 5 | #include <QVector> |
6 | 6 | |
7 | +#include "Transcriber.h" | |
8 | + | |
7 | 9 | class QMutex; |
8 | 10 | |
9 | 11 | namespace stand |
@@ -15,7 +17,6 @@ | ||
15 | 17 | namespace synthesis |
16 | 18 | { |
17 | 19 | |
18 | -class Transcriber; | |
19 | 20 | class TranscriberSetting; |
20 | 21 | |
21 | 22 | class TranscriberElement : public QThread |
@@ -34,7 +35,7 @@ | ||
34 | 35 | QMutex *mutex; |
35 | 36 | Transcriber *transcriber; |
36 | 37 | |
37 | - QVector<stand::io::UtauLibrary *> libs; | |
38 | + QVector<Transcriber::TranscriberItem> items; | |
38 | 39 | |
39 | 40 | bool isFinished; |
40 | 41 | }; |