comparison layer/WaveformLayer.h @ 1338:6d091348e4e9 zoom

Get oversampled rendering almost working, but I think we need to take more care with the oversampling itself
author Chris Cannam
date Tue, 25 Sep 2018 16:38:50 +0100
parents 43296804c473
children b0555b434575
comparison
equal deleted inserted replaced
1337:4f9a3c84be60 1338:6d091348e4e9
209 protected: 209 protected:
210 int dBscale(double sample, int m) const; 210 int dBscale(double sample, int m) const;
211 211
212 const RangeSummarisableTimeValueModel *m_model; // I do not own this 212 const RangeSummarisableTimeValueModel *m_model; // I do not own this
213 213
214 typedef std::vector<RangeSummarisableTimeValueModel::RangeBlock> RangeVec;
215
214 /// Return value is number of channels displayed 216 /// Return value is number of channels displayed
215 int getChannelArrangement(int &min, int &max, 217 int getChannelArrangement(int &min, int &max,
216 bool &merging, bool &mixing) const; 218 bool &merging, bool &mixing) const;
217 219
218 void paintChannelSummarised 220 void paintChannel
219 (LayerGeometryProvider *, QPainter *paint, QRect rect, int channel, 221 (LayerGeometryProvider *, QPainter *paint, QRect rect, int channel,
220 const std::vector<RangeSummarisableTimeValueModel::RangeBlock> &ranges, 222 const RangeVec &ranges,
221 int blockSize, sv_frame_t frame0, sv_frame_t frame1) const; 223 int blockSize, sv_frame_t frame0, sv_frame_t frame1) const;
222
223 void paintChannelOversampled
224 (LayerGeometryProvider *, QPainter *paint, QRect rect, int channel,
225 sv_frame_t frame0, sv_frame_t frame1) const;
226 224
227 void paintChannelScaleGuides(LayerGeometryProvider *, QPainter *paint, 225 void paintChannelScaleGuides(LayerGeometryProvider *, QPainter *paint,
228 QRect rect, int channel) const; 226 QRect rect, int channel) const;
227
228 void getSummaryRanges(int minChannel, int maxChannel,
229 bool mixingOrMerging,
230 sv_frame_t f0, sv_frame_t f1,
231 int blockSize, RangeVec &ranges) const;
232
233 void getOversampledRanges(int minChannel, int maxChannel,
234 bool mixingOrMerging,
235 sv_frame_t f0, sv_frame_t f1,
236 int oversampleBy, RangeVec &ranges) const;
229 237
230 int getYForValue(const LayerGeometryProvider *v, double value, int channel) const; 238 int getYForValue(const LayerGeometryProvider *v, double value, int channel) const;
231 239
232 double getValueForY(const LayerGeometryProvider *v, int y, int &channel) const; 240 double getValueForY(const LayerGeometryProvider *v, int y, int &channel) const;
233 241
245 ChannelMode m_channelMode; 253 ChannelMode m_channelMode;
246 int m_channel; 254 int m_channel;
247 Scale m_scale; 255 Scale m_scale;
248 double m_middleLineHeight; 256 double m_middleLineHeight;
249 bool m_aggressive; 257 bool m_aggressive;
250 int m_oversampleRate;
251 int m_oversampleTail;
252 258
253 mutable std::vector<float> m_effectiveGains; 259 mutable std::vector<float> m_effectiveGains;
254 260
255 mutable breakfastquay::Resampler *m_oversampler; 261 mutable breakfastquay::Resampler *m_oversampler;
256 262