comparison audioio/PlaySpeedRangeMapper.cpp @ 330:46b24009ce7a

Unclamped
author Chris Cannam
date Thu, 06 Feb 2014 15:31:57 +0000
parents 068235cf5bf7
children dee4aceb131c
comparison
equal deleted inserted replaced
304:c837368b1faf 330:46b24009ce7a
32 int position = getPositionForFactor(factor); 32 int position = getPositionForFactor(factor);
33 return position; 33 return position;
34 } 34 }
35 35
36 int 36 int
37 PlaySpeedRangeMapper::getPositionForValueUnclamped(float value) const
38 {
39 // We don't really provide this
40 return getPositionForValue(value);
41 }
42
43 int
37 PlaySpeedRangeMapper::getPositionForFactor(float factor) const 44 PlaySpeedRangeMapper::getPositionForFactor(float factor) const
38 { 45 {
39 bool slow = (factor > 1.0); 46 bool slow = (factor > 1.0);
40 47
41 if (!slow) factor = 1.0 / factor; 48 if (!slow) factor = 1.0 / factor;
60 PlaySpeedRangeMapper::getValueForPosition(int position) const 67 PlaySpeedRangeMapper::getValueForPosition(int position) const
61 { 68 {
62 float factor = getFactorForPosition(position); 69 float factor = getFactorForPosition(position);
63 float pc = getValueForFactor(factor); 70 float pc = getValueForFactor(factor);
64 return pc; 71 return pc;
72 }
73
74 float
75 PlaySpeedRangeMapper::getValueForPositionUnclamped(int position) const
76 {
77 // We don't really provide this
78 return getValueForPosition(position);
65 } 79 }
66 80
67 float 81 float
68 PlaySpeedRangeMapper::getValueForFactor(float factor) const 82 PlaySpeedRangeMapper::getValueForFactor(float factor) const
69 { 83 {