| 122 | } |
| 123 | |
| 124 | void GroupControl::LoadLayout(const ofxJSONElement& moduleInfo) |
| 125 | { |
| 126 | const Json::Value& controls = moduleInfo["uicontrols"]; |
| 127 | |
| 128 | for (int i = 0; i < controls.size(); ++i) |
| 129 | { |
| 130 | try |
| 131 | { |
| 132 | std::string controlPath = controls[i].asString(); |
| 133 | IUIControl* control = nullptr; |
| 134 | if (!controlPath.empty()) |
| 135 | control = TheSynth->FindUIControl(controlPath); |
| 136 | PatchCableSource* cable = new PatchCableSource(this, kConnectionType_Modulator); |
| 137 | AddPatchCableSource(cable); |
| 138 | cable->SetTarget(control); |
| 139 | mControlCables.push_back(cable); |
| 140 | } |
| 141 | catch (Json::LogicError& e) |
| 142 | { |
| 143 | TheSynth->LogEvent(__PRETTY_FUNCTION__ + std::string(" json error: ") + e.what(), kLogEventType_Error); |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | //add extra cable |
| 148 | PatchCableSource* cable = new PatchCableSource(this, kConnectionType_Modulator); |
| 149 | AddPatchCableSource(cable); |
| 150 | mControlCables.push_back(cable); |
| 151 | |
| 152 | SetUpFromSaveData(); |
| 153 | } |
| 154 | |
| 155 | void GroupControl::SetUpFromSaveData() |
| 156 | { |
nothing calls this directly
no test coverage detected