diff layer/WaveformLayer.cpp @ 586:1ae54a29e59e

Merge from debug-output branch
author Chris Cannam
date Tue, 14 Jun 2011 14:48:29 +0100
parents f4960f8ce798
children 4806715f7a19
line wrap: on
line diff
--- a/layer/WaveformLayer.cpp	Thu Apr 14 15:21:21 2011 +0100
+++ b/layer/WaveformLayer.cpp	Tue Jun 14 14:48:29 2011 +0100
@@ -288,7 +288,7 @@
 void
 WaveformLayer::setChannel(int channel)
 {
-//    std::cerr << "WaveformLayer::setChannel(" << channel << ")" << std::endl;
+//    DEBUG << "WaveformLayer::setChannel(" << channel << ")" << endl;
 
     if (m_channel == channel) return;
     m_channel = channel;
@@ -382,7 +382,7 @@
     merging = (m_channelMode == MergeChannels && rawChannels > 1);
     mixing = (m_channelMode == MixChannels && rawChannels > 1);
 
-//    std::cerr << "WaveformLayer::getChannelArrangement: min " << min << ", max " << max << ", merging " << merging << ", channels " << channels << std::endl;
+//    DEBUG << "WaveformLayer::getChannelArrangement: min " << min << ", max " << max << ", merging " << merging << ", channels " << channels << endl;
 
     return channels;
 }    
@@ -474,8 +474,8 @@
 
 #ifdef DEBUG_WAVEFORM_PAINT
     Profiler profiler("WaveformLayer::paint", true);
-    std::cerr << "WaveformLayer::paint (" << rect.x() << "," << rect.y()
-	      << ") [" << rect.width() << "x" << rect.height() << "]: zoom " << zoomLevel << ", start " << startFrame << std::endl;
+    DEBUG << "WaveformLayer::paint (" << rect.x() << "," << rect.y()
+	      << ") [" << rect.width() << "x" << rect.height() << "]: zoom " << zoomLevel << ", start " << startFrame << endl;
 #endif
 
     size_t channels = 0, minChannel = 0, maxChannel = 0;
@@ -494,7 +494,7 @@
     if (m_aggressive) {
 
 #ifdef DEBUG_WAVEFORM_PAINT
-        std::cerr << "WaveformLayer::paint: aggressive is true" << std::endl;
+        DEBUG << "WaveformLayer::paint: aggressive is true" << endl;
 #endif
 
 	if (m_cacheValid && (zoomLevel != m_cacheZoomLevel)) {
@@ -504,7 +504,7 @@
 	if (!m_cache || m_cache->width() != w || m_cache->height() != h) {
 #ifdef DEBUG_WAVEFORM_PAINT
             if (m_cache) {
-                std::cerr << "WaveformLayer::paint: cache size " << m_cache->width() << "x" << m_cache->height() << " differs from view size " << w << "x" << h << ": regenerating aggressive cache" << std::endl;
+                DEBUG << "WaveformLayer::paint: cache size " << m_cache->width() << "x" << m_cache->height() << " differs from view size " << w << "x" << h << ": regenerating aggressive cache" << endl;
             }
 #endif
 	    delete m_cache;
@@ -562,7 +562,7 @@
     getSourceFramesForX(v, x1, modelZoomLevel, spare, frame1);
     
 #ifdef DEBUG_WAVEFORM_PAINT
-    std::cerr << "Painting waveform from " << frame0 << " to " << frame1 << " (" << (x1-x0+1) << " pixels at zoom " << zoomLevel << " and model zoom " << modelZoomLevel << ")" <<  std::endl;
+    DEBUG << "Painting waveform from " << frame0 << " to " << frame1 << " (" << (x1-x0+1) << " pixels at zoom " << zoomLevel << " and model zoom " << modelZoomLevel << ")" <<  endl;
 #endif
 
     RangeSummarisableTimeValueModel::RangeBlock *ranges = 
@@ -703,11 +703,11 @@
             size_t i1 = (f1 - frame0) / modelZoomLevel;
 
 #ifdef DEBUG_WAVEFORM_PAINT
-            std::cerr << "WaveformLayer::paint: pixel " << x << ": i0 " << i0 << " (f " << f0 << "), i1 " << i1 << " (f " << f1 << ")" << std::endl;
+            DEBUG << "WaveformLayer::paint: pixel " << x << ": i0 " << i0 << " (f " << f0 << "), i1 " << i1 << " (f " << f1 << ")" << endl;
 #endif
 
             if (i1 > i0 + 1) {
-                std::cerr << "WaveformLayer::paint: ERROR: i1 " << i1 << " > i0 " << i0 << " plus one (zoom = " << zoomLevel << ", model zoom = " << modelZoomLevel << ")" << std::endl;
+                DEBUG << "WaveformLayer::paint: ERROR: i1 " << i1 << " > i0 " << i0 << " plus one (zoom = " << zoomLevel << ", model zoom = " << modelZoomLevel << ")" << endl;
             }
 
 	    if (ranges && i0 < ranges->size()) {