| 42 | } |
| 43 | |
| 44 | void 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 | |
| 55 | void ModuleAdd::undo() { |
| 56 | app::ModuleWidget* mw = APP->scene->rack->getModule(moduleId); |
nothing calls this directly
no test coverage detected