Mercurial > hg > svgui
comparison layer/WaveformLayer.h @ 997:296ccd36f626 tony-2.0-integration
Merge through to branch for Tony 2.0
author | Chris Cannam |
---|---|
date | Thu, 20 Aug 2015 14:54:21 +0100 |
parents | e3c7da3d896e |
children | a34a2a25907c |
comparison
equal
deleted
inserted
replaced
943:788b7623bfca | 997:296ccd36f626 |
---|---|
36 | 36 |
37 virtual const ZoomConstraint *getZoomConstraint() const { | 37 virtual const ZoomConstraint *getZoomConstraint() const { |
38 return m_model ? m_model->getZoomConstraint() : 0; | 38 return m_model ? m_model->getZoomConstraint() : 0; |
39 } | 39 } |
40 virtual const Model *getModel() const { return m_model; } | 40 virtual const Model *getModel() const { return m_model; } |
41 virtual void paint(View *v, QPainter &paint, QRect rect) const; | 41 virtual void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; |
42 | 42 |
43 virtual QString getFeatureDescription(View *v, QPoint &) const; | 43 virtual QString getFeatureDescription(LayerGeometryProvider *v, QPoint &) const; |
44 | 44 |
45 virtual ColourSignificance getLayerColourSignificance() const { | 45 virtual ColourSignificance getLayerColourSignificance() const { |
46 return ColourAndBackgroundSignificant; | 46 return ColourAndBackgroundSignificant; |
47 } | 47 } |
48 | 48 |
49 virtual int getVerticalScaleWidth(View *v, bool detailed, QPainter &) const; | 49 virtual int getVerticalScaleWidth(LayerGeometryProvider *v, bool detailed, QPainter &) const; |
50 virtual void paintVerticalScale(View *v, bool detailed, QPainter &paint, QRect rect) const; | 50 virtual void paintVerticalScale(LayerGeometryProvider *v, bool detailed, QPainter &paint, QRect rect) const; |
51 | 51 |
52 void setModel(const RangeSummarisableTimeValueModel *model); | 52 void setModel(const RangeSummarisableTimeValueModel *model); |
53 | 53 |
54 virtual PropertyList getProperties() const; | 54 virtual PropertyList getProperties() const; |
55 virtual QString getPropertyLabel(const PropertyName &) const; | 55 virtual QString getPropertyLabel(const PropertyName &) const; |
178 * The default is not to use aggressive cacheing. | 178 * The default is not to use aggressive cacheing. |
179 */ | 179 */ |
180 void setAggressiveCacheing(bool); | 180 void setAggressiveCacheing(bool); |
181 bool getAggressiveCacheing() const { return m_aggressive; } | 181 bool getAggressiveCacheing() const { return m_aggressive; } |
182 | 182 |
183 virtual bool isLayerScrollable(const View *) const; | 183 virtual bool isLayerScrollable(const LayerGeometryProvider *) const; |
184 | 184 |
185 virtual int getCompletion(View *) const; | 185 virtual int getCompletion(LayerGeometryProvider *) const; |
186 | 186 |
187 virtual bool getValueExtents(double &min, double &max, | 187 virtual bool getValueExtents(double &min, double &max, |
188 bool &log, QString &unit) const; | 188 bool &log, QString &unit) const; |
189 | 189 |
190 virtual bool getYScaleValue(const View *v, int y, | 190 virtual bool getYScaleValue(const LayerGeometryProvider *v, int y, |
191 double &value, QString &unit) const; | 191 double &value, QString &unit) const; |
192 | 192 |
193 virtual bool getYScaleDifference(const View *v, int y0, int y1, | 193 virtual bool getYScaleDifference(const LayerGeometryProvider *v, int y0, int y1, |
194 double &diff, QString &unit) const; | 194 double &diff, QString &unit) const; |
195 | 195 |
196 virtual void toXml(QTextStream &stream, QString indent = "", | 196 virtual void toXml(QTextStream &stream, QString indent = "", |
197 QString extraAttributes = "") const; | 197 QString extraAttributes = "") const; |
198 | 198 |
200 | 200 |
201 virtual int getVerticalZoomSteps(int &defaultStep) const; | 201 virtual int getVerticalZoomSteps(int &defaultStep) const; |
202 virtual int getCurrentVerticalZoomStep() const; | 202 virtual int getCurrentVerticalZoomStep() const; |
203 virtual void setVerticalZoomStep(int); | 203 virtual void setVerticalZoomStep(int); |
204 | 204 |
205 virtual bool canExistWithoutModel() const { return true; } | |
206 | |
205 protected: | 207 protected: |
206 int dBscale(double sample, int m) const; | 208 int dBscale(double sample, int m) const; |
207 | 209 |
208 const RangeSummarisableTimeValueModel *m_model; // I do not own this | 210 const RangeSummarisableTimeValueModel *m_model; // I do not own this |
209 | 211 |
210 /// Return value is number of channels displayed | 212 /// Return value is number of channels displayed |
211 int getChannelArrangement(int &min, int &max, | 213 int getChannelArrangement(int &min, int &max, |
212 bool &merging, bool &mixing) const; | 214 bool &merging, bool &mixing) const; |
213 | 215 |
214 int getYForValue(const View *v, double value, int channel) const; | 216 int getYForValue(const LayerGeometryProvider *v, double value, int channel) const; |
215 | 217 |
216 double getValueForY(const View *v, int y, int &channel) const; | 218 double getValueForY(const LayerGeometryProvider *v, int y, int &channel) const; |
217 | 219 |
218 bool getSourceFramesForX(View *v, int x, int modelZoomLevel, | 220 bool getSourceFramesForX(LayerGeometryProvider *v, int x, int modelZoomLevel, |
219 sv_frame_t &f0, sv_frame_t &f1) const; | 221 sv_frame_t &f0, sv_frame_t &f1) const; |
220 | 222 |
221 float getNormalizeGain(View *v, int channel) const; | 223 float getNormalizeGain(LayerGeometryProvider *v, int channel) const; |
222 | 224 |
223 virtual void flagBaseColourChanged() { m_cacheValid = false; } | 225 virtual void flagBaseColourChanged() { m_cacheValid = false; } |
224 | 226 |
225 float m_gain; | 227 float m_gain; |
226 bool m_autoNormalize; | 228 bool m_autoNormalize; |