-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathparamwidget.cpp
More file actions
57 lines (51 loc) · 1.31 KB
/
paramwidget.cpp
File metadata and controls
57 lines (51 loc) · 1.31 KB
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
#include "paramwidget.h"
#include "ui_paramwidget.h"
#include "core.h"
ParamWidget::ParamWidget(QWidget *parent) :
QDockWidget(parent),
ui(new Ui::ParamWidget)
{
ui->setupUi(this);
connect(ui->CC0, SIGNAL(valueChanged(int)), this, SLOT(CC0Changed(int)));
connect(ui->CC1, SIGNAL(valueChanged(int)), this, SLOT(CC1Changed(int)));
connect(ui->CC2, SIGNAL(valueChanged(int)), this, SLOT(CC2Changed(int)));
connect(ui->CC3, SIGNAL(valueChanged(int)), this, SLOT(CC3Changed(int)));
}
ParamWidget::~ParamWidget()
{
delete ui;
}
void ParamWidget::clearName()
{
ui->label0->setText("");
ui->label1->setText("");
ui->label2->setText("");
ui->label3->setText("");
}
void ParamWidget::nameCCChanged(int id, QString name)
{
if(id == 0)
ui->label0->setText(name);
else if(id == 1)
ui->label1->setText(name);
else if(id == 2)
ui->label2->setText(name);
else if(id == 3)
ui->label3->setText(name);
}
void ParamWidget::CC0Changed(int v)
{
Core::instance()->setCC(0, float(v)/100.f);
}
void ParamWidget::CC1Changed(int v)
{
Core::instance()->setCC(1, float(v)/100.f);
}
void ParamWidget::CC2Changed(int v)
{
Core::instance()->setCC(2, float(v)/100.f);
}
void ParamWidget::CC3Changed(int v)
{
Core::instance()->setCC(3, float(v)/100.f);
}