#include "Shaper.hpp" struct ShaperWidget : ModuleWidget { static constexpr int hp = 10; ShaperWidget(Shaper* module) : ModuleWidget(module) { box.size = Vec(RACK_GRID_WIDTH * hp, RACK_GRID_HEIGHT); { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; panel->setBackground(SVG::load(assetPlugin(plugin, "res/Shaper.svg"))); addChild(panel); } addChild(Widget::create(Vec(0, 0))); addChild(Widget::create(Vec(box.size.x - 15, 0))); addChild(Widget::create(Vec(0, 365))); addChild(Widget::create(Vec(box.size.x - 15, 365))); // generated by svg_widgets.rb auto attackParamPosition = Vec(29.08, 33.08); auto triggerParamPosition = Vec(89.04, 43.04); auto onParamPosition = Vec(29.08, 89.08); auto speedParamPosition = Vec(119.0, 96.0); auto decayParamPosition = Vec(29.08, 145.08); auto loopParamPosition = Vec(119.0, 152.0); auto offParamPosition = Vec(29.08, 201.08); auto envParamPosition = Vec(82.38, 257.08); auto signalParamPosition = Vec(82.38, 313.08); auto triggerInputPosition = Vec(114.0, 40.0); auto signalInputPosition = Vec(11.5, 320.0); auto triggerOutputPosition = Vec(114.0, 208.0); auto envOutputPosition = Vec(11.5, 264.0); auto invOutputPosition = Vec(40.5, 264.0); auto signalOutputPosition = Vec(40.5, 320.0); auto attackLightPosition = Vec(12.0, 80.0); auto onLightPosition = Vec(12.0, 121.0); auto decayLightPosition = Vec(12.0, 189.0); auto offLightPosition = Vec(12.0, 237.0); // end generated by svg_widgets.rb addParam(ParamWidget::create(attackParamPosition, module, Shaper::ATTACK_PARAM, 0.0, 1.0, 0.12)); addParam(ParamWidget::create(onParamPosition, module, Shaper::ON_PARAM, 0.0, 1.0, 0.32)); addParam(ParamWidget::create(decayParamPosition, module, Shaper::DECAY_PARAM, 0.0, 1.0, 0.32)); addParam(ParamWidget::create(offParamPosition, module, Shaper::OFF_PARAM, 0.0, 1.0, 0.07)); addParam(ParamWidget::create(envParamPosition, module, Shaper::ENV_PARAM, 0.0, 1.0, 1.0)); addParam(ParamWidget::create(signalParamPosition, module, Shaper::SIGNAL_PARAM, 0.0, 1.0, 0.1)); addParam(ParamWidget::create(triggerParamPosition, module, Shaper::TRIGGER_PARAM, 0.0, 1.0, 0.0)); addInput(Port::create(triggerInputPosition, Port::INPUT, module, Shaper::TRIGGER_INPUT)); addParam(ParamWidget::create(speedParamPosition, module, Shaper::SPEED_PARAM, 0.0, 1.0, 1.0)); addParam(ParamWidget::create(loopParamPosition, module, Shaper::LOOP_PARAM, 0.0, 1.0, 1.0)); addOutput(Port::create(triggerOutputPosition, Port::OUTPUT, module, Shaper::TRIGGER_OUTPUT)); addOutput(Port::create(envOutputPosition, Port::OUTPUT, module, Shaper::ENV_OUTPUT)); addOutput(Port::create(invOutputPosition, Port::OUTPUT, module, Shaper::INV_OUTPUT)); addInput(Port::create(signalInputPosition, Port::INPUT, module, Shaper::SIGNAL_INPUT)); addOutput(Port::create(signalOutputPosition, Port::OUTPUT, module, Shaper::SIGNAL_OUTPUT)); addChild(ModuleLightWidget::create>(attackLightPosition, module, Shaper::ATTACK_LIGHT)); addChild(ModuleLightWidget::create>(onLightPosition, module, Shaper::ON_LIGHT)); addChild(ModuleLightWidget::create>(decayLightPosition, module, Shaper::DECAY_LIGHT)); addChild(ModuleLightWidget::create>(offLightPosition, module, Shaper::OFF_LIGHT)); } void appendContextMenu(Menu* menu) override { Shaper* shaper = dynamic_cast(module); assert(shaper); menu->addChild(new MenuLabel()); menu->addChild(new TriggerOnLoadMenuItem(shaper, "Resume Loop on Load")); } }; RACK_PLUGIN_MODEL_INIT(Bogaudio, Shaper) { Model *modelShaper = createModel("Bogaudio-Shaper", "Shaper", "envelope and amplifier", ENVELOPE_GENERATOR_TAG, AMPLIFIER_TAG); return modelShaper; }