I’m having some issues trying to pass a pointer to my module into my custom light class. When I learned C++, there wasn’t the concept of SomeClass<SomeOtherClass>
, which is throwing me off. Here’s what my code looks like:
VCVLightBezel<GrooveboxBlueLight> *groovebox_light = createLightParamCentered<VCVLightBezel<GrooveboxBlueLight>>(Vec(button_positions[i][0],button_positions[i][1]), module, GrooveBox::DRUM_PADS + i, GrooveBox::DRUM_PAD_LIGHTS + i);
groovebox_light->groove_box_module = module;
addParam(groovebox_light);
However, the code above is attempting to set the groove_box_module variable in VCVLightBezel, when I actually want to set it in GrooveboxBlueLight, so it throws an error:
In file included from src/GrooveBox.cpp:31: src/GrooveBox/GrooveBoxWidget.hpp: In constructor ‘GrooveBoxWidget::GrooveBoxWidget(GrooveBox*)’: src/GrooveBox/GrooveBoxWidget.hpp:704:24: error: ‘struct rack::componentlibrary::VCVLightBezel’ has no member named ‘groove_box_module’ 704 | groovebox_light->groove_box_module = module;
What’s a graceful way of padding the module * to GrooveboxBlueLight? Second question: What is this technique called SomeClass<SomeOtherClass>
so that I can learn more about it? Thanks!!