@brief Set a value to a global variables @param index the global variable index 0-16 @param value the value of the variable */
| 400 | @param value the value of the variable |
| 401 | */ |
| 402 | void 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 |
no test coverage detected