MCPcopy Create free account
hub / github.com/LMMS/lmms / fittedValue

Method fittedValue

src/core/AutomatableModel.cpp:382–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380
381
382float AutomatableModel::fittedValue( float value ) const
383{
384 value = tLimit<float>( value, m_minValue, m_maxValue );
385
386 if( m_step != 0 && m_hasStrictStepSize )
387 {
388 value = nearbyintf( value / m_step ) * m_step;
389 }
390
391 roundAt( value, m_maxValue );
392 roundAt( value, m_minValue );
393 roundAt( value, 0.0f );
394
395 if( value < m_minValue )
396 {
397 return m_minValue;
398 }
399 else if( value > m_maxValue )
400 {
401 return m_maxValue;
402 }
403
404 return value;
405}
406
407
408

Callers 2

setValueMethod · 0.45
setAutomatedValueMethod · 0.45

Calls 1

roundAtFunction · 0.85

Tested by

no test coverage detected