MCPcopy Create free account
hub / github.com/benkuper/Chataigne / reloadSourceValues

Method reloadSourceValues

Source/Module/Routing/ModuleRouter.cpp:107–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void ModuleRouter::reloadSourceValues(bool keepData)
108{
109 var prevData = sourceValues.getJSONData();
110 sourceValues.clear();
111
112 if (sourceModuleRef.wasObjectDeleted() || destModuleRef.wasObjectDeleted()) return;
113
114 Array<WeakReference<Controllable>> values = sourceModule->valuesCC.getAllControllables(true);
115 int index = 0;
116 for (auto& c : values)
117 {
118 if (c == nullptr || c.wasObjectDeleted()) continue;
119 ModuleRouterValue* mrv = new ModuleRouterValue(c, index++);
120 sourceValues.addItem(mrv, var(), false);
121 mrv->forceDisabled = !enabled->boolValue();
122 mrv->setSourceAndOutModule(sourceModule, destModule);
123 }
124
125 if (keepData) sourceValues.loadItemsData(prevData);
126}
127
128
129var ModuleRouter::getJSONData(bool includeNonOverriden)

Callers

nothing calls this directly

Calls 3

setSourceAndOutModuleMethod · 0.80
getJSONDataMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected