Mercurial > hg > svgui
comparison layer/TimeRulerLayer.cpp @ 585:f4960f8ce798 debug-output
Convert many cerrs to DEBUGs
author | Chris Cannam |
---|---|
date | Mon, 16 May 2011 17:19:25 +0100 |
parents | a6408c382616 |
children | 4806715f7a19 |
comparison
equal
deleted
inserted
replaced
584:1fe7951a61e8 | 585:f4960f8ce798 |
---|---|
70 | 70 |
71 int left = RealTime::realTime2Frame(rdrt, rate); | 71 int left = RealTime::realTime2Frame(rdrt, rate); |
72 resolution = RealTime::realTime2Frame(rtick, rate); | 72 resolution = RealTime::realTime2Frame(rtick, rate); |
73 int right = left + resolution; | 73 int right = left + resolution; |
74 | 74 |
75 // std::cerr << "TimeRulerLayer::snapToFeatureFrame: type " | 75 // DEBUG << "TimeRulerLayer::snapToFeatureFrame: type " |
76 // << int(snap) << ", frame " << frame << " (time " | 76 // << int(snap) << ", frame " << frame << " (time " |
77 // << rt << ", tick " << rtick << ", rounded " << rdrt << ") "; | 77 // << rt << ", tick " << rtick << ", rounded " << rdrt << ") "; |
78 | 78 |
79 switch (snap) { | 79 switch (snap) { |
80 | 80 |
133 } | 133 } |
134 } | 134 } |
135 } | 135 } |
136 } | 136 } |
137 | 137 |
138 // std::cerr << " -> " << frame << " (resolution = " << resolution << ")" << std::endl; | 138 // DEBUG << " -> " << frame << " (resolution = " << resolution << ")" << endl; |
139 | 139 |
140 return true; | 140 return true; |
141 } | 141 } |
142 | 142 |
143 int | 143 int |
193 | 193 |
194 void | 194 void |
195 TimeRulerLayer::paint(View *v, QPainter &paint, QRect rect) const | 195 TimeRulerLayer::paint(View *v, QPainter &paint, QRect rect) const |
196 { | 196 { |
197 #ifdef DEBUG_TIME_RULER_LAYER | 197 #ifdef DEBUG_TIME_RULER_LAYER |
198 std::cerr << "TimeRulerLayer::paint (" << rect.x() << "," << rect.y() | 198 DEBUG << "TimeRulerLayer::paint (" << rect.x() << "," << rect.y() |
199 << ") [" << rect.width() << "x" << rect.height() << "]" << std::endl; | 199 << ") [" << rect.width() << "x" << rect.height() << "]" << endl; |
200 #endif | 200 #endif |
201 | 201 |
202 if (!m_model || !m_model->isOK()) return; | 202 if (!m_model || !m_model->isOK()) return; |
203 | 203 |
204 int sampleRate = m_model->getSampleRate(); | 204 int sampleRate = m_model->getSampleRate(); |
250 frame *= v->getZoomLevel(); // so frame corresponds to an exact pixel | 250 frame *= v->getZoomLevel(); // so frame corresponds to an exact pixel |
251 | 251 |
252 int x = v->getXForFrame(frame); | 252 int x = v->getXForFrame(frame); |
253 | 253 |
254 #ifdef DEBUG_TIME_RULER_LAYER | 254 #ifdef DEBUG_TIME_RULER_LAYER |
255 std::cerr << "Considering frame = " << frame << ", x = " << x << std::endl; | 255 DEBUG << "Considering frame = " << frame << ", x = " << x << endl; |
256 #endif | 256 #endif |
257 | 257 |
258 if (x >= rect.x() + rect.width() + 50) { | 258 if (x >= rect.x() + rect.width() + 50) { |
259 #ifdef DEBUG_TIME_RULER_LAYER | 259 #ifdef DEBUG_TIME_RULER_LAYER |
260 std::cerr << "X well out of range, ending here" << std::endl; | 260 std::cerr << "X well out of range, ending here" << std::endl; |