-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpvc.hpp
197 lines (180 loc) · 4.52 KB
/
pvc.hpp
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
#include "rack.hpp"
using namespace rack;
extern Plugin *plugin;
// module widgets
extern Model *modelHeads;
extern Model *modelTails;
extern Model *modelBangDaButton;
extern Model *modelCompair;
extern Model *modelCoSuOf;
extern Model *modelFlipOLogic;
extern Model *modelGeighths;
extern Model *modelShutIt;
extern Model *modelSlimSeq;
extern Model *modelSumIt;
extern Model *modelTaHaSaHaN;
extern Model *modelVamps;
extern Model *modelVubar;
extern Model *modelPvCBlank;
extern Model *modelPlainVoidCanvas;
//////////////////////////////////////////////////////////////////////////////
struct OutPortBin : SVGPort {
OutPortBin() {
background->svg = SVG::load(assetPlugin(plugin, "res/components/OutPortBin.svg"));
background->wrap();
box.size = background->box.size;
}
};
struct OutPortVal : SVGPort {
OutPortVal() {
background->svg = SVG::load(assetPlugin(plugin, "res/components/OutPortVal.svg"));
background->wrap();
box.size = background->box.size;
}
};
struct InPortBin : SVGPort {
InPortBin() {
background->svg = SVG::load(assetPlugin(plugin, "res/components/InPortBin.svg"));
background->wrap();
box.size = background->box.size;
}
};
struct InPortAud : SVGPort {
InPortAud() {
background->svg = SVG::load(assetPlugin(plugin, "res/components/InPortAud.svg"));
background->wrap();
box.size = background->box.size;
}
};
struct InPortCtrl : SVGPort {
InPortCtrl() {
background->svg = SVG::load(assetPlugin(plugin, "res/components/InPortCtrl.svg"));
background->wrap();
box.size = background->box.size;
}
};
/// knobs & buttons
struct PvCKnob : RoundKnob {
PvCKnob() {
setSVG(SVG::load(assetPlugin(plugin, "res/components/PvCKnob.svg")));
box.size = Vec(22,22);
}
};
struct PvCLEDKnob : PvCKnob {
PvCLEDKnob() {
setSVG(SVG::load(assetPlugin(plugin, "res/components/PvCKnobT.svg")));
}
};
struct PvCSnapKnob : PvCKnob {
PvCSnapKnob() {
snap = true;
}
};
struct LabelButtonL : SVGSwitch, MomentarySwitch {
LabelButtonL() {
addFrame(SVG::load(assetPlugin(plugin, "res/components/LabelButtonL_0.svg")));
addFrame(SVG::load(assetPlugin(plugin, "res/components/LabelButtonL_1.svg")));
box.size = Vec(36,12);
}
};
struct LabelButtonS : SVGSwitch, MomentarySwitch {
LabelButtonS() {
addFrame(SVG::load(assetPlugin(plugin, "res/components/LabelButtonS_0.svg")));
addFrame(SVG::load(assetPlugin(plugin, "res/components/LabelButtonS_1.svg")));
box.size = Vec(24,12);
}
};
/// lights
struct PvCLight : GrayModuleLightWidget{
PvCLight() { bgColor = nvgRGB(0x00, 0x00, 0x00); }
};
struct RedLED : PvCLight {
RedLED() {
addBaseColor(COLOR_RED); }
};
struct GreenLED : PvCLight {
GreenLED() {
addBaseColor(COLOR_GREEN); }
};
struct BlueLED : PvCLight {
BlueLED() {
addBaseColor(COLOR_BLUE); }
};
struct WhiteLED : PvCLight {
WhiteLED() {
addBaseColor(COLOR_WHITE); }
};
struct OrangeLED : PvCLight {
OrangeLED() {
addBaseColor(COLOR_ORANGE); }
};
struct YellowLED : PvCLight {
YellowLED() {
addBaseColor(COLOR_YELLOW); }
};
struct PurpleLED : PvCLight {
PurpleLED() {
addBaseColor(COLOR_PURPLE); }
};
struct CyanLED : PvCLight {
CyanLED() {
addBaseColor(COLOR_CYAN); }
};
struct GreenRedLED : PvCLight {
GreenRedLED() {
addBaseColor(COLOR_GREEN);
addBaseColor(COLOR_RED); }
};
struct WhiteRedLED : PvCLight {
WhiteRedLED() {
addBaseColor(COLOR_WHITE);
addBaseColor(COLOR_RED);
}
};
template <typename BASE>
struct PvCBigLED : BASE {
PvCBigLED() {
this->box.size = Vec(22, 22);
}
};
template <typename BASE>
struct FourPixLight : BASE {
FourPixLight() {
this->box.size = Vec(4, 4);
}
};
template <typename BASE>
struct EightPixLight : BASE {
EightPixLight() {
this->box.size = Vec(8, 8);
}
};
/// screws
struct ScrewHead1 : SVGScrew {
ScrewHead1() {
sw->svg = SVG::load(assetPlugin(plugin, "res/components/ScrewHead1.svg"));
sw->wrap();
box.size = sw->box.size;
}
};
struct ScrewHead2 : SVGScrew {
ScrewHead2() {
sw->svg = SVG::load(assetPlugin(plugin, "res/components/ScrewHead2.svg"));
sw->wrap();
box.size = sw->box.size;
}
};
struct ScrewHead3 : SVGScrew {
ScrewHead3() {
sw->svg = SVG::load(assetPlugin(plugin, "res/components/ScrewHead3.svg"));
sw->wrap();
box.size = sw->box.size;
}
};
struct ScrewHead4 : SVGScrew {
ScrewHead4() {
sw->svg = SVG::load(assetPlugin(plugin, "res/components/ScrewHead4.svg"));
sw->wrap();
box.size = sw->box.size;
}
};