diff 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
line wrap: on
line diff
--- a/layer/WaveformLayer.h	Tue Sep 25 12:52:08 2018 +0100
+++ b/layer/WaveformLayer.h	Tue Sep 25 16:38:50 2018 +0100
@@ -211,21 +211,29 @@
 
     const RangeSummarisableTimeValueModel *m_model; // I do not own this
 
+    typedef std::vector<RangeSummarisableTimeValueModel::RangeBlock> RangeVec;
+
     /// Return value is number of channels displayed
     int getChannelArrangement(int &min, int &max,
                               bool &merging, bool &mixing) const;
 
-    void paintChannelSummarised
+    void paintChannel
     (LayerGeometryProvider *, QPainter *paint, QRect rect, int channel,
-     const std::vector<RangeSummarisableTimeValueModel::RangeBlock> &ranges,
+     const RangeVec &ranges,
      int blockSize, sv_frame_t frame0, sv_frame_t frame1) const;
-
-    void paintChannelOversampled
-    (LayerGeometryProvider *, QPainter *paint, QRect rect, int channel,
-     sv_frame_t frame0, sv_frame_t frame1) const;
     
     void paintChannelScaleGuides(LayerGeometryProvider *, QPainter *paint,
                                  QRect rect, int channel) const;
+
+    void getSummaryRanges(int minChannel, int maxChannel,
+                          bool mixingOrMerging,
+                          sv_frame_t f0, sv_frame_t f1,
+                          int blockSize, RangeVec &ranges) const;
+
+    void getOversampledRanges(int minChannel, int maxChannel,
+                              bool mixingOrMerging,
+                              sv_frame_t f0, sv_frame_t f1,
+                              int oversampleBy, RangeVec &ranges) const;
     
     int getYForValue(const LayerGeometryProvider *v, double value, int channel) const;
 
@@ -247,8 +255,6 @@
     Scale        m_scale;
     double       m_middleLineHeight;
     bool         m_aggressive;
-    int          m_oversampleRate;
-    int          m_oversampleTail;
 
     mutable std::vector<float> m_effectiveGains;