| 558 | } |
| 559 | |
| 560 | void EffectChain::LoadLayout(const ofxJSONElement& moduleInfo) |
| 561 | { |
| 562 | mModuleSaveData.LoadString("target", moduleInfo); |
| 563 | mModuleSaveData.LoadInt("widecount", moduleInfo, 5, 1, 50, true); |
| 564 | mModuleSaveData.LoadBool("showspawnlist", moduleInfo, true); |
| 565 | |
| 566 | const ofxJSONElement& effects = moduleInfo["effects"]; |
| 567 | |
| 568 | assert(mEffects.size() == effects.size()); |
| 569 | for (int i = 0; i < mEffects.size(); ++i) |
| 570 | { |
| 571 | try |
| 572 | { |
| 573 | std::string type = effects[i]["type"].asString(); |
| 574 | assert(mEffects[i]->GetType() == type); |
| 575 | mEffects[i]->LoadLayoutBase(effects[i]); |
| 576 | } |
| 577 | catch (Json::LogicError& e) |
| 578 | { |
| 579 | TheSynth->LogEvent(__PRETTY_FUNCTION__ + std::string(" json error: ") + e.what(), kLogEventType_Error); |
| 580 | } |
| 581 | } |
| 582 | |
| 583 | SetUpFromSaveData(); |
| 584 | } |
| 585 | |
| 586 | void EffectChain::SetUpFromSaveData() |
| 587 | { |
nothing calls this directly
no test coverage detected