From 139055934f00be58d43ee73b831f4483cb0ce267 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 9 Aug 2023 22:43:19 -0400 Subject: [PATCH] Move LightButton to Rack SDK. --- src/Logic.cpp | 40 +--------------------------------------- src/plugin.hpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 39 deletions(-) diff --git a/src/Logic.cpp b/src/Logic.cpp index 0609099..97447b2 100644 --- a/src/Logic.cpp +++ b/src/Logic.cpp @@ -99,44 +99,6 @@ struct Logic : Module { }; -struct VCVBezelBig : app::SvgSwitch { - VCVBezelBig() { - momentary = true; - addFrame(Svg::load(asset::plugin(pluginInstance, "res/VCVBezelBig.svg"))); - } -}; - - -template -struct VCVBezelLightBig : TBase { - VCVBezelLightBig() { - this->borderColor = color::BLACK_TRANSPARENT; - this->bgColor = color::BLACK_TRANSPARENT; - this->box.size = mm2px(math::Vec(11.1936, 11.1936)); - } -}; - - -template -struct LightButton : TBase { - app::ModuleLightWidget* light; - - LightButton() { - light = new TLight; - // Move center of light to center of box - light->box.pos = this->box.size.div(2).minus(light->box.size.div(2)); - this->addChild(light); - } - - app::ModuleLightWidget* getLight() { - return light; - } -}; - - -using VCVBezelLightBigWhite = LightButton>; - - struct LogicWidget : ModuleWidget { LogicWidget(Logic* module) { setModule(module); @@ -147,7 +109,7 @@ struct LogicWidget : ModuleWidget { addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); addChild(createWidget(Vec(box.size.x - 2 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); - addParam(createLightParamCentered(mm2px(Vec(12.7, 26.755)), module, Logic::B_PARAM, Logic::B_BUTTON_LIGHT)); + addParam(createLightParamCentered>>(mm2px(Vec(12.7, 26.755)), module, Logic::B_PARAM, Logic::B_BUTTON_LIGHT)); addInput(createInputCentered(mm2px(Vec(7.299, 52.31)), module, Logic::A_INPUT)); addInput(createInputCentered(mm2px(Vec(18.136, 52.31)), module, Logic::B_INPUT)); diff --git a/src/plugin.hpp b/src/plugin.hpp index dd0a9fc..8ebfe9a 100644 --- a/src/plugin.hpp +++ b/src/plugin.hpp @@ -118,3 +118,21 @@ struct YellowBlueLight : TBase { this->addBaseColor(SCHEME_BLUE); } }; + + +struct VCVBezelBig : app::SvgSwitch { + VCVBezelBig() { + momentary = true; + addFrame(Svg::load(asset::plugin(pluginInstance, "res/VCVBezelBig.svg"))); + } +}; + + +template +struct VCVBezelLightBig : TBase { + VCVBezelLightBig() { + this->borderColor = color::BLACK_TRANSPARENT; + this->bgColor = color::BLACK_TRANSPARENT; + this->box.size = mm2px(math::Vec(11.1936, 11.1936)); + } +};