Mercurial > hg > svgui
diff layer/SpectrogramLayer.cpp @ 901:0fe1f4407261 cxx11
Fixes to go with latest svcore
author | Chris Cannam |
---|---|
date | Wed, 04 Mar 2015 13:53:05 +0000 |
parents | d7f6f60a8b30 |
children | b66fb15de477 |
line wrap: on
line diff
--- a/layer/SpectrogramLayer.cpp Tue Mar 03 09:33:59 2015 +0000 +++ b/layer/SpectrogramLayer.cpp Wed Mar 04 13:53:05 2015 +0000 @@ -3430,18 +3430,18 @@ class SpectrogramRangeMapper : public RangeMapper { public: - SpectrogramRangeMapper(int sr, int /* fftsize */) : - m_dist(float(sr) / 2), - m_s2(sqrtf(sqrtf(2))) { } + SpectrogramRangeMapper(sv_samplerate_t sr, int /* fftsize */) : + m_dist(sr / 2), + m_s2(sqrt(sqrt(2))) { } ~SpectrogramRangeMapper() { } - virtual int getPositionForValue(float value) const { - - float dist = m_dist; + virtual int getPositionForValue(double value) const { + + double dist = m_dist; int n = 0; - while (dist > (value + 0.00001) && dist > 0.1f) { + while (dist > (value + 0.00001) && dist > 0.1) { dist /= m_s2; ++n; } @@ -3449,19 +3449,19 @@ return n; } - virtual int getPositionForValueUnclamped(float value) const { + virtual int getPositionForValueUnclamped(double value) const { // We don't really support this return getPositionForValue(value); } - virtual float getValueForPosition(int position) const { + virtual double getValueForPosition(int position) const { // Vertical zoom step 0 shows the entire range from DC -> // Nyquist frequency. Step 1 shows 2^(1/4) of the range of // step 0, and so on until the visible range is smaller than // the frequency step between bins at the current fft size. - float dist = m_dist; + double dist = m_dist; int n = 0; while (n < position) { @@ -3472,7 +3472,7 @@ return dist; } - virtual float getValueForPositionUnclamped(int position) const { + virtual double getValueForPositionUnclamped(int position) const { // We don't really support this return getValueForPosition(position); } @@ -3480,8 +3480,8 @@ virtual QString getUnit() const { return "Hz"; } protected: - float m_dist; - float m_s2; + double m_dist; + double m_s2; }; int