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

Method controllerValue

src/core/AutomatableModel.cpp:506–539  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

504
505
506float AutomatableModel::controllerValue( int frameOffset ) const
507{
508 if( m_controllerConnection )
509 {
510 float v = 0;
511 switch(m_scaleType)
512 {
513 case Linear:
514 v = minValue<float>() + ( range() * controllerConnection()->currentValue( frameOffset ) );
515 break;
516 case Logarithmic:
517 v = logToLinearScale(
518 controllerConnection()->currentValue( frameOffset ));
519 break;
520 default:
521 qFatal("AutomatableModel::controllerValue(int)"
522 "lacks implementation for a scale type");
523 break;
524 }
525 if( typeInfo<float>::isEqual( m_step, 1 ) && m_hasStrictStepSize )
526 {
527 return qRound( v );
528 }
529 return v;
530 }
531
532 AutomatableModel* lm = m_linkedModels.first();
533 if( lm->controllerConnection() )
534 {
535 return fittedValue( lm->controllerValue( frameOffset ) );
536 }
537
538 return fittedValue( lm->m_value );
539}
540
541
542ValueBuffer * AutomatableModel::valueBuffer()

Callers 6

processOutEventMethod · 0.45
processInEventMethod · 0.45
processInEventMethod · 0.45
handleMidiEventMethod · 0.45
processMidiEventMethod · 0.45
handleMidiEventMethod · 0.45

Calls 5

rangeFunction · 0.85
controllerConnectionFunction · 0.85
logToLinearScaleFunction · 0.85
currentValueMethod · 0.80
firstMethod · 0.80

Tested by

no test coverage detected