comparison layer/WaveformLayer.h @ 1470:696e569ff21b by-id

Further layer updates for ById
author Chris Cannam
date Fri, 28 Jun 2019 17:37:22 +0100
parents 05d614f6e46d
children 10fe8124dc17
comparison
equal deleted inserted replaced
1469:11a150e65ee1 1470:696e569ff21b
34 34
35 public: 35 public:
36 WaveformLayer(); 36 WaveformLayer();
37 ~WaveformLayer(); 37 ~WaveformLayer();
38 38
39 const ZoomConstraint *getZoomConstraint() const override { 39 const ZoomConstraint *getZoomConstraint() const override;
40 return m_model ? m_model->getZoomConstraint() : 0; 40 ModelId getModel() const override { return m_model; }
41 }
42 const Model *getModel() const override { return m_model; }
43 void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override; 41 void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override;
44 42
45 QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override; 43 QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const override;
46 44
47 ColourSignificance getLayerColourSignificance() const override { 45 ColourSignificance getLayerColourSignificance() const override {
49 } 47 }
50 48
51 int getVerticalScaleWidth(LayerGeometryProvider *v, bool detailed, QPainter &) const override; 49 int getVerticalScaleWidth(LayerGeometryProvider *v, bool detailed, QPainter &) const override;
52 void paintVerticalScale(LayerGeometryProvider *v, bool detailed, QPainter &paint, QRect rect) const override; 50 void paintVerticalScale(LayerGeometryProvider *v, bool detailed, QPainter &paint, QRect rect) const override;
53 51
54 void setModel(const RangeSummarisableTimeValueModel *model); 52 void setModel(ModelId model); // a RangeSummarisableTimeValueModel
55 53
56 PropertyList getProperties() const override; 54 PropertyList getProperties() const override;
57 QString getPropertyLabel(const PropertyName &) const override; 55 QString getPropertyLabel(const PropertyName &) const override;
58 QString getPropertyIconName(const PropertyName &) const override; 56 QString getPropertyIconName(const PropertyName &) const override;
59 PropertyType getPropertyType(const PropertyName &) const override; 57 PropertyType getPropertyType(const PropertyName &) const override;
194 bool canExistWithoutModel() const override { return true; } 192 bool canExistWithoutModel() const override { return true; }
195 193
196 protected: 194 protected:
197 double dBscale(double sample, int m) const; 195 double dBscale(double sample, int m) const;
198 196
199 const RangeSummarisableTimeValueModel *m_model; // I do not own this 197 ModelId m_model;
200 198
201 typedef std::vector<RangeSummarisableTimeValueModel::RangeBlock> RangeVec; 199 typedef std::vector<RangeSummarisableTimeValueModel::RangeBlock> RangeVec;
202 200
203 /// Return value is number of channels displayed 201 /// Return value is number of channels displayed
204 int getChannelArrangement(int &min, int &max, 202 int getChannelArrangement(int &min, int &max,