Mercurial > hg > svgui
comparison layer/SpectrogramLayer.cpp @ 250:3fe622570b35 sv1-v1.0
* Fix #1712589 Reset button for thumbwheels not working properly
author | Chris Cannam |
---|---|
date | Fri, 04 May 2007 19:01:13 +0000 |
parents | 28c8e8e3c537 |
children | 8d89f8869cfb |
comparison
equal
deleted
inserted
replaced
249:e6d0b097d102 | 250:3fe622570b35 |
---|---|
2926 SpectrogramRangeMapper mapper(sr, m_fftSize); | 2926 SpectrogramRangeMapper mapper(sr, m_fftSize); |
2927 | 2927 |
2928 // int maxStep = mapper.getPositionForValue((float(sr) / m_fftSize) + 0.001); | 2928 // int maxStep = mapper.getPositionForValue((float(sr) / m_fftSize) + 0.001); |
2929 int maxStep = mapper.getPositionForValue(0); | 2929 int maxStep = mapper.getPositionForValue(0); |
2930 int minStep = mapper.getPositionForValue(float(sr) / 2); | 2930 int minStep = mapper.getPositionForValue(float(sr) / 2); |
2931 | 2931 |
2932 defaultStep = mapper.getPositionForValue(m_initialMaxFrequency) - minStep; | 2932 size_t initialMax = m_initialMaxFrequency; |
2933 | 2933 if (initialMax == 0) initialMax = sr / 2; |
2934 // std::cerr << "SpectrogramLayer::getVerticalZoomSteps: " << maxStep - minStep << " (" << maxStep <<"-" << minStep << "), default is " << defaultStep << " (from initial max freq " << m_initialMaxFrequency << ")" << std::endl; | 2934 |
2935 defaultStep = mapper.getPositionForValue(initialMax) - minStep; | |
2936 | |
2937 // std::cerr << "SpectrogramLayer::getVerticalZoomSteps: " << maxStep - minStep << " (" << maxStep <<"-" << minStep << "), default is " << defaultStep << " (from initial max freq " << initialMax << ")" << std::endl; | |
2935 | 2938 |
2936 return maxStep - minStep; | 2939 return maxStep - minStep; |
2937 } | 2940 } |
2938 | 2941 |
2939 int | 2942 int |