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

Method SetUpFromSaveData

Source/AudioRouter.cpp:155–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155void AudioRouter::SetUpFromSaveData()
156{
157 int numItems = mModuleSaveData.GetInt("num_items");
158 int oldNumItems = (int)mDestinationCables.size();
159 if (numItems > oldNumItems)
160 {
161 for (int i = oldNumItems; i < numItems; ++i)
162 {
163 mRouteSelector->AddLabel(" ", i);
164 auto* additionalCable = new PatchCableSource(this, kConnectionType_Audio);
165 AddPatchCableSource(additionalCable);
166 mDestinationCables.push_back(additionalCable);
167 }
168 }
169 else if (numItems < oldNumItems)
170 {
171 for (int i = oldNumItems - 1; i >= numItems; --i)
172 {
173 mRouteSelector->RemoveLabel(i);
174 RemovePatchCableSource(mDestinationCables[i]);
175 }
176 mDestinationCables.resize(numItems);
177 }
178 mOnlyShowActiveCable = mModuleSaveData.GetBool("only_show_active_cable");
179}
180
181void AudioRouter::SaveLayout(ofxJSONElement& moduleInfo)
182{

Callers

nothing calls this directly

Calls 6

GetIntMethod · 0.80
sizeMethod · 0.80
resizeMethod · 0.80
GetBoolMethod · 0.80
AddLabelMethod · 0.45
RemoveLabelMethod · 0.45

Tested by

no test coverage detected