VCV Rack API v2
Loading...
Searching...
No Matches
componentlibrary.hpp
Go to the documentation of this file.
1#pragma once
4#include <app/SvgKnob.hpp>
5#include <app/SvgSlider.hpp>
6#include <app/SvgPort.hpp>
8#include <app/SvgSwitch.hpp>
9#include <app/SvgScrew.hpp>
10#include <app/AudioDisplay.hpp>
11#include <app/MidiDisplay.hpp>
12#include <asset.hpp>
13
14
15namespace rack {
16
21namespace componentlibrary {
22
23
24using namespace window;
25
26
28// Color scheme
30
31static const NVGcolor SCHEME_BLACK_TRANSPARENT = nvgRGBA(0x00, 0x00, 0x00, 0x00);
32static const NVGcolor SCHEME_BLACK = nvgRGB(0x00, 0x00, 0x00);
33static const NVGcolor SCHEME_WHITE = nvgRGB(0xff, 0xff, 0xff);
34static const NVGcolor SCHEME_RED = nvgRGB(0xed, 0x2c, 0x24);
35static const NVGcolor SCHEME_ORANGE = nvgRGB(0xf2, 0xb1, 0x20);
36static const NVGcolor SCHEME_YELLOW = nvgRGB(0xff, 0xd7, 0x14);
37static const NVGcolor SCHEME_GREEN = nvgRGB(0x90, 0xc7, 0x3e);
38static const NVGcolor SCHEME_CYAN = nvgRGB(0x22, 0xe6, 0xef);
39static const NVGcolor SCHEME_BLUE = nvgRGB(0x29, 0xb2, 0xef);
40static const NVGcolor SCHEME_PURPLE = nvgRGB(0xd5, 0x2b, 0xed);
41static const NVGcolor SCHEME_LIGHT_GRAY = nvgRGB(0xe6, 0xe6, 0xe6);
42static const NVGcolor SCHEME_DARK_GRAY = nvgRGB(0x17, 0x17, 0x17);
43
44
46// Lights
48
49/*
50Many of these classes use CRTP (https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern).
51
52To use a red light with its default base class for example, use `RedLight` or `TRedLight<>`. (They are synonymous.)
53
54Use the `TBase` template argument if you want a different base class.
55E.g. `RectangleLight<RedLight>`
56
57Although this paradigm might seem confusing at first, it ends up being extremely simple in your plugin code and perfect for "decorating" your classes with appearance traits and behavioral properties.
58For example, need a slider with a green LED? Just use
59
60 createLightParamCentered<VCVLightSlider<GreenLight>>(...)
61*/
62
63template <typename TBase = app::ModuleLightWidget>
64struct TSvgLight : TBase {
67
70 this->addChild(fb);
71
73 fb->addChild(sw);
74 }
75
76 void setSvg(std::shared_ptr<Svg> svg) {
77 sw->setSvg(svg);
78 fb->box.size = sw->box.size;
79 this->box.size = sw->box.size;
80 }
81};
83
84template <typename TBase = app::ModuleLightWidget>
85struct TGrayModuleLightWidget : TBase {
87 this->bgColor = nvgRGBA(0x33, 0x33, 0x33, 0xff);
88 this->borderColor = nvgRGBA(0, 0, 0, 53);
89 }
90};
92
93template <typename TBase = GrayModuleLightWidget>
94struct TWhiteLight : TBase {
96 this->addBaseColor(SCHEME_WHITE);
97 }
98};
100
101template <typename TBase = GrayModuleLightWidget>
102struct TRedLight : TBase {
104 this->addBaseColor(SCHEME_RED);
105 }
106};
108
109template <typename TBase = GrayModuleLightWidget>
110struct TGreenLight : TBase {
112 this->addBaseColor(SCHEME_GREEN);
113 }
114};
116
117template <typename TBase = GrayModuleLightWidget>
118struct TBlueLight : TBase {
120 this->addBaseColor(SCHEME_BLUE);
121 }
122};
124
125template <typename TBase = GrayModuleLightWidget>
126struct TYellowLight : TBase {
128 this->addBaseColor(SCHEME_YELLOW);
129 }
130};
132
134template <typename TBase = GrayModuleLightWidget>
135struct TGreenRedLight : TBase {
137 this->addBaseColor(SCHEME_GREEN);
138 this->addBaseColor(SCHEME_RED);
139 }
140};
142
143template <typename TBase = GrayModuleLightWidget>
144struct TRedGreenBlueLight : TBase {
146 this->addBaseColor(SCHEME_RED);
147 this->addBaseColor(SCHEME_GREEN);
148 this->addBaseColor(SCHEME_BLUE);
149 }
150};
152
154template <typename TBase>
155struct LargeLight : TSvgLight<TBase> {
157 this->setSvg(Svg::load(asset::system("res/ComponentLibrary/LargeLight.svg")));
158 }
159};
160
162template <typename TBase>
163struct MediumLight : TSvgLight<TBase> {
165 this->setSvg(Svg::load(asset::system("res/ComponentLibrary/MediumLight.svg")));
166 }
167};
168
170template <typename TBase>
171struct SmallLight : TSvgLight<TBase> {
173 this->setSvg(Svg::load(asset::system("res/ComponentLibrary/SmallLight.svg")));
174 }
175};
176
178template <typename TBase>
179struct TinyLight : TSvgLight<TBase> {
181 this->setSvg(Svg::load(asset::system("res/ComponentLibrary/TinyLight.svg")));
182 }
183};
184
186template <typename TBase = GrayModuleLightWidget>
187struct LargeSimpleLight : TBase {
189 this->box.size = mm2px(math::Vec(5, 5));
190 }
191};
192
194template <typename TBase = GrayModuleLightWidget>
195struct MediumSimpleLight : TBase {
197 this->box.size = mm2px(math::Vec(3, 3));
198 }
199};
200
202template <typename TBase = GrayModuleLightWidget>
203struct SmallSimpleLight : TBase {
205 this->box.size = mm2px(math::Vec(2, 2));
206 }
207};
208
210template <typename TBase = GrayModuleLightWidget>
211struct TinySimpleLight : TBase {
213 this->box.size = mm2px(math::Vec(1, 1));
214 }
215};
216
217template <typename TBase>
218struct RectangleLight : TBase {
219 void drawBackground(const widget::Widget::DrawArgs& args) override {
220 // Derived from LightWidget::drawBackground()
221
222 nvgBeginPath(args.vg);
223 nvgRect(args.vg, 0, 0, this->box.size.x, this->box.size.y);
224
225 // Background
226 if (this->bgColor.a > 0.0) {
227 nvgFillColor(args.vg, this->bgColor);
228 nvgFill(args.vg);
229 }
230
231 // Border
232 if (this->borderColor.a > 0.0) {
233 nvgStrokeWidth(args.vg, 0.5);
234 nvgStrokeColor(args.vg, this->borderColor);
235 nvgStroke(args.vg);
236 }
237 }
238
239 void drawLight(const widget::Widget::DrawArgs& args) override {
240 // Derived from LightWidget::drawLight()
241
242 // Foreground
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);
246
247 nvgFillColor(args.vg, this->color);
248 nvgFill(args.vg);
249 }
250 }
251};
252
254template <typename TBase>
255struct VCVBezelLight : TBase {
257 this->borderColor = color::BLACK_TRANSPARENT;
258 this->bgColor = color::BLACK_TRANSPARENT;
259 this->box.size = math::Vec(17.545, 17.545);
260 }
261};
262template <typename TBase>
264
267template <typename TBase>
268struct PB61303Light : TBase {
270 this->bgColor = color::BLACK_TRANSPARENT;
271 this->box.size = mm2px(math::Vec(9.0, 9.0));
272 }
273};
274
275
277// Knobs
279
282
284 minAngle = -0.83 * M_PI;
285 maxAngle = 0.83 * M_PI;
286
287 bg = new widget::SvgWidget;
289 }
290};
291
294 setSvg(Svg::load(asset::system("res/ComponentLibrary/RoundBlackKnob.svg")));
295 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/RoundBlackKnob_bg.svg")));
296 }
297};
298
301 setSvg(Svg::load(asset::system("res/ComponentLibrary/RoundSmallBlackKnob.svg")));
302 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/RoundSmallBlackKnob_bg.svg")));
303 }
304};
305
308 setSvg(Svg::load(asset::system("res/ComponentLibrary/RoundLargeBlackKnob.svg")));
309 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/RoundLargeBlackKnob_bg.svg")));
310 }
311};
312
315 setSvg(Svg::load(asset::system("res/ComponentLibrary/RoundBigBlackKnob.svg")));
316 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/RoundBigBlackKnob_bg.svg")));
317 }
318};
319
322 setSvg(Svg::load(asset::system("res/ComponentLibrary/RoundHugeBlackKnob.svg")));
323 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/RoundHugeBlackKnob_bg.svg")));
324 }
325};
326
329 snap = true;
330 }
331};
332
333
336
338 minAngle = -0.83 * M_PI;
339 maxAngle = 0.83 * M_PI;
340
341 bg = new widget::SvgWidget;
343 }
344};
345
348 setSvg(Svg::load(asset::system("res/ComponentLibrary/Davies1900hWhite.svg")));
349 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Davies1900hWhite_bg.svg")));
350 }
351};
352
355 setSvg(Svg::load(asset::system("res/ComponentLibrary/Davies1900hBlack.svg")));
356 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Davies1900hBlack_bg.svg")));
357 }
358};
359
362 setSvg(Svg::load(asset::system("res/ComponentLibrary/Davies1900hRed.svg")));
363 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Davies1900hRed_bg.svg")));
364 }
365};
366
369 setSvg(Svg::load(asset::system("res/ComponentLibrary/Davies1900hLargeWhite.svg")));
370 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Davies1900hLargeWhite_bg.svg")));
371 }
372};
373
376 setSvg(Svg::load(asset::system("res/ComponentLibrary/Davies1900hLargeBlack.svg")));
377 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Davies1900hLargeBlack_bg.svg")));
378 }
379};
380
383 setSvg(Svg::load(asset::system("res/ComponentLibrary/Davies1900hLargeRed.svg")));
384 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Davies1900hLargeRed_bg.svg")));
385 }
386};
387
388
392
394 minAngle = -0.83 * M_PI;
395 maxAngle = 0.83 * M_PI;
396
397 bg = new widget::SvgWidget;
399
400 fg = new widget::SvgWidget;
402 }
403};
404
407 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan6PSWhite.svg")));
408 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan6PS_bg.svg")));
409 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan6PSWhite_fg.svg")));
410 }
411};
412
415 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan5PSGray.svg")));
416 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan5PS_bg.svg")));
417 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan5PSGray_fg.svg")));
418 }
419};
420
423 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PSBlue.svg")));
424 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PS_bg.svg")));
425 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PSBlue_fg.svg")));
426 }
427};
428
431 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PSRed.svg")));
432 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PS_bg.svg")));
433 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PSRed_fg.svg")));
434 }
435};
436
439 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PSGreen.svg")));
440 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PS_bg.svg")));
441 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PSGreen_fg.svg")));
442 }
443};
444
447 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PSWhite.svg")));
448 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PS_bg.svg")));
449 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PSWhite_fg.svg")));
450 }
451};
452
455 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PBlue.svg")));
456 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3P_bg.svg")));
457 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PBlue_fg.svg")));
458 }
459};
460
463 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PRed.svg")));
464 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3P_bg.svg")));
465 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PRed_fg.svg")));
466 }
467};
468
471 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PGreen.svg")));
472 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3P_bg.svg")));
473 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PGreen_fg.svg")));
474 }
475};
476
479 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PWhite.svg")));
480 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3P_bg.svg")));
481 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan3PWhite_fg.svg")));
482 }
483};
484
487 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2SGray.svg")));
488 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2S_bg.svg")));
489 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2SGray_fg.svg")));
490 }
491};
492
495 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PSBlue.svg")));
496 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PS_bg.svg")));
497 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PSBlue_fg.svg")));
498 }
499};
500
503 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PSRed.svg")));
504 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PS_bg.svg")));
505 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PSRed_fg.svg")));
506 }
507};
508
511 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PSGreen.svg")));
512 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PS_bg.svg")));
513 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PSGreen_fg.svg")));
514 }
515};
516
519 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PSWhite.svg")));
520 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PS_bg.svg")));
521 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PSWhite_fg.svg")));
522 }
523};
524
527 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PBlue.svg")));
528 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2P_bg.svg")));
529 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PBlue_fg.svg")));
530 }
531};
532
535 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PRed.svg")));
536 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2P_bg.svg")));
537 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PRed_fg.svg")));
538 }
539};
540
543 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PGreen.svg")));
544 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2P_bg.svg")));
545 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PGreen_fg.svg")));
546 }
547};
548
551 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PWhite.svg")));
552 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2P_bg.svg")));
553 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan2PWhite_fg.svg")));
554 }
555};
556
559 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PSBlue.svg")));
560 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PS_bg.svg")));
561 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PSBlue_fg.svg")));
562 }
563};
564
567 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PSRed.svg")));
568 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PS_bg.svg")));
569 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PSRed_fg.svg")));
570 }
571};
572
575 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PSGreen.svg")));
576 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PS_bg.svg")));
577 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PSGreen_fg.svg")));
578 }
579};
580
583 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PSWhite.svg")));
584 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PS_bg.svg")));
585 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PSWhite_fg.svg")));
586 }
587};
588
591 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PBlue.svg")));
592 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1P_bg.svg")));
593 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PBlue_fg.svg")));
594 }
595};
596
599 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PRed.svg")));
600 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1P_bg.svg")));
601 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PRed_fg.svg")));
602 }
603};
604
607 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PGreen.svg")));
608 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1P_bg.svg")));
609 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PGreen_fg.svg")));
610 }
611};
612
615 setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PWhite.svg")));
616 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1P_bg.svg")));
617 fg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Rogan1PWhite_fg.svg")));
618 }
619};
620
621
624
626 minAngle = -0.82 * M_PI;
627 maxAngle = 0.82 * M_PI;
628
629 bg = new widget::SvgWidget;
631
632 setSvg(Svg::load(asset::system("res/ComponentLibrary/SynthTechAlco.svg")));
633 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/SynthTechAlco_bg.svg")));
634 }
635};
636
639
641 minAngle = -0.75 * M_PI;
642 maxAngle = 0.75 * M_PI;
643
644 bg = new widget::SvgWidget;
646
647 setSvg(Svg::load(asset::system("res/ComponentLibrary/Trimpot.svg")));
648 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/Trimpot_bg.svg")));
649 }
650};
651
654
656 minAngle = -0.75 * M_PI;
657 maxAngle = 0.75 * M_PI;
658 setSvg(Svg::load(asset::system("res/ComponentLibrary/BefacoBigKnob.svg")));
659
660 bg = new widget::SvgWidget;
662 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/BefacoBigKnob_bg.svg")));
663 }
664};
665
668
670 minAngle = -0.8 * M_PI;
671 maxAngle = 0.8 * M_PI;
672
673 bg = new widget::SvgWidget;
675
676 setSvg(Svg::load(asset::system("res/ComponentLibrary/BefacoTinyPointBlack.svg")));
677 bg->setSvg(Svg::load(asset::system("res/ComponentLibrary/BefacoTinyKnobWhite_bg.svg")));
678 }
679};
680
683 setBackgroundSvg(Svg::load(asset::system("res/ComponentLibrary/BefacoSlidePot.svg")));
684 setHandleSvg(Svg::load(asset::system("res/ComponentLibrary/BefacoSlidePotHandle.svg")));
685 math::Vec margin = math::Vec(3.5, 3.5);
686 setHandlePos(math::Vec(-1, 87).plus(margin), math::Vec(-1, -2).plus(margin));
687 background->box.pos = margin;
688 box.size = background->box.size.plus(margin.mult(2));
689 }
690};
691
694 setBackgroundSvg(Svg::load(asset::system("res/ComponentLibrary/VCVSlider.svg")));
695 setHandleSvg(Svg::load(asset::system("res/ComponentLibrary/VCVSliderHandle.svg")));
697 math::Vec(19.84260/2, 76.53517 - 11.74218/2),
698 math::Vec(19.84260/2, 0.0 + 11.74218/2)
699 );
700 }
701};
703
706 horizontal = true;
707 // TODO Fix SVG
708 setBackgroundSvg(Svg::load(asset::system("res/ComponentLibrary/VCVSliderHorizontal.svg")));
709 // TODO Fix positions
710 setHandlePos(mm2px(math::Vec(0.738, 0.738).plus(math::Vec(0, 2))), mm2px(math::Vec(22.078, 0.738).plus(math::Vec(0, 2))));
711 }
712};
714
718template <typename TBase, typename TLightBase = RedLight>
719struct LightSlider : TBase {
721
723 light = new TLightBase;
724 this->addChild(light);
725 }
726
728 return light;
729 }
730
731 void step() override {
732 TBase::step();
733 // Move center of light to center of handle
734 light->box.pos = this->handle->box.pos
735 .plus(this->handle->box.size.div(2))
736 .minus(light->box.size.div(2));
737 }
738};
739
740template <typename TBase>
741struct VCVSliderLight : RectangleLight<TSvgLight<TBase>> {
743 this->setSvg(Svg::load(asset::system("res/ComponentLibrary/VCVSliderLight.svg")));
744 }
745};
746template <typename TBase>
748
749template <typename TLightBase = RedLight>
750struct VCVLightSlider : LightSlider<VCVSlider, VCVSliderLight<TLightBase>> {
752};
753template <typename TLightBase = RedLight>
755
757struct LEDSliderGreen : VCVLightSlider<GreenLight> {};
758struct LEDSliderRed : VCVLightSlider<RedLight> {};
759struct LEDSliderYellow : VCVLightSlider<YellowLight> {};
760struct LEDSliderBlue : VCVLightSlider<BlueLight> {};
761struct LEDSliderWhite : VCVLightSlider<WhiteLight> {};
762
763template <typename TLightBase = RedLight>
764struct VCVLightSliderHorizontal : LightSlider<VCVSliderHorizontal, TLightBase> {
766 // TODO Fix positions
767 this->light->box.size = mm2px(math::Vec(3.276, 1.524));
768 // TODO Fix SVG
769 this->setHandleSvg(Svg::load(asset::system("res/ComponentLibrary/VCVSliderHorizontalHandle.svg")));
770 }
771};
772template <typename TLightBase = RedLight>
774
775
777// Ports
779
782 setSvg(Svg::load(asset::system("res/ComponentLibrary/PJ301M.svg")));
783 }
784};
785
788 setSvg(Svg::load(asset::system("res/ComponentLibrary/PJ301M-dark.svg")));
789 }
790};
791
794 setSvg(Svg::load(asset::system("res/ComponentLibrary/PJ301M.svg")), Svg::load(asset::system("res/ComponentLibrary/PJ301M-dark.svg")));
795 }
796};
797
800 setSvg(Svg::load(asset::system("res/ComponentLibrary/PJ3410.svg")));
801 }
802};
803
806 setSvg(Svg::load(asset::system("res/ComponentLibrary/CL1362.svg")));
807 }
808};
809
810
812// Switches
814
815template <typename TSwitch>
816struct MomentarySwitch : TSwitch {
818 this->momentary = true;
819 }
820};
821
823 NKK() {
824 shadow->opacity = 0.0;
825 addFrame(Svg::load(asset::system("res/ComponentLibrary/NKK_0.svg")));
826 addFrame(Svg::load(asset::system("res/ComponentLibrary/NKK_1.svg")));
827 addFrame(Svg::load(asset::system("res/ComponentLibrary/NKK_2.svg")));
828 }
829};
830
833 shadow->opacity = 0.0;
834 addFrame(Svg::load(asset::system("res/ComponentLibrary/CKSS_0.svg")));
835 addFrame(Svg::load(asset::system("res/ComponentLibrary/CKSS_1.svg")));
836 }
837};
838
841 shadow->opacity = 0.0;
842 addFrame(Svg::load(asset::system("res/ComponentLibrary/CKSSThree_0.svg")));
843 addFrame(Svg::load(asset::system("res/ComponentLibrary/CKSSThree_1.svg")));
844 addFrame(Svg::load(asset::system("res/ComponentLibrary/CKSSThree_2.svg")));
845 }
846};
847
850 shadow->opacity = 0.0;
851 addFrame(Svg::load(asset::system("res/ComponentLibrary/CKSSThreeHorizontal_0.svg")));
852 addFrame(Svg::load(asset::system("res/ComponentLibrary/CKSSThreeHorizontal_1.svg")));
853 addFrame(Svg::load(asset::system("res/ComponentLibrary/CKSSThreeHorizontal_2.svg")));
854 }
855};
856
859 momentary = true;
860 addFrame(Svg::load(asset::system("res/ComponentLibrary/CKD6_0.svg")));
861 addFrame(Svg::load(asset::system("res/ComponentLibrary/CKD6_1.svg")));
862 }
863};
864
867 momentary = true;
868 addFrame(Svg::load(asset::system("res/ComponentLibrary/TL1105_0.svg")));
869 addFrame(Svg::load(asset::system("res/ComponentLibrary/TL1105_1.svg")));
870 }
871};
872
875 momentary = true;
876 addFrame(Svg::load(asset::system("res/ComponentLibrary/VCVButton_0.svg")));
877 addFrame(Svg::load(asset::system("res/ComponentLibrary/VCVButton_1.svg")));
878 }
879};
881
884 momentary = false;
885 latch = true;
886 }
887};
888
889template <typename TBase, typename TLight = WhiteLight>
890struct LightButton : TBase {
892
894 light = new TLight;
895 // Move center of light to center of box
896 light->box.pos = this->box.size.div(2).minus(light->box.size.div(2));
897 this->addChild(light);
898 }
899
901 return light;
902 }
903};
904
905template <typename TLight = WhiteLight>
907
909template <typename TLight>
911
912template <typename TLight>
915 this->momentary = false;
916 this->latch = true;
917 }
918};
919
922 addFrame(Svg::load(asset::system("res/ComponentLibrary/BefacoSwitch_0.svg")));
923 addFrame(Svg::load(asset::system("res/ComponentLibrary/BefacoSwitch_1.svg")));
924 addFrame(Svg::load(asset::system("res/ComponentLibrary/BefacoSwitch_2.svg")));
925 }
926};
927
930 momentary = true;
931 addFrame(Svg::load(asset::system("res/ComponentLibrary/BefacoPush_0.svg")));
932 addFrame(Svg::load(asset::system("res/ComponentLibrary/BefacoPush_1.svg")));
933 }
934};
935
938 momentary = true;
939 addFrame(Svg::load(asset::system("res/ComponentLibrary/VCVBezel.svg")));
940 }
941};
943
946 momentary = false;
947 latch = true;
948 }
949};
950
951template <typename TLightBase = WhiteLight>
954
957 // Move center of light to center of box
960 }
961
963 return light;
964 }
965};
966template <typename TLightBase = WhiteLight>
968
969template <typename TLightBase = WhiteLight>
970struct VCVLightBezelLatch : VCVLightBezel<TLightBase> {
972 this->momentary = false;
973 this->latch = true;
974 }
975};
976
979 momentary = true;
980 addFrame(Svg::load(asset::system("res/ComponentLibrary/PB61303.svg")));
981 }
982};
983
985// Misc
987
990 setSvg(Svg::load(asset::system("res/ComponentLibrary/ScrewSilver.svg")));
991 }
992};
993
996 setSvg(Svg::load(asset::system("res/ComponentLibrary/ScrewBlack.svg")));
997 }
998};
999
1002 setSvg(Svg::load(asset::system("res/ComponentLibrary/ScrewSilver.svg")), Svg::load(asset::system("res/ComponentLibrary/ScrewBlack.svg")));
1003 }
1004};
1005
1006
1008 int lightsLen = 0;
1009 bool vertical = false;
1010 float margin = mm2px(0.5);
1011
1012 void draw(const DrawArgs& args) override {
1013 // Background
1014 nvgBeginPath(args.vg);
1015 nvgRect(args.vg, 0, 0, box.size.x, box.size.y);
1016 nvgFillColor(args.vg, color::BLACK);
1017 nvgFill(args.vg);
1018 Widget::draw(args);
1019 }
1020
1021 template <typename TLightBase = WhiteLight>
1022 void setLights(engine::Module* module, int firstLightId, int lightsLen) {
1023 clearChildren();
1024 this->lightsLen = lightsLen;
1025 float r = (vertical ? box.size.y : box.size.x) - margin;
1026 for (int i = 0; i < lightsLen; i++) {
1027 float p = float(i) / lightsLen;
1029 if (vertical) {
1030 light->box.pos.y = p * r + margin;
1031 light->box.size.y = r / lightsLen - margin;
1032 light->box.size.x = box.size.x;
1033 }
1034 else {
1035 light->box.pos.x = p * r + margin;
1036 light->box.size.x = r / lightsLen - margin;
1037 light->box.size.y = box.size.y;
1038 }
1039 light->module = module;
1040 light->firstLightId = firstLightId;
1041 firstLightId += light->baseColors.size();
1042 addChild(light);
1043 }
1044 }
1045};
1046
1047
1050 addFrame(Svg::load(asset::system("res/ComponentLibrary/ADAT.svg")));
1051 shadow->opacity = 0.0;
1052 }
1053};
1054
1055
1058 addFrame(Svg::load(asset::system("res/ComponentLibrary/USB_B.svg")));
1059 shadow->opacity = 0.0;
1060 }
1061};
1062
1063
1066 addFrame(Svg::load(asset::system("res/ComponentLibrary/MIDI_DIN.svg")));
1067 shadow->opacity = 0.0;
1068 }
1069};
1070
1071
1072} // namespace componentlibrary
1073} // namespace rack
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
A virtual audio port graphic that displays an audio menu when clicked.
Definition AudioDisplay.hpp:60
float opacity
Definition CircularShadow.hpp:12
bool horizontal
Drag horizontally instead of vertically.
Definition Knob.hpp:17
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
NVGcolor borderColor
Definition LightWidget.hpp:13
NVGcolor bgColor
Definition LightWidget.hpp:11
A virtual MIDI port graphic that displays an MIDI menu when clicked.
Definition MidiDisplay.hpp:45
A MultiLightWidget that points to a module's Light or a range of lights Will access firstLightId,...
Definition ModuleLightWidget.hpp:15
int firstLightId
Definition ModuleLightWidget.hpp:20
std::vector< NVGcolor > baseColors
Colors of each value state.
Definition MultiLightWidget.hpp:13
void addBaseColor(NVGcolor baseColor)
CircularShadow * shadow
Definition SvgButton.hpp:15
void addFrame(std::shared_ptr< window::Svg > svg)
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:1048
AudioButton_ADAT()
Definition componentlibrary.hpp:1049
Definition componentlibrary.hpp:1056
AudioButton_USB_B()
Definition componentlibrary.hpp:1057
Definition componentlibrary.hpp:652
widget::SvgWidget * bg
Definition componentlibrary.hpp:653
BefacoBigKnob()
Definition componentlibrary.hpp:655
Definition componentlibrary.hpp:928
BefacoPush()
Definition componentlibrary.hpp:929
Definition componentlibrary.hpp:681
BefacoSlidePot()
Definition componentlibrary.hpp:682
Definition componentlibrary.hpp:920
BefacoSwitch()
Definition componentlibrary.hpp:921
Definition componentlibrary.hpp:666
widget::SvgWidget * bg
Definition componentlibrary.hpp:667
BefacoTinyKnob()
Definition componentlibrary.hpp:669
Definition componentlibrary.hpp:857
CKD6()
Definition componentlibrary.hpp:858
Definition componentlibrary.hpp:848
CKSSThreeHorizontal()
Definition componentlibrary.hpp:849
Definition componentlibrary.hpp:839
CKSSThree()
Definition componentlibrary.hpp:840
Definition componentlibrary.hpp:831
CKSS()
Definition componentlibrary.hpp:832
Definition componentlibrary.hpp:804
CL1362Port()
Definition componentlibrary.hpp:805
Definition componentlibrary.hpp:786
DarkPJ301MPort()
Definition componentlibrary.hpp:787
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:760
Deprecated.
Definition componentlibrary.hpp:757
Definition componentlibrary.hpp:758
Definition componentlibrary.hpp:761
Definition componentlibrary.hpp:759
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
Definition componentlibrary.hpp:890
LightButton()
Definition componentlibrary.hpp:893
app::ModuleLightWidget * light
Definition componentlibrary.hpp:891
app::ModuleLightWidget * getLight()
Definition componentlibrary.hpp:900
An SvgSlider with an attached light.
Definition componentlibrary.hpp:719
app::ModuleLightWidget * light
Definition componentlibrary.hpp:720
LightSlider()
Definition componentlibrary.hpp:722
void step() override
Definition componentlibrary.hpp:731
app::ModuleLightWidget * getLight()
Definition componentlibrary.hpp:727
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:1064
MidiButton_MIDI_DIN()
Definition componentlibrary.hpp:1065
Definition componentlibrary.hpp:816
MomentarySwitch()
Definition componentlibrary.hpp:817
Definition componentlibrary.hpp:822
NKK()
Definition componentlibrary.hpp:823
A light to displayed over PB61303.
Definition componentlibrary.hpp:268
PB61303Light()
Definition componentlibrary.hpp:269
Definition componentlibrary.hpp:977
PB61303()
Definition componentlibrary.hpp:978
Definition componentlibrary.hpp:780
PJ301MPort()
Definition componentlibrary.hpp:781
Definition componentlibrary.hpp:798
PJ3410Port()
Definition componentlibrary.hpp:799
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:994
ScrewBlack()
Definition componentlibrary.hpp:995
Definition componentlibrary.hpp:988
ScrewSilver()
Definition componentlibrary.hpp:989
Definition componentlibrary.hpp:1007
void setLights(engine::Module *module, int firstLightId, int lightsLen)
Definition componentlibrary.hpp:1022
float margin
Definition componentlibrary.hpp:1010
int lightsLen
Definition componentlibrary.hpp:1008
void draw(const DrawArgs &args) override
Draws the widget to the NanoVG context.
Definition componentlibrary.hpp:1012
bool vertical
Definition componentlibrary.hpp:1009
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:85
TGrayModuleLightWidget()
Definition componentlibrary.hpp:86
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:865
TL1105()
Definition componentlibrary.hpp:866
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:792
ThemedPJ301MPort()
Definition componentlibrary.hpp:793
Definition componentlibrary.hpp:1000
ThemedScrew()
Definition componentlibrary.hpp:1001
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:944
VCVBezelLatch()
Definition componentlibrary.hpp:945
A light for displaying on top of VCVBezel.
Definition componentlibrary.hpp:255
VCVBezelLight()
Definition componentlibrary.hpp:256
Definition componentlibrary.hpp:936
VCVBezel()
Definition componentlibrary.hpp:937
Definition componentlibrary.hpp:873
VCVButton()
Definition componentlibrary.hpp:874
Definition componentlibrary.hpp:882
VCVLatch()
Definition componentlibrary.hpp:883
Definition componentlibrary.hpp:970
VCVLightBezelLatch()
Definition componentlibrary.hpp:971
Definition componentlibrary.hpp:952
app::ModuleLightWidget * getLight()
Definition componentlibrary.hpp:962
VCVLightBezel()
Definition componentlibrary.hpp:955
app::ModuleLightWidget * light
Definition componentlibrary.hpp:953
Definition componentlibrary.hpp:913
VCVLightLatch()
Definition componentlibrary.hpp:914
Definition componentlibrary.hpp:764
VCVLightSliderHorizontal()
Definition componentlibrary.hpp:765
Definition componentlibrary.hpp:750
VCVLightSlider()
Definition componentlibrary.hpp:751
Definition componentlibrary.hpp:704
VCVSliderHorizontal()
Definition componentlibrary.hpp:705
Definition componentlibrary.hpp:741
VCVSliderLight()
Definition componentlibrary.hpp:742
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
Caches its children's draw() result to a framebuffer image.
Definition FramebufferWidget.hpp:12
Owns and draws a window::Svg.
Definition SvgWidget.hpp:10
void setSvg(std::shared_ptr< window::Svg > svg)
Sets and wraps the SVG.
Definition Widget.hpp:141
NVGcontext * vg
Definition Widget.hpp:142
A node in the 2D scene graph.
Definition Widget.hpp:21
void addChildAbove(Widget *child, Widget *sibling)
void clearChildren()
Removes and deletes all child Widgets.
math::Rect box
Position relative to parent and size of widget.
Definition Widget.hpp:23
void addChild(Widget *child)
Adds widget to the top of the children.
void addChildBelow(Widget *child, Widget *sibling)
Adds widget directly below another widget.
virtual void draw(const DrawArgs &args)
Draws the widget to the NanoVG context.
static std::shared_ptr< Svg > load(const std::string &filename)
Loads Svg from a cache.