diff --git a/Makefile b/Makefile index 05b70f6..1749076 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ RACK_DIR ?= ../.. # FLAGS will be passed to both the C and C++ compiler FLAGS += CFLAGS += -CXXFLAGS += -Idep +CXXFLAGS += -Idep/QuickJS # Careful about linking to shared libraries, since you can't assume much about the user's environment and library search path. # Static libraries are fine, but they should be added to this plugin's build system. diff --git a/README.md b/README.md index 803150d..66a4a63 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Hiya hello hey hi what’s hip love, I’m Aria Salvatrice. I’m a French expat I make [Gay Baroque Technopop](https://soundcloud.com/ariasalvatrice) and [Pastoral Industrial](https://ariasalvatrice.bandcamp.com/) music happen, and made a buncha virtual synth modules for my own use. They are the Aria Salvatrice Signature Series. They’re growing into an integrated system for performing aleatoric techno. Lotsa artists found them inspiring for many genres of music. You can grab them for free! -They are part of [Cardinal](https://github.com/DISTRHO/Cardinal), which is currently the only supportedh ost. +They are part of [Cardinal](https://github.com/DISTRHO/Cardinal), which is currently the only supported host. They are not supported in VCV Rack 2, due to [their behavior towards third-party contributors, and inclusion of women](https://aria.dog/barks/why-i-will-never-create-modules-for-vcv-rack-anymore/). Bug reports you cannot reproduce in a supported host will not be accepted. diff --git a/src/Darius.cpp b/src/Darius.cpp index fcdf84e..03d1416 100644 --- a/src/Darius.cpp +++ b/src/Darius.cpp @@ -161,9 +161,9 @@ struct Darius : Module { configParam(KEY_PARAM, 0.f, 11.f, 0.f, "Key"); configParam(SCALE_PARAM, 0.f, (float) Quantizer::NUM_SCALES - 1, 2.f, "Scale"); configParam(SLIDE_PARAM, 0.f, 10.f, 0.f, "Slide"); - for (size_t i = 0; i < STEP9START; i++) + for (size_t i = 0; i < 36; i++) configParam(CV_PARAM + i, 0.f, 10.f, 5.f, "CV"); - for (size_t i = 0; i < STEP8START; i++) + for (size_t i = 0; i < 36; i++) configParam(ROUTE_PARAM + i, 0.f, 1.f, 0.5f, "Random route"); displayDivider.setDivision(DISPLAYDIVIDER); processDivider.setDivision(PROCESSDIVIDER); @@ -1024,8 +1024,9 @@ struct Darius : Module { struct KnobLcd : W::Knob { void onDragMove(const event::DragMove& e) override { - dynamic_cast(paramQuantity->module)->lcdLastInteraction = 0.f; - dynamic_cast(paramQuantity->module)->lcdStatus.dirty = true; + ParamQuantity* const paramQuantity = getParamQuantity(); + dynamic_cast(paramQuantity->module)->lcdLastInteraction = 0.f; + dynamic_cast(paramQuantity->module)->lcdStatus.dirty = true; W::Knob::onDragMove(e); } }; @@ -1033,7 +1034,8 @@ struct KnobLcd : W::Knob { struct KnobMinMax : KnobLcd { void onDragMove(const event::DragMove& e) override { - dynamic_cast(paramQuantity->module)->lcdMode = MINMAX_MODE; + ParamQuantity* const paramQuantity = getParamQuantity(); + dynamic_cast(paramQuantity->module)->lcdMode = MINMAX_MODE; KnobLcd::onDragMove(e); } }; @@ -1041,16 +1043,17 @@ struct KnobMinMax : KnobLcd { struct KnobScale : KnobLcd { KnobScale() { snap = true; - KnobLcd(); } void onDragMove(const event::DragMove& e) override { - dynamic_cast(paramQuantity->module)->lcdMode = SCALE_MODE; + ParamQuantity* const paramQuantity = getParamQuantity(); + dynamic_cast(paramQuantity->module)->lcdMode = SCALE_MODE; KnobLcd::onDragMove(e); } }; struct KnobSlide : KnobLcd { void onDragMove(const event::DragMove& e) override { + ParamQuantity* const paramQuantity = getParamQuantity(); dynamic_cast(paramQuantity->module)->lcdMode = SLIDE_MODE; KnobLcd::onDragMove(e); } @@ -1058,6 +1061,7 @@ struct KnobSlide : KnobLcd { struct RockerSwitchHorizontalModeReset : W::RockerSwitchHorizontal { void onDragStart(const event::DragStart& e) override { + ParamQuantity* const paramQuantity = getParamQuantity(); dynamic_cast(paramQuantity->module)->lcdMode = DEFAULT_MODE; dynamic_cast(paramQuantity->module)->lcdLastInteraction = 0.f; dynamic_cast(paramQuantity->module)->lcdStatus.dirty = true; @@ -1078,9 +1082,9 @@ template TParamWidget* createMainParam(math::Vec pos, Darius* module, int paramId, int lastChanged) { TParamWidget* o = new TParamWidget(module, lastChanged); o->box.pos = pos; - if (module) { - o->paramQuantity = module->paramQuantities[paramId]; - } + o->app::ParamWidget::module = module; + o->app::ParamWidget::paramId = paramId; + o->initParamQuantity(); return o; } diff --git a/src/Psychopump.cpp b/src/Psychopump.cpp index cf2b2bc..e2da482 100644 --- a/src/Psychopump.cpp +++ b/src/Psychopump.cpp @@ -1091,10 +1091,10 @@ struct PsychopumpWidget : W::ModuleWidget { GateLabelButton* gateLabelButton = new GateLabelButton; gateLabelButton->box.pos = mm2px(Vec(xOffset + 4.1f, yOffset + i * 10.f)); gateLabelButton->channel = i; - if (module) { - gateLabelButton->module = module; - gateLabelButton->paramQuantity = module->paramQuantities[Psychopump::CHANNEL_LABEL_PARAM + i]; - } + gateLabelButton->module = module; + gateLabelButton->app::ParamWidget::module = module; + gateLabelButton->app::ParamWidget::paramId = Psychopump::CHANNEL_LABEL_PARAM + i; + gateLabelButton->initParamQuantity(); addParam(gateLabelButton); addStaticInput(mm2px(Vec(xOffset, yOffset + i * 10.f)), module, Psychopump::GATE_INPUT + i); } @@ -1116,7 +1116,9 @@ struct PsychopumpWidget : W::ModuleWidget { gateLengthKnob->module = module; gateLengthKnob->box.pos = mm2px(Vec(xOffset, yOffset + i * 10.f)); gateLengthKnob->channel = i; - if (module) gateLengthKnob->paramQuantity = module->paramQuantities[Psychopump::GATE_LENGTH_PARAM + i]; + gateLengthKnob->app::ParamWidget::module = module; + gateLengthKnob->app::ParamWidget::paramId = Psychopump::GATE_LENGTH_PARAM + i; + gateLengthKnob->initParamQuantity(); addParam(gateLengthKnob); } } @@ -1166,7 +1168,9 @@ struct PsychopumpWidget : W::ModuleWidget { CvKnob* cvKnob = new CvKnob; cvKnob->module = module; cvKnob->box.pos = mm2px(Vec(xOffset, yOffset)); - if (module) cvKnob->paramQuantity = module->paramQuantities[cvParam]; + cvKnob->app::ParamWidget::module = module; + cvKnob->app::ParamWidget::paramId = cvParam; + cvKnob->initParamQuantity(); cvKnob->channel = channel; cvKnob->output = output; addParam(cvKnob); @@ -1206,10 +1210,10 @@ struct PsychopumpWidget : W::ModuleWidget { OutputLabelButton* outputLabelButton = new OutputLabelButton; outputLabelButton->box.pos = mm2px(Vec(xOffset + i * 14.f, yOffset + 4.1f)); outputLabelButton->output = i; - if (module) { - outputLabelButton->module = module; - outputLabelButton->paramQuantity = module->paramQuantities[Psychopump::OUTPUT_LABEL_PARAM + i]; - } + outputLabelButton->module = module; + outputLabelButton->app::ParamWidget::module = module; + outputLabelButton->app::ParamWidget::paramId = Psychopump::OUTPUT_LABEL_PARAM + i; + outputLabelButton->initParamQuantity(); addParam(outputLabelButton); } diff --git a/src/Qqqq.cpp b/src/Qqqq.cpp index 0180ae4..f0142fd 100644 --- a/src/Qqqq.cpp +++ b/src/Qqqq.cpp @@ -772,8 +772,9 @@ namespace QqqqWidgets { // The LCD knobs struct LcdKnob : W::Knob { void onDragMove(const event::DragMove& e) override { - dynamic_cast(paramQuantity->module)->lcdLastInteraction = 0.f; - dynamic_cast(paramQuantity->module)->lcdStatus.dirty = true; + ParamQuantity* const paramQuantity = getParamQuantity(); + dynamic_cast(paramQuantity->module)->lcdLastInteraction = 0.f; + dynamic_cast(paramQuantity->module)->lcdStatus.dirty = true; W::Knob::onDragMove(e); } }; @@ -783,12 +784,14 @@ struct ScaleKnob : LcdKnob { LcdKnob(); } void onDragMove(const event::DragMove& e) override { + ParamQuantity* const paramQuantity = getParamQuantity(); dynamic_cast(paramQuantity->module)->lcdMode = SCALE_MODE; LcdKnob::onDragMove(e); } }; struct ScalingKnob : LcdKnob { void onDragMove(const event::DragMove& e) override { + ParamQuantity* const paramQuantity = getParamQuantity(); dynamic_cast(paramQuantity->module)->lcdMode = SCALING_MODE; dynamic_cast(paramQuantity->module)->lastScalingKnobTouchedId = paramQuantity->paramId; LcdKnob::onDragMove(e); @@ -796,6 +799,7 @@ struct ScalingKnob : LcdKnob { }; struct OffsetKnob : LcdKnob { void onDragMove(const event::DragMove& e) override { + ParamQuantity* const paramQuantity = getParamQuantity(); dynamic_cast(paramQuantity->module)->lcdMode = OFFSET_MODE; dynamic_cast(paramQuantity->module)->lastOffsetKnobTouchedId = paramQuantity->paramId; LcdKnob::onDragMove(e); @@ -807,6 +811,7 @@ struct TransposeKnob : LcdKnob { LcdKnob(); } void onDragMove(const event::DragMove& e) override { + ParamQuantity* const paramQuantity = getParamQuantity(); dynamic_cast(paramQuantity->module)->lcdMode = TRANSPOSE_MODE; dynamic_cast(paramQuantity->module)->lastTransposeKnobTouchedId = paramQuantity->paramId; LcdKnob::onDragMove(e); @@ -815,6 +820,7 @@ struct TransposeKnob : LcdKnob { // The LCD buttons. They're not sending ongoing events so no point setting Lcd dirty from here. struct TransposeButton : W::SmallButton { void onDragStart(const event::DragStart& e) override { + ParamQuantity* const paramQuantity = getParamQuantity(); dynamic_cast(paramQuantity->module)->lcdLastInteraction = 0.f; dynamic_cast(paramQuantity->module)->lcdMode = TRANSPOSE_TYPE_MODE; dynamic_cast(paramQuantity->module)->lastTransposeModeTouchedId = paramQuantity->paramId; @@ -823,6 +829,7 @@ struct TransposeButton : W::SmallButton { }; struct ShButton : W::SmallButton { void onDragStart(const event::DragStart& e) override { + ParamQuantity* const paramQuantity = getParamQuantity(); dynamic_cast(paramQuantity->module)->lcdLastInteraction = 0.f; dynamic_cast(paramQuantity->module)->lcdMode = SH_MODE; dynamic_cast(paramQuantity->module)->lastShTouchedId = paramQuantity->paramId; @@ -831,6 +838,7 @@ struct ShButton : W::SmallButton { }; struct VisualizeButton : W::ButtonPink { void onDragStart(const event::DragStart& e) override { + ParamQuantity* const paramQuantity = getParamQuantity(); dynamic_cast(paramQuantity->module)->lcdLastInteraction = 0.f; dynamic_cast(paramQuantity->module)->lcdMode = VISUALIZE_MODE; W::ButtonPink::onDragStart(e); @@ -845,7 +853,7 @@ struct PianoKey : W::LitSvgSwitchUnshadowed { int note = 0; void step() override { - if (paramQuantity){ + if (ParamQuantity* const paramQuantity = getParamQuantity()){ currentPianoDisplay = dynamic_cast(paramQuantity->module)->litKeys[note]; if (currentPianoDisplay == true && currentPianoDisplay != lastPianoDisplay) { lsw->setSvg(frames[2]); @@ -982,6 +990,8 @@ struct PushButtonKeyboard : W::SvgSwitchUnshadowed { ui::Menu* menu = createMenu(); + ParamQuantity* const paramQuantity = getParamQuantity(); + LeadSheetField* lsf = new LeadSheetField(); lsf->module = dynamic_cast(paramQuantity->module); menu->addChild(createMenuLabel("Import chords (lead sheet notation):")); @@ -1028,6 +1038,8 @@ struct SceneButton : W::LitSvgSwitchUnshadowed { if (e.button == GLFW_MOUSE_BUTTON_RIGHT) { ui::Menu* menu = createMenu(); + ParamQuantity* const paramQuantity = getParamQuantity(); + CopyScenePortableSequenceItem *copyScenePortableSequenceItem = new CopyScenePortableSequenceItem(); copyScenePortableSequenceItem->text = "Copy Scene"; copyScenePortableSequenceItem->slot = paramQuantity->paramId - Qqqq::SCENE_BUTTON_PARAM; diff --git a/src/Smerge.cpp b/src/Smerge.cpp index fffb973..80a453e 100644 --- a/src/Smerge.cpp +++ b/src/Smerge.cpp @@ -40,6 +40,11 @@ struct Smerge : Module { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); ledDivider.setDivision(256); configParam(SORT_PARAM, 0.f, 1.f, 0.f, "Sort voltages"); + configInput(LINK_INPUT, "Link"); + for (int i = 0; i < 16; i++) + configInput(MERGE_INPUT + i, string::f("Channel %d", i + 1)); + configOutput(POLY_OUTPUT, "Poly"); + configOutput(LINK_OUTPUT, "Link"); } // Merge without sorting, faster diff --git a/src/Solomon.cpp b/src/Solomon.cpp index f851c5d..12651ef 100644 --- a/src/Solomon.cpp +++ b/src/Solomon.cpp @@ -134,6 +134,35 @@ struct Solomon : Module { Solomon() { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); + configInput(EXT_SCALE_INPUT, "External scale"); + configInput(STEP_QUEUE_INPUT, "Step: Queue"); + configInput(STEP_TELEPORT_INPUT, "Step: Teleport"); + configInput(STEP_WALK_INPUT, "Step: Walk"); + configInput(STEP_BACK_INPUT, "Step: Back"); + configInput(STEP_FORWARD_INPUT, "Step: Forward"); + configInput(RESET_INPUT, "Reset"); + + configOutput(GLOBAL_TRIG_OUTPUT, "Trigger"); + configOutput(GLOBAL_CV_OUTPUT, "1V/Octave pitch"); + + for (unsigned i=0; i struct TotalNodesKnob : W::KnobSnap { void onDragMove(const event::DragMove& e) override { - TModule* module = dynamic_cast(paramQuantity->module); + TModule* module = dynamic_cast(getParamQuantity()->module); module->lcdStatus.lastInteraction = 0.f; module->lcdStatus.dirty = true; @@ -803,7 +832,7 @@ struct TotalNodesKnob : W::KnobSnap { template struct ScaleKnob : W::KnobSnap { void onDragMove(const event::DragMove& e) override { - TModule* module = dynamic_cast(paramQuantity->module); + TModule* module = dynamic_cast(getParamQuantity()->module); module->lcdStatus.lastInteraction = 0.f; module->lcdStatus.dirty = true; @@ -831,7 +860,7 @@ struct ScaleKnob : W::KnobSnap { template struct MinMaxKnob : W::Knob { void onDragMove(const event::DragMove& e) override { - TModule* module = dynamic_cast(paramQuantity->module); + TModule* module = dynamic_cast(getParamQuantity()->module); module->lcdStatus.lastInteraction = 0.f; module->lcdStatus.dirty = true; @@ -847,7 +876,7 @@ struct MinMaxKnob : W::Knob { template struct SlideKnob : W::Knob { void onDragMove(const event::DragMove& e) override { - TModule* module = dynamic_cast(paramQuantity->module); + TModule* module = dynamic_cast(getParamQuantity()->module); module->lcdStatus.lastInteraction = 0.f; module->lcdStatus.dirty = true; @@ -885,7 +914,10 @@ struct SegmentDisplay : LightWidget { font = APP->window->loadFont(asset::plugin(pluginInstance, "res/dseg/DSEG14ClassicMini-Italic.ttf")); } - void draw(const DrawArgs& args) override { + void drawLayer(const DrawArgs& args, int layer) override { + if (layer != 1) + return; + nvgFontSize(args.vg, 20); nvgFontFaceId(args.vg, font->handle); nvgTextLetterSpacing(args.vg, 2.0); diff --git a/src/Spleet.cpp b/src/Spleet.cpp index 4dd0a16..bff2a78 100644 --- a/src/Spleet.cpp +++ b/src/Spleet.cpp @@ -40,6 +40,12 @@ struct Spleet : Module { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); ledDivider.setDivision(4096); configParam(SORT_PARAM, 0.f, 1.f, 0.f, "Sort voltages on both banks"); + for (int i = 0; i < 2; i++) + configInput(POLY_INPUT + i, string::f("Channel %d", i + 1)); + for (int i = 0; i < 4; i++) { + configOutput(SPLIT_OUTPUT + i, string::f("Channel 1-%d", i + 1)); + configOutput(SPLIT_OUTPUT + 4 + i, string::f("Channel 2-%d", i + 1)); + } } // Split without sorting, faster diff --git a/src/Splirge.cpp b/src/Splirge.cpp index 93c098e..b33548d 100644 --- a/src/Splirge.cpp +++ b/src/Splirge.cpp @@ -41,6 +41,12 @@ struct Splirge : Module { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); ledDivider.setDivision(4096); configParam(SORT_PARAM, 0.f, 1.f, 0.f, "Sort voltages on both banks"); + configInput(POLY_INPUT, "Poly"); + for (int i = 0; i < 4; i++) + configInput(MERGE_INPUT + i, string::f("Channel %d", i + 1)); + configOutput(POLY_OUTPUT, "Poly"); + for (int i = 0; i < 4; i++) + configOutput(SPLIT_OUTPUT + i, string::f("Channel %d", i + 1)); } // Merge without sorting, faster diff --git a/src/Splort.cpp b/src/Splort.cpp index 1f460e1..ca08d55 100644 --- a/src/Splort.cpp +++ b/src/Splort.cpp @@ -41,6 +41,11 @@ struct Splort : Module { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); ledDivider.setDivision(256); configParam(SORT_PARAM, 0.f, 1.f, 0.f, "Sort voltages"); + configInput(POLY_INPUT, "Poly"); + configInput(LINK_INPUT, "Link"); + for (int i = 0; i < 16; i++) + configOutput(SPLIT_OUTPUT + i, string::f("Channel %d", i + 1)); + configOutput(LINK_OUTPUT, "Link"); } // Split without sorting, faster diff --git a/src/Swerge.cpp b/src/Swerge.cpp index 67583d3..f3c3fde 100644 --- a/src/Swerge.cpp +++ b/src/Swerge.cpp @@ -39,6 +39,12 @@ struct Swerge : Module { config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); ledDivider.setDivision(4096); configParam(SORT_PARAM, 0.f, 1.f, 0.f, "Sort voltages on both banks"); + for (int i = 0; i < 4; i++) { + configInput(MERGE_INPUT + i, string::f("Channel 1-%d", i + 1)); + configInput(MERGE_INPUT + 4 + i, string::f("Channel 2-%d", i + 1)); + } + for (int i = 0; i < 2; i++) + configOutput(POLY_OUTPUT + i, string::f("Channel %d", i + 1)); } // Merge without sorting, faster diff --git a/src/Undular.cpp b/src/Undular.cpp index e927aaa..2985b04 100644 --- a/src/Undular.cpp +++ b/src/Undular.cpp @@ -207,7 +207,7 @@ struct Undular : Module { zActivated = (inputs[Z_INPUT].isConnected() and initialized) ? true : false; if (positionChanged and initialized) APP->scene->rackScroll->offset = position; - if (zoomChanged and initialized) settings::zoom = newZoom; + if (zoomChanged and initialized) APP->scene->rackScroll->setZoom(std::pow(2.f, newZoom)); } void processCableInputs() { diff --git a/src/javascript.hpp b/src/javascript.hpp index 98f01ef..c366f7e 100644 --- a/src/javascript.hpp +++ b/src/javascript.hpp @@ -34,7 +34,7 @@ #include // QuickJS always throws a warning here, but it works. -#include "QuickJS/quickjs.h" +#include "quickjs.h" namespace Javascript { diff --git a/src/widgets.hpp b/src/widgets.hpp index 8ce2fbc..da4e5f3 100644 --- a/src/widgets.hpp +++ b/src/widgets.hpp @@ -135,6 +135,7 @@ struct LitSvgSwitch : Switch { } void onChange(const event::Change& e) override { + ParamQuantity* const paramQuantity = getParamQuantity(); if (!frames.empty() && paramQuantity) { int index = (int) std::round(paramQuantity->getValue() - paramQuantity->getMinValue()); index = math::clamp(index, 0, (int) frames.size() - 1); @@ -185,6 +186,7 @@ struct LitSvgSwitchUnshadowed : Switch { } void onChange(const event::Change& e) override { + ParamQuantity* const paramQuantity = getParamQuantity(); if (!frames.empty() && paramQuantity) { int index = (int) std::round(paramQuantity->getValue() - paramQuantity->getMinValue()); index = math::clamp(index, 0, (int) frames.size() - 1); @@ -215,13 +217,16 @@ struct LitSvgSwitchUnshadowed : Switch { // They are cut off in the middle for Lights Off compatibility. struct JackLight : app::ModuleLightWidget { JackLight() { - this->box.size = app::mm2px(math::Vec(8.0, 8.0)); + this->box.size = mm2px(math::Vec(8.0, 8.0)); this->bgColor = nvgRGB(0x0e, 0x69, 0x77); } - void draw(const widget::Widget::DrawArgs& args) override { + void drawLayer(const DrawArgs& args, int layer) override { + if (layer != 1) + return; + float radius = std::min(this->box.size.x, this->box.size.y) / 2.0 - 0.5f; - float holeRadius = app::mm2px(3.f); + float holeRadius = mm2px(3.f); nvgBeginPath(args.vg); nvgCircle(args.vg, radius + 1.f, radius + 1.f, radius); @@ -263,12 +268,15 @@ struct JackDynamicLightOutput : JackLight { // They are cut off in the middle for Lights Off compatibility. struct JackStaticLight : app::LightWidget { JackStaticLight() { - this->box.size = app::mm2px(math::Vec(8.0, 8.0)); + this->box.size = mm2px(math::Vec(8.0, 8.0)); } - void draw(const widget::Widget::DrawArgs& args) override { + void drawLayer(const DrawArgs& args, int layer) override { + if (layer != 1) + return; + float radius = std::min(this->box.size.x, this->box.size.y) / 2.0 - 0.5f; - float holeRadius = app::mm2px(3.f); + float holeRadius = mm2px(3.f); nvgBeginPath(args.vg); nvgCircle(args.vg, radius + 1.f, radius + 1.f, radius); @@ -349,11 +357,14 @@ struct KnobLight : ModuleLightWidget { float max = 10.f; KnobLight() { - this->box.size = app::mm2px(math::Vec(8.0f, 8.0f)); + this->box.size = mm2px(math::Vec(8.0f, 8.0f)); this->bgColor = nvgRGB(0x0e, 0x69, 0x77); } - void draw(const widget::Widget::DrawArgs& args) override { + void drawLayer(const DrawArgs& args, int layer) override { + if (layer != 1) + return; + float radius = std::min(this->box.size.x, this->box.size.y) / 2.0 - 2.6f; nvgBeginPath(args.vg); @@ -419,12 +430,15 @@ struct KnobLightYellow : KnobLight { // Tiny little status lights. 2.17mm struct StatusLight : ModuleLightWidget { StatusLight() { - this->box.size = app::mm2px(math::Vec(2.176f, 2.176f)); + this->box.size = mm2px(math::Vec(2.176f, 2.176f)); this->bgColor = nvgRGB(0x0e, 0x69, 0x77); this->borderColor = nvgRGB(0x08, 0x3d, 0x45); } - void draw(const widget::Widget::DrawArgs& args) override { + void drawLayer(const DrawArgs& args, int layer) override { + if (layer != 1) + return; + float radius = std::min(this->box.size.x, this->box.size.y) / 2.0 - 0.5f; nvgBeginPath(args.vg); @@ -444,7 +458,7 @@ struct StatusLight : ModuleLightWidget { // Border if (this->borderColor.a > 0.0) { - nvgStrokeWidth(args.vg, app::mm2px(0.2)); + nvgStrokeWidth(args.vg, mm2px(0.2)); nvgStrokeColor(args.vg, this->borderColor); nvgStroke(args.vg); } @@ -480,7 +494,6 @@ struct StatusLightInput : StatusLight { struct JackTransparent : SVGPort { JackTransparent() { setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, "res/components/jack-transparent.svg"))); - SVGPort(); } }; @@ -594,7 +607,6 @@ struct Knob : app::SvgKnob { struct KnobSnap : Knob { KnobSnap() { snap = true; - Knob(); } };