forked from psemiletov/eko
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathafx.cpp
More file actions
96 lines (68 loc) · 1.65 KB
/
afx.cpp
File metadata and controls
96 lines (68 loc) · 1.65 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#include "afx.h"
AFx::AFx()
{
bypass = false;
realtime = true;
ui_visible = false;
float_buffer = 0;
state = FXS_STOP;
classname = "AFx";
modulename = "AFx";
samplerate = 1;
channels = 1;//chann;
wnd_ui = new QWidget();
vbl_main = new QVBoxLayout;
wnd_ui->setLayout (vbl_main);
presets = new CFxPresets;
connect (presets, SIGNAL(save_request()), this, SLOT(slot_save_request()));
connect (presets, SIGNAL(preset_changed(QString)), this, SLOT(slot_preset_changed(QString)));
w_caption = new QWidget;
QVBoxLayout *vbl_caption = new QVBoxLayout;
w_caption->setLayout (vbl_caption);
vbl_main->addWidget (presets);
vbl_main->addWidget (w_caption);
l_caption = new QLabel;
l_subcaption = new QLabel;
vbl_caption->addWidget (l_caption);
vbl_caption->addWidget (l_subcaption);
QString qstl = "QWidget#w_caption{"
"border-radius: 15px;"
"background-color: grey;}";
w_caption->setObjectName ("w_caption");
w_caption->setStyleSheet (qstl);
}
void AFx::set_caption (const QString &capt, const QString &subcapt)
{
l_caption->setText (capt);
l_subcaption->setText (subcapt);
}
AFx::~AFx()
{
if (wnd_ui)
{
wnd_ui->close();
delete wnd_ui;
}
}
void AFx::show_ui()
{
if (wnd_ui)
wnd_ui->setVisible (! wnd_ui->isVisible());
}
void AFx::set_state (FxState s)
{
state = s;
}
void AFx::reset_params (size_t srate, size_t chann)
{
samplerate = srate;
channels = chann;
}
void AFx::slot_preset_changed (const QString &text)
{
load_params_from_string (text);
}
void AFx::slot_save_request()
{
presets->preset_data = save_params_to_string();
}