//============================================================================================================ //! //! \file VU-G1.cpp //! //! \brief VU-G1 is a simple six input volume monitoring module. //! //============================================================================================================ #include "Gratrix.hpp" namespace rack_plugin_Gratrix { //============================================================================================================ //! \brief The module. struct GtxModule_VU_G1 : Module { enum ParamIds { NUM_PARAMS }; enum InputIds { IN1_INPUT, // N+1 NUM_INPUTS }; enum OutputIds { NUM_OUTPUTS, }; enum LightIds { NUM_LIGHTS = 10 // N }; GtxModule_VU_G1() : Module(NUM_PARAMS, (GTX__N+1) * NUM_INPUTS, NUM_OUTPUTS, GTX__N * NUM_LIGHTS) { } static constexpr std::size_t imap(std::size_t port, std::size_t bank) { return port + bank * NUM_INPUTS; } void step() override { for (std::size_t i=0; i(Vec(15, 0))); addChild(Widget::create(Vec(box.size.x-30, 0))); addChild(Widget::create(Vec(15, 365))); addChild(Widget::create(Vec(box.size.x-30, 365))); for (std::size_t i=0; i(Vec(px(0, i), py(2, i)), module, GtxModule_VU_G1::imap(GtxModule_VU_G1::IN1_INPUT, i))); } addInput(createInputGTX(Vec(gx(0), gy(2)), module, GtxModule_VU_G1::imap(GtxModule_VU_G1::IN1_INPUT, GTX__N))); for (std::size_t i=0, k=0; i>(l_s(gx(0)+(i-2.5f)*13.0f, gy(0.5)+(j-4.5f)*11.0f), module, k)); break; case 1 : case 2 : addChild(ModuleLightWidget::create>(l_s(gx(0)+(i-2.5f)*13.0f, gy(0.5)+(j-4.5f)*11.0f), module, k)); break; default : addChild(ModuleLightWidget::create>(l_s(gx(0)+(i-2.5f)*13.0f, gy(0.5)+(j-4.5f)*11.0f), module, k)); break; } } } } }; } // namespace rack_plugin_Gratrix using namespace rack_plugin_Gratrix; RACK_PLUGIN_MODEL_INIT(Gratrix, VU_G1) { Model *model = Model::create("Gratrix", "VU-G1", "VU-G1", VISUAL_TAG); return model; }