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

Method setModule

src/history.cpp:44–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44void ModuleAdd::setModule(app::ModuleWidget* mw) {
45 assert(mw);
46 model = mw->getModel();
47 assert(mw->getModule());
48 moduleId = mw->getModule()->id;
49 pos = mw->box.pos;
50 // ModuleAdd doesn't *really* need the state to be serialized, although ModuleRemove certainly does.
51 // However, creating a module may give it a nondeterministic initial state for whatever reason, so serialize anyway.
52 moduleJ = APP->engine->moduleToJson(mw->getModule());
53}
54
55void ModuleAdd::undo() {
56 app::ModuleWidget* mw = APP->scene->rack->getModule(moduleId);

Callers

nothing calls this directly

Calls 3

moduleToJsonMethod · 0.80
getModelMethod · 0.45
getModuleMethod · 0.45

Tested by

no test coverage detected