-
Notifications
You must be signed in to change notification settings - Fork 1
/
rampeffectsettings.cpp
44 lines (37 loc) · 1.05 KB
/
rampeffectsettings.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
#include "rampeffectsettings.h"
#include "ui_rampeffectsettings.h"
RampEffectSettings::RampEffectSettings(QWidget* parent) :
EffectSettings(parent),
ui(new Ui::RampEffectSettings)
{
ui->setupUi(this);
}
const EnvelopeSettings* RampEffectSettings::envelopeSettings() const
{
return ui->qwid_envelope;
}
QString RampEffectSettings::endLevel() const
{
return ui->qle_endLevel->text();
}
QString RampEffectSettings::startLevel() const
{
return ui->qle_startLevel->text();
}
bool RampEffectSettings::fillFromParameters(const std::shared_ptr<FFBEffectParameters> params)
{
try {
const std::shared_ptr<FFBRampEffectParameters> rfParams = std::dynamic_pointer_cast<FFBRampEffectParameters>(params);
ui->qle_endLevel->setText(QString::number(rfParams->endLevel));
ui->qle_startLevel->setText(QString::number(rfParams->startLevel));
return ui->qwid_envelope->fillFromParameters(params);
} catch (std::bad_cast& ex) {
qCritical("%s\n", ex.what());
return false;
}
return false;
}
RampEffectSettings::~RampEffectSettings()
{
delete ui;
}