comparison layer/ScrollableMagRangeCache.h @ 1119:be5b91ec81a0 spectrogram-minor-refactor

Inch toward using the mag cache (currently will crash with debug exception)
author Chris Cannam
date Wed, 20 Jul 2016 08:42:04 +0100
parents 175d4e15884d
children 65cdaf8d6b50
comparison
equal deleted inserted replaced
1118:175d4e15884d 1119:be5b91ec81a0
93 } 93 }
94 94
95 bool isColumnSet(int column) const { 95 bool isColumnSet(int column) const {
96 return in_range_for(m_ranges, column) && m_ranges.at(column).isSet(); 96 return in_range_for(m_ranges, column) && m_ranges.at(column).isSet();
97 } 97 }
98
99 bool areColumnsSet(int x, int count) const {
100 for (int i = 0; i < count; ++i) {
101 if (!isColumnSet(x + i)) return false;
102 }
103 return true;
104 }
98 105
99 const MagnitudeRange &getRange(int column) const { 106 /**
107 * Get the magnitude range for a single column.
108 */
109 MagnitudeRange getRange(int column) const {
100 return m_ranges.at(column); 110 return m_ranges.at(column);
101 } 111 }
102 112
113 /**
114 * Get the magnitude range for a range of columns.
115 */
116 MagnitudeRange getRange(int x, int count) const {
117 MagnitudeRange r;
118 for (int i = 0; i < count; ++i) {
119 r.sample(m_ranges.at(x + i));
120 }
121 return r;
122 }
123
103 /** 124 /**
104 * Set the new start frame for the cache, according to the 125 * Set the new start frame for the cache, according to the
105 * geometry of the supplied LayerGeometryProvider, if possible 126 * geometry of the supplied LayerGeometryProvider, if possible
106 * also moving along any existing valid data within the cache so 127 * also moving along any existing valid data within the cache so
107 * that it continues to be valid for the new start frame. 128 * that it continues to be valid for the new start frame.