MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / LoadLayout

Method LoadLayout

Source/GroupControl.cpp:124–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124void 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
155void GroupControl::SetUpFromSaveData()
156{

Callers

nothing calls this directly

Calls 5

sizeMethod · 0.80
emptyMethod · 0.80
LogEventMethod · 0.80
FindUIControlMethod · 0.45
SetTargetMethod · 0.45

Tested by

no test coverage detected