| 504 | |
| 505 | |
| 506 | float 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 | |
| 542 | ValueBuffer * AutomatableModel::valueBuffer() |
no test coverage detected