diff layer/WaveformLayer.h @ 1542:10fe8124dc17

Overhaul the way WaveformLayer reports value and display extents. The previous logic has been nonsense for a very long time, excused only by the fact that it was very seldom relevant (only really if another layer with unit V came along that wanted to auto-align with it). Partial fix for #1954 Peculiar alignment for Amplitude Follower y-scale in Auto-Align mode
author Chris Cannam
date Wed, 16 Oct 2019 12:23:36 +0100
parents 696e569ff21b
children
line wrap: on
line diff
--- a/layer/WaveformLayer.h	Wed Oct 16 12:19:04 2019 +0100
+++ b/layer/WaveformLayer.h	Wed Oct 16 12:23:36 2019 +0100
@@ -174,6 +174,8 @@
     bool getValueExtents(double &min, double &max,
                                  bool &log, QString &unit) const override;
 
+    bool getDisplayExtents(double & min, double &max) const override;
+
     bool getYScaleValue(const LayerGeometryProvider *v, int y,
                                 double &value, QString &unit) const override;
     
@@ -236,10 +238,13 @@
     bool         m_showMeans;
     ChannelMode  m_channelMode;
     int          m_channel;
+    int          m_channelCount;
     Scale        m_scale;
     double       m_middleLineHeight;
     bool         m_aggressive;
 
+    static double m_dBMin;
+
     mutable std::vector<float> m_effectiveGains;
 
     mutable QPixmap *m_cache;