This repository has been archived by the owner on May 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SLDialog.cpp
62 lines (55 loc) · 1.58 KB
/
SLDialog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include "SLDialog.h"
#include "ui_SLDialog.h"
#if _MSC_VER >= 1600
#pragma execution_character_set("utf-8")
#endif
SLDialog::SLDialog(QWidget* parent)
: QDialog(parent)
{
ui = new Ui::SLDialog();
ui->setupUi(this);
ui->pitch->clear();
for (int i = 0; i <= 10; i++) {
ui->pitch->insertItem(0, QString("C" + QString::number(i)));
ui->pitch->insertItem(0, QString("C#" + QString::number(i)));
ui->pitch->insertItem(0, QString("D" + QString::number(i)));
ui->pitch->insertItem(0, QString("D#" + QString::number(i)));
ui->pitch->insertItem(0, QString("E" + QString::number(i)));
ui->pitch->insertItem(0, QString("F" + QString::number(i)));
ui->pitch->insertItem(0, QString("F#" + QString::number(i)));
ui->pitch->insertItem(0, QString("G" + QString::number(i)));
ui->pitch->insertItem(0, QString("G#" + QString::number(i)));
ui->pitch->insertItem(0, QString("A" + QString::number(i)));
ui->pitch->insertItem(0, QString("A#" + QString::number(i)));
ui->pitch->insertItem(0, QString("B" + QString::number(i)));
}
ui->pitch->setCurrentText("C5");
}
SLDialog::~SLDialog()
{
delete ui;
}
void SLDialog::setlist(QStringList sdb)
{
ui->sdb->clear();
for (int i = 0; i < sdb.size(); i++) {
ui->sdb->addItem(sdb.at(i));
}
}
void SLDialog::setlink(QString pitch, QString sdb)
{
ui->pitch->setCurrentText(pitch);
ui->sdb->setCurrentText(sdb);
this->pitch.clear();
this->sdb.clear();
}
void SLDialog::on_buttonBox_accepted()
{
this->pitch = ui->pitch->currentText();
this->sdb = ui->sdb->currentText();
this->close();
}
void SLDialog::on_buttonBox_rejected()
{
this->close();
}