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

Method addModule

src/app/RackWidget.cpp:658–671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

656}
657
658void RackWidget::addModule(ModuleWidget* m) {
659 assert(m);
660
661 // Module must be 3U high and at least 1HP wide
662 if (m->box.size.x < RACK_GRID_WIDTH / 2)
663 throw Exception("Module %s width is %g px, must be at least %g px", m->model->getFullName().c_str(), m->box.size.x, RACK_GRID_WIDTH);
664
665 if (m->box.size.y != RACK_GRID_HEIGHT)
666 throw Exception("Module %s height is %g px, must be %g px", m->model->getFullName().c_str(), m->box.size.y, RACK_GRID_HEIGHT);
667
668 internal->moduleContainer->addChild(m);
669
670 updateExpanders();
671}
672
673void RackWidget::addModuleAtMouse(ModuleWidget* mw) {
674 assert(mw);

Callers 4

chooseModelFunction · 0.45
json_array_foreachFunction · 0.45
pasteModuleJsonActionMethod · 0.45
cloneActionMethod · 0.45

Calls 3

ExceptionClass · 0.85
addChildMethod · 0.80
getFullNameMethod · 0.45

Tested by

no test coverage detected