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

Method setGlobalVariable

Source/Lua/CtrlrLuaManager.cpp:402–424  ·  view source on GitHub ↗

@brief Set a value to a global variables @param index the global variable index 0-16 @param value the value of the variable */

Source from the content-addressed store, hash-verified

400@param value the value of the variable
401*/
402void CtrlrPanel::setGlobalVariable(const int index, const int value)
403{
404 if (index >= globalVariables.size() || index < 0)
405 {
406 // _LERR("CtrlrPanel::setGlobalVariable index out of bounds("+String(index)+")");
407 return;
408 }
409
410 globalVariables.set (index, value);
411
412 if (index<64)
413 {
414 setProperty (Ids::panelGlobalVariables, globalsToString(globalVariables));
415 }
416
417 if (luaPanelGlobalChangedCbk && !luaPanelGlobalChangedCbk.wasObjectDeleted())
418 {
419 if (luaPanelGlobalChangedCbk->isValid())
420 {
421 getCtrlrLuaManager().getMethodManager().call (luaPanelGlobalChangedCbk, index, value);
422 }
423 }
424}
425
426/** @brief Get the value of a global variable
427

Callers 2

evaluateFormulaFunctionFunction · 0.80
handleAsyncUpdateMethod · 0.80

Calls 5

setPropertyFunction · 0.85
sizeMethod · 0.45
setMethod · 0.45
isValidMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected