-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLooperWidget.cpp
51 lines (48 loc) · 1.24 KB
/
LooperWidget.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
//
// Created by martin on 5/5/18.
//
#include "LooperWidget.h"
LooperWidget::LooperWidget(int channel) {
this->looperChannel = channel;
this->type = strdup("slider");
};
void LooperWidget::setParams(const char* name, float* zone, float min, float max, float step) {
this->name = strdup(name);
this->zone = zone;
this->min = min;
this->max = max;
this->step = step;
}
void LooperWidget::setAxis(const char* axis) {
this->axis = *axis - 'x';
}
void LooperWidget::setType(const char* type) {
this->type = strdup(type);
}
void LooperWidget::printData() {
cout<<endl;
cout<<"=== Widget Data ==="<<endl;
cout<<"Name: "<<name<<endl;
cout<<"Zone: "<<zone<<endl;
cout<<"Min: "<<min<<endl;
cout<<"Max: "<<max<<endl;
cout<<"Step: "<<step<<endl;
cout<<"NexusUI type: "<<type<<endl;
cout<<"NexusUI axis: "<<axis<<endl;
}
json LooperWidget::getJson() {
std::string nameStr(name);
std::string typeStr(type);
json result = {
{"name", nameStr},
{"value", *zone},
{"zone", (long)zone},
{"min", min},
{"max", max},
{"step", step},
{"axis", axis},
{"type", typeStr},
{"looperChannel", looperChannel},
};
return result;
}