Mercurial > hg > svgui
comparison layer/SpectrogramLayer.cpp @ 158:9c3a4b42d8f8
...
author | Chris Cannam |
---|---|
date | Thu, 05 Oct 2006 15:39:23 +0000 |
parents | e68cc314deb7 |
children | f4be20ebdfa4 |
comparison
equal
deleted
inserted
replaced
157:e68cc314deb7 | 158:9c3a4b42d8f8 |
---|---|
1653 v->setLightBackground(true); | 1653 v->setLightBackground(true); |
1654 } else { | 1654 } else { |
1655 v->setLightBackground(false); | 1655 v->setLightBackground(false); |
1656 } | 1656 } |
1657 | 1657 |
1658 Profiler profiler("SpectrogramLayer::paint", true); | 1658 // Profiler profiler("SpectrogramLayer::paint", true); |
1659 #ifdef DEBUG_SPECTROGRAM_REPAINT | 1659 #ifdef DEBUG_SPECTROGRAM_REPAINT |
1660 std::cerr << "SpectrogramLayer::paint(): m_model is " << m_model << ", zoom level is " << v->getZoomLevel() << ", m_updateTimer " << m_updateTimer << std::endl; | 1660 std::cerr << "SpectrogramLayer::paint(): m_model is " << m_model << ", zoom level is " << v->getZoomLevel() << ", m_updateTimer " << m_updateTimer << std::endl; |
1661 | 1661 |
1662 std::cerr << "rect is " << rect.x() << "," << rect.y() << " " << rect.width() << "x" << rect.height() << std::endl; | 1662 std::cerr << "rect is " << rect.x() << "," << rect.y() << " " << rect.width() << "x" << rect.height() << std::endl; |
1663 #endif | 1663 #endif |
2095 std::cerr << "Overall mag is now [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "] - will be updating" << std::endl; | 2095 std::cerr << "Overall mag is now [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "] - will be updating" << std::endl; |
2096 } else { | 2096 } else { |
2097 std::cerr << "Overall mag unchanged at [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "]" << std::endl; | 2097 std::cerr << "Overall mag unchanged at [" << m_viewMags[v].getMin() << "->" << m_viewMags[v].getMax() << "]" << std::endl; |
2098 } | 2098 } |
2099 | 2099 |
2100 Profiler profiler2("SpectrogramLayer::paint: draw image", true); | 2100 // Profiler profiler2("SpectrogramLayer::paint: draw image", true); |
2101 | 2101 |
2102 paint.drawImage(x0, y0, m_drawBuffer, 0, 0, w, h); | 2102 paint.drawImage(x0, y0, m_drawBuffer, 0, 0, w, h); |
2103 | 2103 |
2104 if (recreateWholePixmapCache) { | 2104 if (recreateWholePixmapCache) { |
2105 cache.pixmap = QPixmap(v->width(), v->height()); | 2105 cache.pixmap = QPixmap(v->width(), v->height()); |
2114 cache.startFrame = startFrame; | 2114 cache.startFrame = startFrame; |
2115 cache.zoomLevel = zoomLevel; | 2115 cache.zoomLevel = zoomLevel; |
2116 | 2116 |
2117 if (cache.validArea.x() > 0) { | 2117 if (cache.validArea.x() > 0) { |
2118 #ifdef DEBUG_SPECTROGRAM_REPAINT | 2118 #ifdef DEBUG_SPECTROGRAM_REPAINT |
2119 std::cerr << "SpectrogramLayer::paint() updating left" << std::endl; | 2119 std::cerr << "SpectrogramLayer::paint() updating left (0, " |
2120 << cache.validArea.x() << ")" << std::endl; | |
2120 #endif | 2121 #endif |
2121 v->update(0, 0, cache.validArea.x(), v->height()); | 2122 v->update(0, 0, cache.validArea.x(), v->height()); |
2122 } | 2123 } |
2123 | 2124 |
2124 if (cache.validArea.x() + cache.validArea.width() < | 2125 if (cache.validArea.x() + cache.validArea.width() < |
2518 { | 2519 { |
2519 if (!m_model || !m_model->isOK()) { | 2520 if (!m_model || !m_model->isOK()) { |
2520 return; | 2521 return; |
2521 } | 2522 } |
2522 | 2523 |
2523 Profiler profiler("SpectrogramLayer::paintVerticalScale", true); | 2524 // Profiler profiler("SpectrogramLayer::paintVerticalScale", true); |
2524 | 2525 |
2525 //!!! cache this? | 2526 //!!! cache this? |
2526 | 2527 |
2527 int h = rect.height(), w = rect.width(); | 2528 int h = rect.height(), w = rect.width(); |
2528 | 2529 |