I have the following light:
struct MachineJamStep : app::SvgSwitch {
app::ModuleLightWidget* light;
MachineJamStep() {
addFrame(APP->window->loadSvg(asset::plugin(pluginInstance, "res/MachineJamStep.svg")));
light = new RectangleLight<WhiteLight>;
light->box.pos = box.size.div(2).minus(light->box.size.div(2));
addChild(light);
fb->removeChild(shadow);
delete shadow;
}
app::ModuleLightWidget* getLight() {
return light;
}
};
In the process call I do:
for (unsigned int i = 0; i < 64; i++) {
if (padClickDetectors[i].process(params[STEP_PARAMS + i].getValue())){
lights[PAD_LIGHTS + i].setBrightness(1.0f);
INFO("Clicked %i", i);
}
}
I create the widgets as so:
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 8; j++) {
float x = 51.594 + j * 12.906;
float y = 16.14 + i * 5.291;
addParam(createLightParamCentered<MachineJamStep>(mm2px(Vec(x, y)), module, MachineJamSequencer::STEP_PARAMS + j + i*8, MachineJamSequencer::PAD_LIGHTS + j + i*8));
}
}
Basically i am just trying to create a 8x8 sequencer with 64 buttons that you click on and the light turns on to indicate that its on (at least for now).
The INFO i have in the process gets logged with the correct button id but the light does not change. Is it the svgs fault? in the svg i only have one group with a rect to define the shape of the light… should there be another layer on top with the fill color set to the light id color? I am very confused and been stuck on this for 4 days so I would really need a bit of help. Thanks!