comparison base/RangeMapper.h @ 464:9525c9d7e54d

* Add vertical zoom and pan to time-value layer. Still some defects, particularly in logarithmic mode. Now need to get this in note layer as well! * Some fixes to log colouring in segmentation mode of time-value layer.
author Chris Cannam
date Fri, 24 Oct 2008 14:52:40 +0000
parents ca3b91119482
children b4a8d8221eaf
comparison
equal deleted inserted replaced
463:93806ad9481e 464:9525c9d7e54d
32 class LinearRangeMapper : public RangeMapper 32 class LinearRangeMapper : public RangeMapper
33 { 33 {
34 public: 34 public:
35 LinearRangeMapper(int minpos, int maxpos, 35 LinearRangeMapper(int minpos, int maxpos,
36 float minval, float maxval, 36 float minval, float maxval,
37 QString unit = ""); 37 QString unit = "", bool inverted = false);
38 38
39 virtual int getPositionForValue(float value) const; 39 virtual int getPositionForValue(float value) const;
40 virtual float getValueForPosition(int position) const; 40 virtual float getValueForPosition(int position) const;
41 41
42 virtual QString getUnit() const { return m_unit; } 42 virtual QString getUnit() const { return m_unit; }
45 int m_minpos; 45 int m_minpos;
46 int m_maxpos; 46 int m_maxpos;
47 float m_minval; 47 float m_minval;
48 float m_maxval; 48 float m_maxval;
49 QString m_unit; 49 QString m_unit;
50 bool m_inverted;
50 }; 51 };
51 52
52 53
53 class LogRangeMapper : public RangeMapper 54 class LogRangeMapper : public RangeMapper
54 { 55 {
55 public: 56 public:
56 LogRangeMapper(int minpos, int maxpos, 57 LogRangeMapper(int minpos, int maxpos,
57 float minval, float maxval, 58 float minval, float maxval,
58 QString m_unit = ""); 59 QString m_unit = "", bool inverted = false);
59 60
60 static void convertRatioMinLog(float ratio, float minlog, 61 static void convertRatioMinLog(float ratio, float minlog,
61 int minpos, int maxpos, 62 int minpos, int maxpos,
62 float &minval, float &maxval); 63 float &minval, float &maxval);
63 64
75 int m_maxpos; 76 int m_maxpos;
76 float m_ratio; 77 float m_ratio;
77 float m_minlog; 78 float m_minlog;
78 float m_maxlog; 79 float m_maxlog;
79 QString m_unit; 80 QString m_unit;
81 bool m_inverted;
80 }; 82 };
81 83
82 84
83 #endif 85 #endif