Mercurial > hg > svgui
diff layer/ScrollableMagRangeCache.cpp @ 1143:c53ed1a6fcbd spectrogram-minor-refactor
Fixes to phase display and colour scale for it; tidy up some debug output
author | Chris Cannam |
---|---|
date | Fri, 05 Aug 2016 14:31:16 +0100 |
parents | 9ff838a64461 |
children | f2f43802718b |
line wrap: on
line diff
--- a/layer/ScrollableMagRangeCache.cpp Fri Aug 05 14:00:58 2016 +0100 +++ b/layer/ScrollableMagRangeCache.cpp Fri Aug 05 14:31:16 2016 +0100 @@ -17,7 +17,7 @@ #include <iostream> using namespace std; -#define DEBUG_SCROLLABLE_MAG_RANGE_CACHE 1 +//#define DEBUG_SCROLLABLE_MAG_RANGE_CACHE 1 void ScrollableMagRangeCache::scrollTo(const LayerGeometryProvider *v, @@ -76,11 +76,13 @@ m_ranges = newRanges; } +#ifdef DEBUG_SCROLLABLE_MAG_RANGE_CACHE cerr << "maxes (" << m_ranges.size() << ") now: "; for (int i = 0; in_range_for(m_ranges, i); ++i) { cerr << m_ranges[i].getMax() << " "; } cerr << endl; +#endif } MagnitudeRange @@ -109,23 +111,3 @@ } } -//!!! unneeded? -void -ScrollableMagRangeCache::sampleColumn(const LayerGeometryProvider *v, - sv_frame_t frame, - const MagnitudeRange &r) -{ - int x = (v->getXForFrame(frame) - - v->getXForFrame(m_startFrame)); - - if (!in_range_for(m_ranges, x)) { - cerr << "WARNING: ScrollableMagRangeCache::sampleColumn: column " << x - << " arising from frame " << frame << " is out of range for cache " - << "of width " << m_ranges.size() - << " (with start frame " << m_startFrame << ")" << endl; - throw logic_error("column out of range"); - } else { - sampleColumn(x, r); - } -} -