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

Method SetVal

Source/UIGrid.cpp:504–525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

502}
503
504void UIGrid::SetVal(int col, int row, float val, bool notifyListener)
505{
506 col = ofClamp(col, 0, MAX_GRID_COLS - 1);
507 row = ofClamp(row, 0, MAX_GRID_ROWS - 1);
508 if (val != mData[GetDataIndex(col, row)])
509 {
510 float oldValue = mData[GetDataIndex(col, row)];
511 mData[GetDataIndex(col, row)] = val;
512
513 if (mSingleColumn && val > 0)
514 {
515 for (int i = 0; i < MAX_GRID_ROWS; ++i)
516 {
517 if (i != row)
518 mData[GetDataIndex(col, i)] = 0;
519 }
520 }
521
522 if (notifyListener && mListener)
523 mListener->GridUpdated(this, col, row, val, oldValue);
524 }
525}
526
527void UIGrid::SetHighlightCol(double time, int col)
528{

Callers 15

OnTimeEventMethod · 0.80
UpdateNumMeasuresMethod · 0.80
OnGridButtonMethod · 0.80
SetMethod · 0.80
OnGridButtonMethod · 0.80
SetStepMethod · 0.80
RandomizeRowMethod · 0.80
FloatSliderUpdatedMethod · 0.80
IntSliderUpdatedMethod · 0.80
ButtonClickedMethod · 0.80
DropdownUpdatedMethod · 0.80
KeyPressedMethod · 0.80

Calls 2

ofClampFunction · 0.85
GridUpdatedMethod · 0.45

Tested by 3

GridUpdatedMethod · 0.64
KeyPressedMethod · 0.64
SyncGridToSeqMethod · 0.64