-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvibratobox.cpp
More file actions
39 lines (30 loc) · 1.36 KB
/
vibratobox.cpp
File metadata and controls
39 lines (30 loc) · 1.36 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
#include "vibratobox.h"
VibratoBox::VibratoBox(Vibrato *vibrato, QWidget *parent)
: QGroupBox(parent), vibrato(vibrato), vibratoLabel(this),
vibDepthSelect(this), vibDepthLabel(this), vibPeriodSelect(this),
vibPeriodLabel(this) {
vibratoLabel.setText("Vibrato");
vibDepthSelect.setRange(0, 100);
vibDepthLabel.setText("Depth");
vibPeriodSelect.setRange(1, 100);
vibPeriodSelect.setValue(10);
vibPeriodLabel.setText("Period");
vibLayout.addWidget(&vibratoLabel, 0, 0, 1, -1);
vibLayout.addWidget(&vibDepthSelect, 1, 0);
vibLayout.addWidget(&vibDepthLabel, 2, 0, 1, 1, Qt::AlignHCenter);
vibLayout.addWidget(&vibPeriodSelect, 1, 1);
vibLayout.addWidget(&vibPeriodLabel, 2, 1, 1, 1, Qt::AlignHCenter);
this->setLayout(&vibLayout);
QObject::connect(&vibDepthSelect, SIGNAL(valueChanged(int)), this,
SLOT(setVibDepth(int)));
QObject::connect(&vibDepthSelect, SIGNAL(valueChanged(int)), this,
SLOT(setFocus()));
QObject::connect(&vibPeriodSelect, SIGNAL(valueChanged(int)), this,
SLOT(setVibPeriod(int)));
QObject::connect(&vibPeriodSelect, SIGNAL(valueChanged(int)), this,
SLOT(setFocus()));
}
void VibratoBox::setVibDepth(int value) { vibrato->setDepth(value * 100); }
void VibratoBox::setVibPeriod(int value) {
vibrato->setPeriod(((double)value) / 100);
}