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

Method timerCallback

hi_scripting/scripting/scriptnode/ui/ParameterSlider.cpp:1179–1205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1177
1178
1179void ParameterSlider::timerCallback()
1180{
1181 auto thisDisplayValue = getValueToDisplay();
1182
1183 if (thisDisplayValue != lastDisplayValue || blinkAlpha > 0.0f)
1184 {
1185 auto sl = getRange().getLength();
1186 auto delta = std::abs(thisDisplayValue - lastDisplayValue);
1187
1188 if(delta / sl > 0.01)
1189 {
1190 blinkAlpha = 1.0f;
1191 lastDisplayValue = thisDisplayValue;
1192
1193 if(auto l = dynamic_cast<ParameterKnobLookAndFeel::SliderLabel*>(getTextBox()))
1194 {
1195 l->updateText();
1196 }
1197 }
1198 else
1199 {
1200 blinkAlpha = jmax(0.0f, blinkAlpha - 0.08f);
1201 }
1202
1203 repaint();
1204 }
1205}
1206
1207void ParameterSlider::itemDragEnter(const SourceDetails& )
1208{

Callers

nothing calls this directly

Calls 6

jmaxFunction · 0.85
getRangeFunction · 0.50
absFunction · 0.50
repaintFunction · 0.50
getLengthMethod · 0.45
updateTextMethod · 0.45

Tested by

no test coverage detected