21namespace componentlibrary {
24using namespace window;
34static const NVGcolor
SCHEME_RED = nvgRGB(0xed, 0x2c, 0x24);
63template <
typename TBase = app::ModuleLightW
idget>
76 void setSvg(std::shared_ptr<Svg> svg) {
84template <
typename TBase = app::ModuleLightW
idget>
87 this->
bgColor = nvgRGBA(0x33, 0x33, 0x33, 0xff);
93template <
typename TBase = GrayModuleLightW
idget>
101template <
typename TBase = GrayModuleLightW
idget>
109template <
typename TBase = GrayModuleLightW
idget>
117template <
typename TBase = GrayModuleLightW
idget>
125template <
typename TBase = GrayModuleLightW
idget>
134template <
typename TBase = GrayModuleLightW
idget>
143template <
typename TBase = GrayModuleLightW
idget>
154template <
typename TBase>
162template <
typename TBase>
170template <
typename TBase>
178template <
typename TBase>
186template <
typename TBase = GrayModuleLightW
idget>
194template <
typename TBase = GrayModuleLightW
idget>
202template <
typename TBase = GrayModuleLightW
idget>
210template <
typename TBase = GrayModuleLightW
idget>
217template <
typename TBase>
222 nvgBeginPath(args.
vg);
223 nvgRect(args.
vg, 0, 0, this->box.size.x, this->box.size.y);
226 if (this->bgColor.a > 0.0) {
227 nvgFillColor(args.
vg, this->bgColor);
232 if (this->borderColor.a > 0.0) {
233 nvgStrokeWidth(args.
vg, 0.5);
234 nvgStrokeColor(args.
vg, this->borderColor);
243 if (this->color.a > 0.0) {
244 nvgBeginPath(args.
vg);
245 nvgRect(args.
vg, 0, 0, this->box.size.x, this->box.size.y);
247 nvgFillColor(args.
vg, this->color);
254template <
typename TBase>
259 this->box.size =
math::Vec(17.545, 17.545);
262template <
typename TBase>
267template <
typename TBase>
697 math::Vec(19.84260/2, 76.53517 - 11.74218/2),
707template <
typename TBase,
typename TLightBase = RedLight>
712 light =
new TLightBase;
713 this->addChild(
light);
724 .
plus(this->handle->box.size.div(2))
729template <
typename TBase>
735template <
typename TBase>
738template <
typename TLightBase = RedLight>
742template <
typename TLightBase = RedLight>
792template <
typename TSwitch>
795 this->momentary =
true;
866template <
typename TBase,
typename TLight = WhiteLight>
874 this->addChild(
light);
882template <
typename TLight = WhiteLight>
886template <
typename TLight>
889template <
typename TLight>
892 this->momentary =
false;
928template <
typename TLightBase = WhiteLight>
943template <
typename TLightBase = WhiteLight>
946template <
typename TLightBase = WhiteLight>
991 nvgBeginPath(args.
vg);
998 template <
typename TLightBase = WhiteLight>
1016 light->module =
module;
std::string system(std::string filename="")
Returns the path of a system asset.
static const NVGcolor BLACK
Definition color.hpp:17
static const NVGcolor BLACK_TRANSPARENT
Definition color.hpp:13
static const NVGcolor SCHEME_YELLOW
Definition componentlibrary.hpp:36
static const NVGcolor SCHEME_DARK_GRAY
Definition componentlibrary.hpp:42
static const NVGcolor SCHEME_WHITE
Definition componentlibrary.hpp:33
static const NVGcolor SCHEME_ORANGE
Definition componentlibrary.hpp:35
static const NVGcolor SCHEME_CYAN
Definition componentlibrary.hpp:38
static const NVGcolor SCHEME_PURPLE
Definition componentlibrary.hpp:40
static const NVGcolor SCHEME_GREEN
Definition componentlibrary.hpp:37
static const NVGcolor SCHEME_BLACK_TRANSPARENT
Definition componentlibrary.hpp:31
static const NVGcolor SCHEME_BLACK
Definition componentlibrary.hpp:32
static const NVGcolor SCHEME_RED
Definition componentlibrary.hpp:34
static const NVGcolor SCHEME_BLUE
Definition componentlibrary.hpp:39
static const NVGcolor SCHEME_LIGHT_GRAY
Definition componentlibrary.hpp:41
float mm2px(float mm)
Converts millimeter measurements to pixels.
Definition Svg.hpp:30
Root namespace for the Rack API.
Definition AudioDisplay.hpp:9
float opacity
Definition CircularShadow.hpp:12
bool snap
Enables value snapping to the nearest integer.
Definition Knob.hpp:25
float maxAngle
Definition Knob.hpp:34
float minAngle
Angles in radians.
Definition Knob.hpp:33
A knob which rotates an SVG and caches it in a framebuffer.
Definition SvgKnob.hpp:15
void setSvg(std::shared_ptr< window::Svg > svg)
widget::FramebufferWidget * fb
Definition SvgKnob.hpp:16
widget::TransformWidget * tw
Definition SvgKnob.hpp:18
Definition SvgPort.hpp:14
void setSvg(std::shared_ptr< window::Svg > svg)
If you don't add these to your ModuleWidget, they will fall out of the rack...
Definition SvgScrew.hpp:14
void setSvg(std::shared_ptr< window::Svg > svg)
Behaves like a knob but linearly moves an widget::SvgWidget between two points.
Definition SvgSlider.hpp:15
void setHandlePos(math::Vec minHandlePos, math::Vec maxHandlePos)
void setHandleSvg(std::shared_ptr< window::Svg > svg)
void setBackgroundSvg(std::shared_ptr< window::Svg > svg)
widget::SvgWidget * background
Definition SvgSlider.hpp:17
void setHandlePosCentered(math::Vec minHandlePosCentered, math::Vec maxHandlePosCentered)
A ParamWidget with multiple frames corresponding to its value.
Definition SvgSwitch.hpp:14
void addFrame(std::shared_ptr< window::Svg > svg)
Adds an SVG file to represent the next switch position.
CircularShadow * shadow
Definition SvgSwitch.hpp:19
bool latch
Use frames 0 and 1 when the mouse is pressed and released, instead of using the param value as the fr...
Definition SvgSwitch.hpp:25
bool momentary
Instead of incrementing values on each click, sets maxValue on press and minValue on release.
Definition Switch.hpp:21
Definition SvgPort.hpp:30
void setSvg(std::shared_ptr< window::Svg > lightSvg, std::shared_ptr< window::Svg > darkSvg)
Definition SvgPort.hpp:34
Definition SvgScrew.hpp:26
void setSvg(std::shared_ptr< window::Svg > lightSvg, std::shared_ptr< window::Svg > darkSvg)
Definition SvgScrew.hpp:30
Definition componentlibrary.hpp:652
widget::SvgWidget * bg
Definition componentlibrary.hpp:653
BefacoBigKnob()
Definition componentlibrary.hpp:655
Definition componentlibrary.hpp:905
BefacoPush()
Definition componentlibrary.hpp:906
Definition componentlibrary.hpp:681
BefacoSlidePot()
Definition componentlibrary.hpp:682
Definition componentlibrary.hpp:897
BefacoSwitch()
Definition componentlibrary.hpp:898
Definition componentlibrary.hpp:666
widget::SvgWidget * bg
Definition componentlibrary.hpp:667
BefacoTinyKnob()
Definition componentlibrary.hpp:669
Definition componentlibrary.hpp:834
CKD6()
Definition componentlibrary.hpp:835
Definition componentlibrary.hpp:825
CKSSThreeHorizontal()
Definition componentlibrary.hpp:826
Definition componentlibrary.hpp:816
CKSSThree()
Definition componentlibrary.hpp:817
Definition componentlibrary.hpp:808
CKSS()
Definition componentlibrary.hpp:809
Definition componentlibrary.hpp:781
CL1362Port()
Definition componentlibrary.hpp:782
Definition componentlibrary.hpp:763
DarkPJ301MPort()
Definition componentlibrary.hpp:764
Definition componentlibrary.hpp:353
Davies1900hBlackKnob()
Definition componentlibrary.hpp:354
Definition componentlibrary.hpp:334
Davies1900hKnob()
Definition componentlibrary.hpp:337
widget::SvgWidget * bg
Definition componentlibrary.hpp:335
Definition componentlibrary.hpp:374
Davies1900hLargeBlackKnob()
Definition componentlibrary.hpp:375
Definition componentlibrary.hpp:381
Davies1900hLargeRedKnob()
Definition componentlibrary.hpp:382
Definition componentlibrary.hpp:367
Davies1900hLargeWhiteKnob()
Definition componentlibrary.hpp:368
Definition componentlibrary.hpp:360
Davies1900hRedKnob()
Definition componentlibrary.hpp:361
Definition componentlibrary.hpp:346
Davies1900hWhiteKnob()
Definition componentlibrary.hpp:347
Definition componentlibrary.hpp:749
Deprecated.
Definition componentlibrary.hpp:746
Definition componentlibrary.hpp:747
Definition componentlibrary.hpp:750
Definition componentlibrary.hpp:748
Based on the size of 5mm LEDs.
Definition componentlibrary.hpp:155
LargeLight()
Definition componentlibrary.hpp:156
Based on the size of 5mm LEDs.
Definition componentlibrary.hpp:187
LargeSimpleLight()
Definition componentlibrary.hpp:188
An SvgSlider with an attached light.
Definition componentlibrary.hpp:708
app::ModuleLightWidget * light
Definition componentlibrary.hpp:709
LightSlider()
Definition componentlibrary.hpp:711
void step() override
Definition componentlibrary.hpp:720
app::ModuleLightWidget * getLight()
Definition componentlibrary.hpp:716
Based on the size of 3mm LEDs.
Definition componentlibrary.hpp:163
MediumLight()
Definition componentlibrary.hpp:164
Based on the size of 3mm LEDs.
Definition componentlibrary.hpp:195
MediumSimpleLight()
Definition componentlibrary.hpp:196
Definition componentlibrary.hpp:793
MomentarySwitch()
Definition componentlibrary.hpp:794
Definition componentlibrary.hpp:799
NKK()
Definition componentlibrary.hpp:800
A light to displayed over PB61303.
Definition componentlibrary.hpp:268
PB61303Light()
Definition componentlibrary.hpp:269
Definition componentlibrary.hpp:954
PB61303()
Definition componentlibrary.hpp:955
Definition componentlibrary.hpp:757
PJ301MPort()
Definition componentlibrary.hpp:758
Definition componentlibrary.hpp:775
PJ3410Port()
Definition componentlibrary.hpp:776
Definition componentlibrary.hpp:218
void drawLight(const widget::Widget::DrawArgs &args) override
Definition componentlibrary.hpp:239
void drawBackground(const widget::Widget::DrawArgs &args) override
Definition componentlibrary.hpp:219
Definition componentlibrary.hpp:589
Rogan1PBlue()
Definition componentlibrary.hpp:590
Definition componentlibrary.hpp:605
Rogan1PGreen()
Definition componentlibrary.hpp:606
Definition componentlibrary.hpp:597
Rogan1PRed()
Definition componentlibrary.hpp:598
Definition componentlibrary.hpp:557
Rogan1PSBlue()
Definition componentlibrary.hpp:558
Definition componentlibrary.hpp:573
Rogan1PSGreen()
Definition componentlibrary.hpp:574
Definition componentlibrary.hpp:565
Rogan1PSRed()
Definition componentlibrary.hpp:566
Definition componentlibrary.hpp:581
Rogan1PSWhite()
Definition componentlibrary.hpp:582
Definition componentlibrary.hpp:613
Rogan1PWhite()
Definition componentlibrary.hpp:614
Definition componentlibrary.hpp:525
Rogan2PBlue()
Definition componentlibrary.hpp:526
Definition componentlibrary.hpp:541
Rogan2PGreen()
Definition componentlibrary.hpp:542
Definition componentlibrary.hpp:533
Rogan2PRed()
Definition componentlibrary.hpp:534
Definition componentlibrary.hpp:493
Rogan2PSBlue()
Definition componentlibrary.hpp:494
Definition componentlibrary.hpp:509
Rogan2PSGreen()
Definition componentlibrary.hpp:510
Definition componentlibrary.hpp:501
Rogan2PSRed()
Definition componentlibrary.hpp:502
Definition componentlibrary.hpp:517
Rogan2PSWhite()
Definition componentlibrary.hpp:518
Definition componentlibrary.hpp:549
Rogan2PWhite()
Definition componentlibrary.hpp:550
Definition componentlibrary.hpp:485
Rogan2SGray()
Definition componentlibrary.hpp:486
Definition componentlibrary.hpp:453
Rogan3PBlue()
Definition componentlibrary.hpp:454
Definition componentlibrary.hpp:469
Rogan3PGreen()
Definition componentlibrary.hpp:470
Definition componentlibrary.hpp:461
Rogan3PRed()
Definition componentlibrary.hpp:462
Definition componentlibrary.hpp:421
Rogan3PSBlue()
Definition componentlibrary.hpp:422
Definition componentlibrary.hpp:437
Rogan3PSGreen()
Definition componentlibrary.hpp:438
Definition componentlibrary.hpp:429
Rogan3PSRed()
Definition componentlibrary.hpp:430
Definition componentlibrary.hpp:445
Rogan3PSWhite()
Definition componentlibrary.hpp:446
Definition componentlibrary.hpp:477
Rogan3PWhite()
Definition componentlibrary.hpp:478
Definition componentlibrary.hpp:413
Rogan5PSGray()
Definition componentlibrary.hpp:414
Definition componentlibrary.hpp:405
Rogan6PSWhite()
Definition componentlibrary.hpp:406
Definition componentlibrary.hpp:389
widget::SvgWidget * bg
Definition componentlibrary.hpp:390
widget::SvgWidget * fg
Definition componentlibrary.hpp:391
Rogan()
Definition componentlibrary.hpp:393
Definition componentlibrary.hpp:313
RoundBigBlackKnob()
Definition componentlibrary.hpp:314
Definition componentlibrary.hpp:292
RoundBlackKnob()
Definition componentlibrary.hpp:293
Definition componentlibrary.hpp:327
RoundBlackSnapKnob()
Definition componentlibrary.hpp:328
Definition componentlibrary.hpp:320
RoundHugeBlackKnob()
Definition componentlibrary.hpp:321
Definition componentlibrary.hpp:280
RoundKnob()
Definition componentlibrary.hpp:283
widget::SvgWidget * bg
Definition componentlibrary.hpp:281
Definition componentlibrary.hpp:306
RoundLargeBlackKnob()
Definition componentlibrary.hpp:307
Definition componentlibrary.hpp:299
RoundSmallBlackKnob()
Definition componentlibrary.hpp:300
Definition componentlibrary.hpp:971
ScrewBlack()
Definition componentlibrary.hpp:972
Definition componentlibrary.hpp:965
ScrewSilver()
Definition componentlibrary.hpp:966
Definition componentlibrary.hpp:984
void setLights(engine::Module *module, int firstLightId, int lightsLen)
Definition componentlibrary.hpp:999
float margin
Definition componentlibrary.hpp:987
int lightsLen
Definition componentlibrary.hpp:985
void draw(const DrawArgs &args) override
Draws the widget to the NanoVG context.
Definition componentlibrary.hpp:989
bool vertical
Definition componentlibrary.hpp:986
Based on the size of 2mm LEDs.
Definition componentlibrary.hpp:171
SmallLight()
Definition componentlibrary.hpp:172
Based on the size of 2mm LEDs.
Definition componentlibrary.hpp:203
SmallSimpleLight()
Definition componentlibrary.hpp:204
Definition componentlibrary.hpp:622
SynthTechAlco()
Definition componentlibrary.hpp:625
widget::SvgWidget * bg
Definition componentlibrary.hpp:623
Definition componentlibrary.hpp:118
TBlueLight()
Definition componentlibrary.hpp:119
Definition componentlibrary.hpp:110
TGreenLight()
Definition componentlibrary.hpp:111
Reads two adjacent lightIds, so lightId and lightId + 1 must be defined.
Definition componentlibrary.hpp:135
TGreenRedLight()
Definition componentlibrary.hpp:136
Definition componentlibrary.hpp:842
TL1105()
Definition componentlibrary.hpp:843
Definition componentlibrary.hpp:144
TRedGreenBlueLight()
Definition componentlibrary.hpp:145
Definition componentlibrary.hpp:102
TRedLight()
Definition componentlibrary.hpp:103
Definition componentlibrary.hpp:64
widget::SvgWidget * sw
Definition componentlibrary.hpp:66
widget::FramebufferWidget * fb
Definition componentlibrary.hpp:65
void setSvg(std::shared_ptr< Svg > svg)
Definition componentlibrary.hpp:76
TSvgLight()
Definition componentlibrary.hpp:68
Definition componentlibrary.hpp:94
TWhiteLight()
Definition componentlibrary.hpp:95
Definition componentlibrary.hpp:126
TYellowLight()
Definition componentlibrary.hpp:127
Definition componentlibrary.hpp:769
ThemedPJ301MPort()
Definition componentlibrary.hpp:770
Definition componentlibrary.hpp:977
ThemedScrew()
Definition componentlibrary.hpp:978
Based on the size of 1mm LEDs.
Definition componentlibrary.hpp:179
TinyLight()
Definition componentlibrary.hpp:180
Based on the size of 1mm LEDs.
Definition componentlibrary.hpp:211
TinySimpleLight()
Definition componentlibrary.hpp:212
Definition componentlibrary.hpp:637
Trimpot()
Definition componentlibrary.hpp:640
widget::SvgWidget * bg
Definition componentlibrary.hpp:638
Definition componentlibrary.hpp:921
VCVBezelLatch()
Definition componentlibrary.hpp:922
A light for displaying on top of VCVBezel.
Definition componentlibrary.hpp:255
VCVBezelLight()
Definition componentlibrary.hpp:256
Definition componentlibrary.hpp:913
VCVBezel()
Definition componentlibrary.hpp:914
Definition componentlibrary.hpp:859
VCVLatch()
Definition componentlibrary.hpp:860
Definition componentlibrary.hpp:947
VCVLightBezelLatch()
Definition componentlibrary.hpp:948
Definition componentlibrary.hpp:929
app::ModuleLightWidget * getLight()
Definition componentlibrary.hpp:939
VCVLightBezel()
Definition componentlibrary.hpp:932
app::ModuleLightWidget * light
Definition componentlibrary.hpp:930
Definition componentlibrary.hpp:890
VCVLightLatch()
Definition componentlibrary.hpp:891
Definition componentlibrary.hpp:739
VCVLightSlider()
Definition componentlibrary.hpp:740
Definition componentlibrary.hpp:730
VCVSliderLight()
Definition componentlibrary.hpp:731
Definition componentlibrary.hpp:692
VCVSlider()
Definition componentlibrary.hpp:693
DSP processor instance for your module.
Definition Module.hpp:29
Vec size
Definition math.hpp:303
Vec pos
Definition math.hpp:302
2-dimensional vector of floats, representing a point on the plane for graphics.
Definition math.hpp:189
Vec minus(Vec b) const
Definition math.hpp:212
Vec plus(Vec b) const
Definition math.hpp:209
Vec mult(float s) const
Definition math.hpp:215
float x
Definition math.hpp:190
float y
Definition math.hpp:191
Vec div(float s) const
Definition math.hpp:221
static std::shared_ptr< Svg > load(const std::string &filename)
Loads Svg from a cache.