comparison layer/SpectrogramLayer.cpp @ 137:10a82b2bbb8b

* experiment with finer zoom level changes when using h thumbwheel
author Chris Cannam
date Tue, 22 Aug 2006 14:18:28 +0000
parents a859b87162ca
children 0f1ac9562c76
comparison
equal deleted inserted replaced
136:a859b87162ca 137:10a82b2bbb8b
1977 MagnitudeRange overallMag = m_viewMags[v]; 1977 MagnitudeRange overallMag = m_viewMags[v];
1978 bool overallMagChanged = false; 1978 bool overallMagChanged = false;
1979 1979
1980 fft->suspendWrites(); 1980 fft->suspendWrites();
1981 1981
1982 #ifdef DEBUG_SPECTROGRAM_REPAINT
1983 std::cerr << (float(v->getFrameForX(1) - v->getFrameForX(0)) / increment) << " bins per pixel" << std::endl;
1984 #endif
1985
1982 for (int x = 0; x < w; ++x) { 1986 for (int x = 0; x < w; ++x) {
1983 1987
1984 for (int y = 0; y < h; ++y) { 1988 for (int y = 0; y < h; ++y) {
1985 ymag[y] = 0.f; 1989 ymag[y] = 0.f;
1986 ydiv[y] = 0.f; 1990 ydiv[y] = 0.f;
2109 m_viewMags[v] = overallMag; 2113 m_viewMags[v] = overallMag;
2110 std::cerr << "Overall mag is now [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "] - will be updating" << std::endl; 2114 std::cerr << "Overall mag is now [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "] - will be updating" << std::endl;
2111 } else { 2115 } else {
2112 std::cerr << "Overall mag unchanged at [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "]" << std::endl; 2116 std::cerr << "Overall mag unchanged at [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "]" << std::endl;
2113 } 2117 }
2118
2119 Profiler profiler2("SpectrogramLayer::paint: draw image", true);
2114 2120
2115 paint.drawImage(x0, y0, m_drawBuffer, 0, 0, w, h); 2121 paint.drawImage(x0, y0, m_drawBuffer, 0, 0, w, h);
2116 2122
2117 if (recreateWholePixmapCache) { 2123 if (recreateWholePixmapCache) {
2118 cache.pixmap = QPixmap(v->width(), v->height()); 2124 cache.pixmap = QPixmap(v->width(), v->height());