MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / addMethod

Method addMethod

Source/Lua/Methods/CtrlrLuaMethodManager.cpp:245–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245void CtrlrLuaMethodManager::addMethod (ValueTree groupToAddTo, const String &methodName, const String &initialCode, const String &linkedToProperty, const Uuid methodUid, const bool forceIfAlreadyExists)
246{
247 ValueTree group;
248
249 if (groupToAddTo.isValid())
250 group = groupToAddTo;
251 else
252 group = managerTree;
253
254 if (group.getChildWithProperty(Ids::uuid, methodUid.toString()).isValid() && forceIfAlreadyExists)
255 {
256 group.removeChild (group.getChildWithProperty(Ids::uuid, methodUid.toString()), nullptr);
257 }
258
259 group.addChild (getDefaultMethodTree (methodName, initialCode, linkedToProperty, methodUid), -1, nullptr);
260
261 // Notify the panel about the modification
262 owner.getOwner().luaManagerChanged();
263}
264
265void CtrlrLuaMethodManager::addMethodFromFile (ValueTree groupToAddTo, const File &fileToUse, const Uuid methodUid)
266{

Callers 2

buttonClickedMethod · 0.45
addNewMethodMethod · 0.45

Calls 5

luaManagerChangedMethod · 0.80
isValidMethod · 0.45
toStringMethod · 0.45
addChildMethod · 0.45
getOwnerMethod · 0.45

Tested by

no test coverage detected