comparison layer/WaveformLayer.h @ 1414:fa986b91d77f

Merge from branch fix-static-analysis
author Chris Cannam
date Wed, 09 Jan 2019 15:24:51 +0000
parents 05d614f6e46d
children 696e569ff21b
comparison
equal deleted inserted replaced
1413:0930a27ebea2 1414:fa986b91d77f
11 published by the Free Software Foundation; either version 2 of the 11 published by the Free Software Foundation; either version 2 of the
12 License, or (at your option) any later version. See the file 12 License, or (at your option) any later version. See the file
13 COPYING included with this distribution for more information. 13 COPYING included with this distribution for more information.
14 */ 14 */
15 15
16 #ifndef _WAVEFORM_LAYER_H_ 16 #ifndef SV_WAVEFORM_LAYER_H
17 #define _WAVEFORM_LAYER_H_ 17 #define SV_WAVEFORM_LAYER_H
18 18
19 #include <QRect> 19 #include <QRect>
20 20
21 #include "SingleColourLayer.h" 21 #include "SingleColourLayer.h"
22 22
34 34
35 public: 35 public:
36 WaveformLayer(); 36 WaveformLayer();
37 ~WaveformLayer(); 37 ~WaveformLayer();
38 38
39 virtual const ZoomConstraint *getZoomConstraint() const { 39 const ZoomConstraint *getZoomConstraint() const override {
40 return m_model ? m_model->getZoomConstraint() : 0; 40 return m_model ? m_model->getZoomConstraint() : 0;
41 } 41 }
42 virtual const Model *getModel() const { return m_model; } 42 const Model *getModel() const override { return m_model; }
43 virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; 43 void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override;
44 44
45 virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; 45 QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override;
46 46
47 virtual ColourSignificance getLayerColourSignificance() const { 47 ColourSignificance getLayerColourSignificance() const override {
48 return ColourAndBackgroundSignificant; 48 return ColourAndBackgroundSignificant;
49 } 49 }
50 50
51 virtual int getVerticalScaleWidth(LayerGeometryProvider *v, bool detailed, QPainter &) const; 51 int getVerticalScaleWidth(LayerGeometryProvider *v, bool detailed, QPainter &) const override;
52 virtual void paintVerticalScale(LayerGeometryProvider *v, bool detailed, QPainter &paint, QRect rect) const; 52 void paintVerticalScale(LayerGeometryProvider *v, bool detailed, QPainter &paint, QRect rect) const override;
53 53
54 void setModel(const RangeSummarisableTimeValueModel *model); 54 void setModel(const RangeSummarisableTimeValueModel *model);
55 55
56 virtual PropertyList getProperties() const; 56 PropertyList getProperties() const override;
57 virtual QString getPropertyLabel(const PropertyName &) const; 57 QString getPropertyLabel(const PropertyName &) const override;
58 virtual QString getPropertyIconName(const PropertyName &) const; 58 QString getPropertyIconName(const PropertyName &) const override;
59 virtual PropertyType getPropertyType(const PropertyName &) const; 59 PropertyType getPropertyType(const PropertyName &) const override;
60 virtual QString getPropertyGroupName(const PropertyName &) const; 60 QString getPropertyGroupName(const PropertyName &) const override;
61 virtual int getPropertyRangeAndValue(const PropertyName &, 61 int getPropertyRangeAndValue(const PropertyName &,
62 int *min, int *max, int *deflt) const; 62 int *min, int *max, int *deflt) const override;
63 virtual QString getPropertyValueLabel(const PropertyName &, 63 QString getPropertyValueLabel(const PropertyName &,
64 int value) const; 64 int value) const override;
65 virtual RangeMapper *getNewPropertyRangeMapper(const PropertyName &) const; 65 RangeMapper *getNewPropertyRangeMapper(const PropertyName &) const override;
66 virtual void setProperty(const PropertyName &, int value); 66 void setProperty(const PropertyName &, int value) override;
67 67
68 /** 68 /**
69 * Set the gain multiplier for sample values in this view. 69 * Set the gain multiplier for sample values in this view.
70 * 70 *
71 * The default is 1.0. 71 * The default is 1.0.
167 * The default is not to use aggressive cacheing. 167 * The default is not to use aggressive cacheing.
168 */ 168 */
169 void setAggressiveCacheing(bool); 169 void setAggressiveCacheing(bool);
170 bool getAggressiveCacheing() const { return m_aggressive; } 170 bool getAggressiveCacheing() const { return m_aggressive; }
171 171
172 virtual bool isLayerScrollable(const LayerGeometryProvider *) const; 172 bool isLayerScrollable(const LayerGeometryProvider *) const override;
173 173
174 virtual int getCompletion(LayerGeometryProvider *) const; 174 int getCompletion(LayerGeometryProvider *) const override;
175 175
176 virtual bool getValueExtents(double &min, double &max, 176 bool getValueExtents(double &min, double &max,
177 bool &log, QString &unit) const; 177 bool &log, QString &unit) const override;
178 178
179 virtual bool getYScaleValue(const LayerGeometryProvider *v, int y, 179 bool getYScaleValue(const LayerGeometryProvider *v, int y,
180 double &value, QString &unit) const; 180 double &value, QString &unit) const override;
181 181
182 virtual bool getYScaleDifference(const LayerGeometryProvider *v, int y0, int y1, 182 bool getYScaleDifference(const LayerGeometryProvider *v, int y0, int y1,
183 double &diff, QString &unit) const; 183 double &diff, QString &unit) const override;
184 184
185 virtual void toXml(QTextStream &stream, QString indent = "", 185 void toXml(QTextStream &stream, QString indent = "",
186 QString extraAttributes = "") const; 186 QString extraAttributes = "") const override;
187 187
188 virtual void setProperties(const QXmlAttributes &attributes); 188 void setProperties(const QXmlAttributes &attributes) override;
189 189
190 virtual int getVerticalZoomSteps(int &defaultStep) const; 190 int getVerticalZoomSteps(int &defaultStep) const override;
191 virtual int getCurrentVerticalZoomStep() const; 191 int getCurrentVerticalZoomStep() const override;
192 virtual void setVerticalZoomStep(int); 192 void setVerticalZoomStep(int) override;
193 193
194 virtual bool canExistWithoutModel() const { return true; } 194 bool canExistWithoutModel() const override { return true; }
195 195
196 protected: 196 protected:
197 double dBscale(double sample, int m) const; 197 double dBscale(double sample, int m) const;
198 198
199 const RangeSummarisableTimeValueModel *m_model; // I do not own this 199 const RangeSummarisableTimeValueModel *m_model; // I do not own this
229 bool getSourceFramesForX(LayerGeometryProvider *v, int x, int modelZoomLevel, 229 bool getSourceFramesForX(LayerGeometryProvider *v, int x, int modelZoomLevel,
230 sv_frame_t &f0, sv_frame_t &f1) const; 230 sv_frame_t &f0, sv_frame_t &f1) const;
231 231
232 float getNormalizeGain(LayerGeometryProvider *v, int channel) const; 232 float getNormalizeGain(LayerGeometryProvider *v, int channel) const;
233 233
234 virtual void flagBaseColourChanged() { m_cacheValid = false; } 234 void flagBaseColourChanged() override { m_cacheValid = false; }
235 235
236 float m_gain; 236 float m_gain;
237 bool m_autoNormalize; 237 bool m_autoNormalize;
238 bool m_showMeans; 238 bool m_showMeans;
239 ChannelMode m_channelMode; 239 ChannelMode m_channelMode;