| 86 | } |
| 87 | |
| 88 | int OversamplesCalculator::nearestTick( int tick ) const |
| 89 | { |
| 90 | int low, high; |
| 91 | float frame = ticksToFrames( tick ); |
| 92 | tickInterval( frame, low, high ); |
| 93 | if (( tick - low )*( tick-low ) < ( tick-high )*( tick-high ) ) |
| 94 | { |
| 95 | return low; |
| 96 | } |
| 97 | else |
| 98 | { |
| 99 | return high; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | float OversamplesCalculator::tickInterval( float frame, int &tickLow, int &tickHigh ) const |
| 104 | { |