MCPcopy Create free account
hub / github.com/VCVRack/Rack / setModule

Method setModule

src/core/MIDIMap.cpp:437–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435 LedDisplaySeparator* separators[MAX_CHANNELS];
436
437 void setModule(MIDIMap* module) {
438 this->module = module;
439
440 scroll = new ScrollWidget;
441 scroll->box.pos = channelChoice->box.getBottomLeft();
442 scroll->box.size.x = box.size.x;
443 scroll->box.size.y = box.size.y - scroll->box.pos.y;
444 addChild(scroll);
445
446 LedDisplaySeparator* separator = createWidget<LedDisplaySeparator>(scroll->box.pos);
447 separator->box.size.x = box.size.x;
448 addChild(separator);
449 separators[0] = separator;
450
451 Vec pos;
452 for (int id = 0; id < MAX_CHANNELS; id++) {
453 if (id > 0) {
454 LedDisplaySeparator* separator = createWidget<LedDisplaySeparator>(pos);
455 separator->box.size.x = box.size.x;
456 scroll->container->addChild(separator);
457 separators[id] = separator;
458 }
459
460 MIDIMapChoice* choice = createWidget<MIDIMapChoice>(pos);
461 choice->box.size.x = box.size.x;
462 choice->id = id;
463 choice->setModule(module);
464 scroll->container->addChild(choice);
465 choices[id] = choice;
466
467 pos = choice->box.getBottomLeft();
468 }
469 }
470
471 void step() override {
472 if (module) {

Callers

nothing calls this directly

Calls 3

getBottomLeftMethod · 0.80
addChildMethod · 0.80
setModuleMethod · 0.45

Tested by

no test coverage detected