• R/O
  • SSH
  • HTTPS

cadencii: コミット


コミットメタ情報

リビジョン1972 (tree)
日時2012-01-25 03:48:21
作者haruneko24

ログメッセージ

[stand2.0/StandConverter] Transcriber実装中.

変更サマリ

差分

--- vConnect/trunk/stand2.0/StandConverter/utility/Utility.cpp (revision 1971)
+++ vConnect/trunk/stand2.0/StandConverter/utility/Utility.cpp (revision 1972)
@@ -19,8 +19,8 @@
1919 if(confirm)
2020 {
2121 int val = QMessageBox::warning(w,
22- "Confirm",
23- dir.path() + "\ndoes not exist. Do you want to create the directory",
22+ QObject::tr("Confirm"),
23+ dir.path() + QObject::tr("\ndoes not exist. Do you want to create the directory"),
2424 QMessageBox::Yes, QMessageBox::No);
2525 if(val == QMessageBox::No)
2626 {
@@ -30,7 +30,7 @@
3030 // ディレクトリを作成.
3131 if(!dir.mkpath(dir.absolutePath()))
3232 {
33- QMessageBox::critical(w, "Error", dir.path() + "\nCould not mkdir.");
33+ QMessageBox::critical(w, QObject::tr("Error"), dir.path() + QObject::tr("\nCould not mkdir."));
3434 return false;
3535 }
3636 return true;
--- vConnect/trunk/stand2.0/StandConverter/gui/ConverterWindow.cpp (revision 1971)
+++ vConnect/trunk/stand2.0/StandConverter/gui/ConverterWindow.cpp (revision 1972)
@@ -244,7 +244,7 @@
244244 // 変換が失敗したと聞いて.
245245 if(!f)
246246 {
247- _errorMessage("Error occured in converting.");
247+ _errorMessage(QObject::tr("Error occured in converting."));
248248 }
249249 // 処理が終了したので変換器を殺しても大丈夫.
250250 delete currentConverter;
--- vConnect/trunk/stand2.0/StandConverter/gui/TranscribeWidget.cpp (revision 1971)
+++ vConnect/trunk/stand2.0/StandConverter/gui/TranscribeWidget.cpp (revision 1972)
@@ -1,13 +1,33 @@
11 #include "TranscribeWidget.h"
22 #include "ui_TranscribeWidget.h"
33
4+#include <QStringList>
5+
46 using namespace stand::gui;
57
6-TranscribeWidget::TranscribeWidget(QWidget *parent) :
8+TranscribeWidget::TranscribeWidget(QWidget *parent, int index) :
79 QWidget(parent),
810 ui(new Ui::TranscribeWidget)
911 {
1012 ui->setupUi(this);
13+
14+ // Set ColorComboBox
15+ QStringList colorNames;
16+ colorNames << tr("red") << tr("green") << tr("blue") << tr("cyan") << tr("magenta") << tr("yellow") << tr("white");
17+ QPalette pallete = ui->ColorSelector->palette();
18+ pallete.setColor(QPalette::Highlight, Qt::transparent);
19+
20+ int size = ui->ColorSelector->style()->pixelMetric(QStyle::PM_SmallIconSize);
21+ QPixmap pixmap(size, size);
22+
23+ for(unsigned int i = 0; i < colorNames.size(); i++)
24+ {
25+ QString name = colorNames.at(i);
26+ ui->ColorSelector->addItem(name, QColor(i));
27+ pixmap.fill(QColor(name));
28+ ui->ColorSelector->setItemData(i, pixmap, Qt::DecorationRole);
29+ }
30+ ui->ColorSelector->setCurrentIndex(index % ui->ColorSelector->count());
1131 }
1232
1333 TranscribeWidget::~TranscribeWidget()
--- vConnect/trunk/stand2.0/StandConverter/gui/TranscribeWidget.h (revision 1971)
+++ vConnect/trunk/stand2.0/StandConverter/gui/TranscribeWidget.h (revision 1972)
@@ -17,7 +17,7 @@
1717 Q_OBJECT
1818
1919 public:
20- explicit TranscribeWidget(QWidget *parent = 0);
20+ explicit TranscribeWidget(QWidget *parent = 0, int index = 0);
2121 ~TranscribeWidget();
2222
2323 QString dir();
--- vConnect/trunk/stand2.0/StandConverter/gui/MappingView.cpp (revision 1971)
+++ vConnect/trunk/stand2.0/StandConverter/gui/MappingView.cpp (revision 1972)
@@ -10,13 +10,16 @@
1010 MappingView::MappingView(QWidget *parent) :
1111 QWidget(parent)
1212 {
13-/* _map = new *QColor[_MAPPING_SIZE];
14- _map[0] = new QColor[_MAPPING_SIZE * _MAPPING_SIZE];
13+ _map = new _color*[_MAPPING_SIZE];
14+ _map[0] = new _color[_MAPPING_SIZE * _MAPPING_SIZE];
1515 for(int i = 1; i < _MAPPING_SIZE; i++)
1616 {
17- _map[1] = _map[0] + i * _MAPPING_SIZE;
18- }*/
19- _map = NULL;
17+ _map[i] = _map[0] + i * _MAPPING_SIZE;
18+ }
19+ for(int i = 0; i < _MAPPING_SIZE * _MAPPING_SIZE; i++)
20+ {
21+ _map[0][i].r = _map[0][i].b = _map[0][i].g = 0;
22+ }
2023 }
2124
2225 MappingView::~MappingView()
@@ -45,7 +48,7 @@
4548 int y = j / (double)_MAPPING_SIZE * height();
4649 int h = (j + 1) / (double)_MAPPING_SIZE * height() - y;
4750
48- p.fillRect(x, y, w, h, QColor(0, 0, 0));
51+ p.fillRect(x, y, w, h, QColor(_map[i][j].r, _map[i][j].g, _map[i][j].b));
4952 p.setPen(QColor(192, 192, 192));
5053 p.drawLine(x, y, x, y + h);
5154 p.drawLine(x, y, x + w, y);
@@ -52,3 +55,16 @@
5255 }
5356 }
5457 }
58+
59+void MappingView::setMapping(QVector<Map> &mapping)
60+{
61+ _data = mapping;
62+ for(unsigned int i = 0; i < mapping.size(); i++)
63+ {
64+ 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();
69+ }
70+}
--- vConnect/trunk/stand2.0/StandConverter/gui/TranscriberWindow.cpp (revision 1971)
+++ vConnect/trunk/stand2.0/StandConverter/gui/TranscriberWindow.cpp (revision 1972)
@@ -1,11 +1,23 @@
11 #include "TranscriberWindow.h"
22 #include "ui_TranscriberWindow.h"
33
4+#include <QMessageBox>
5+
6+using namespace stand::gui;
7+
48 TranscriberWindow::TranscriberWindow(QWidget *parent) :
59 QMainWindow(parent),
610 ui(new Ui::TranscriberWindow)
711 {
812 ui->setupUi(this);
13+
14+ while(ui->SettingTabs->count() != 0)
15+ {
16+ QWidget *p = ui->SettingTabs->widget(0);
17+ ui->SettingTabs->removeTab(0);
18+ delete p;
19+ }
20+ ui->SettingTabs->addTab(new TranscribeWidget(this), tr("Base"));
921 }
1022
1123 TranscriberWindow::~TranscriberWindow()
@@ -12,3 +24,38 @@
1224 {
1325 delete ui;
1426 }
27+
28+void TranscriberWindow::closeEvent(QCloseEvent *e)
29+{
30+
31+}
32+
33+void TranscriberWindow::addTab()
34+{
35+ int index = ui->SettingTabs->count();
36+ QString num;
37+ num.setNum(index);
38+
39+ ui->SettingTabs->addTab(new TranscribeWidget(this, index), tr("Opt. ") + num);
40+}
41+
42+void TranscriberWindow::removeTab()
43+{
44+ int index = ui->SettingTabs->currentIndex();
45+ // Base tab cannot be removed.
46+ if(index == 0)
47+ {
48+ QMessageBox::critical(this, tr("Error"), tr("You can not remove base tab."), QMessageBox::Ok);
49+ return;
50+ }
51+
52+ //
53+ int val = QMessageBox::warning(this, tr("Confirm"), tr("Do you really want to remove current tab.\nYou can not undo this action."), QMessageBox::Yes, QMessageBox::No);
54+ if(val != QMessageBox::Yes)
55+ {
56+ return;
57+ }
58+ QWidget *p = ui->SettingTabs->widget(index);
59+ ui->SettingTabs->removeTab(index);
60+ delete p;
61+}
--- vConnect/trunk/stand2.0/StandConverter/gui/MappingView.h (revision 1971)
+++ vConnect/trunk/stand2.0/StandConverter/gui/MappingView.h (revision 1972)
@@ -14,19 +14,34 @@
1414 {
1515 Q_OBJECT
1616 public:
17+ struct Map
18+ {
19+ int note;
20+ int brightness;
21+ QColor color;
22+ };
23+
1724 explicit MappingView(QWidget *parent = 0);
1825 ~MappingView();
1926
2027 void paintEvent(QPaintEvent *e);
2128
29+public slots:
30+ void setMapping(QVector<Map> &mapping);
31+
2232 signals:
2333
2434 public slots:
2535
2636 private:
27- QColor **_map;
37+ struct _color
38+ {
39+ int r, g, b;
40+ };
41+
42+ _color **_map;
43+ QVector<Map> _data;
2844 const static int _MAPPING_SIZE;
29-
3045 };
3146
3247 }
--- vConnect/trunk/stand2.0/StandConverter/gui/TranscriberWindow.h (revision 1971)
+++ vConnect/trunk/stand2.0/StandConverter/gui/TranscriberWindow.h (revision 1972)
@@ -7,16 +7,28 @@
77 class TranscriberWindow;
88 }
99
10+namespace stand
11+{
12+namespace gui
13+{
14+
1015 class TranscriberWindow : public QMainWindow
1116 {
1217 Q_OBJECT
13-
18+public slots:
19+ void addTab();
20+ void removeTab();
1421 public:
1522 explicit TranscriberWindow(QWidget *parent = 0);
1623 ~TranscriberWindow();
17-
24+
25+ void closeEvent(QCloseEvent *e);
26+
1827 private:
1928 Ui::TranscriberWindow *ui;
2029 };
2130
31+}
32+}
33+
2234 #endif // TRANSCRIBERWINDOW_H
--- vConnect/trunk/stand2.0/StandConverter/main.cpp (revision 1971)
+++ vConnect/trunk/stand2.0/StandConverter/main.cpp (revision 1972)
@@ -21,6 +21,6 @@
2121 // ConverterWindow w;
2222 TranscriberWindow w;
2323 w.show();
24-
24+
2525 return a.exec();
2626 }
--- vConnect/trunk/stand2.0/StandConverter/memo.txt (nonexistent)
+++ vConnect/trunk/stand2.0/StandConverter/memo.txt (revision 1972)
@@ -0,0 +1,21 @@
1+StandConverter : v.Connect-STAND用音源変換ツール@Qt
2+
3+v.Connect-STAND用音源コネクトライブラリを作成するツールです.
4+ConverterWindowから圧縮率などの指定をしたvvdファイルを作成し,
5+TranscriberWindowから時間伸縮に必要なパラメタを計算したのち,
6+vConnect.iniを作成します.
7+
8+Qt以外でコンパイルに必要なライブラリは以下の4つです.
9+・libfftw3
10+・libogg
11+・libvorbis
12+・libvorbisfile
13+
14+
15+ToDo::TranscriberWindowの実装
16+・GUI表示
17+・マルチスレッド化
18+・Transcriberの移植
19+・出力への説明をどうするか検討
20+
21+Done::ConverterWindow周りの実装
\ No newline at end of file
旧リポジトリブラウザで表示