MCPcopy Create free account
hub / github.com/christophhart/HISE / setRange

Method setRange

hi_scripting/scripting/api/ScriptingApiObjects.cpp:142–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142void ScriptingObjects::MidiList::setRange(int startIndex, int numToFill, int value)
143{
144 startIndex = jlimit(0, 127, startIndex);
145 numToFill = jmin(numToFill, 127 - startIndex);
146
147 bool isClearing = value == -1;
148 int delta = 0;
149
150 for (int i = startIndex; i < numToFill; i++)
151 {
152 auto elementIsClear = data[i] == -1;
153 auto doSomething = isClearing != elementIsClear;
154 delta += (int)doSomething * ((int)elementIsClear * 2 - 1);
155
156 data[i] = value;
157 }
158
159 numValues += delta;
160}
161
162String ScriptingObjects::MidiList::getBase64String() const
163{

Callers 13

rebuildMethod · 0.45
onInitMethod · 0.45
onInitFunction · 0.45
onControlFunction · 0.45
EditorMethod · 0.45
setSampleRangeMethod · 0.45
updateSliderRangeMethod · 0.45
updateRangeMethod · 0.45
importSamplesMethod · 0.45
SynthMethod · 0.45

Calls 9

jlimitFunction · 0.85
jminFunction · 0.85
jmaxFunction · 0.85
checkIfIdentityMethod · 0.80
clearFunction · 0.50
getNumChannelsMethod · 0.45
getBufferMethod · 0.45
getNumSamplesMethod · 0.45

Tested by

no test coverage detected