Mercurial > hg > svgui
comparison layer/WaveformLayer.h @ 944:78c152e4db95
Merge from branch tonioni
author | Chris Cannam |
---|---|
date | Mon, 20 Apr 2015 09:12:17 +0100 |
parents | 4a578a360011 |
children | 94e4952a6774 e53a87a5efb2 |
comparison
equal
deleted
inserted
replaced
896:78e041e45ff0 | 944:78c152e4db95 |
---|---|
154 * effectively no space at the very top of the layer; 1.0 would | 154 * effectively no space at the very top of the layer; 1.0 would |
155 * indicate that the waveform occupies no space at the very | 155 * indicate that the waveform occupies no space at the very |
156 * bottom; the default value of 0.5 indicates that it occupies the | 156 * bottom; the default value of 0.5 indicates that it occupies the |
157 * whole layer, centred at the middle. | 157 * whole layer, centred at the middle. |
158 */ | 158 */ |
159 void setMiddleLineHeight(float height); | 159 void setMiddleLineHeight(double); |
160 float getMiddleLineHeight() const { return m_middleLineHeight; } | 160 double getMiddleLineHeight() const { return m_middleLineHeight; } |
161 | 161 |
162 /** | 162 /** |
163 * Enable or disable aggressive pixmap cacheing. If enabled, | 163 * Enable or disable aggressive pixmap cacheing. If enabled, |
164 * waveforms will be rendered to an off-screen pixmap and | 164 * waveforms will be rendered to an off-screen pixmap and |
165 * refreshed from there instead of being redrawn from the peak | 165 * refreshed from there instead of being redrawn from the peak |
182 | 182 |
183 virtual bool isLayerScrollable(const View *) const; | 183 virtual bool isLayerScrollable(const View *) const; |
184 | 184 |
185 virtual int getCompletion(View *) const; | 185 virtual int getCompletion(View *) const; |
186 | 186 |
187 virtual bool getValueExtents(float &min, float &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 View *v, int y, |
191 float &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 View *v, int y0, int y1, |
194 float &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 |
199 virtual void setProperties(const QXmlAttributes &attributes); | 199 virtual void setProperties(const QXmlAttributes &attributes); |
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 protected: | 205 protected: |
206 int dBscale(float sample, int m) const; | 206 int dBscale(double sample, int m) const; |
207 | 207 |
208 const RangeSummarisableTimeValueModel *m_model; // I do not own this | 208 const RangeSummarisableTimeValueModel *m_model; // I do not own this |
209 | 209 |
210 /// Return value is number of channels displayed | 210 /// Return value is number of channels displayed |
211 int getChannelArrangement(int &min, int &max, | 211 int getChannelArrangement(int &min, int &max, |
212 bool &merging, bool &mixing) const; | 212 bool &merging, bool &mixing) const; |
213 | 213 |
214 int getYForValue(const View *v, float value, int channel) const; | 214 int getYForValue(const View *v, double value, int channel) const; |
215 | 215 |
216 float getValueForY(const View *v, int y, int &channel) const; | 216 double getValueForY(const View *v, int y, int &channel) const; |
217 | 217 |
218 bool getSourceFramesForX(View *v, int x, int modelZoomLevel, | 218 bool getSourceFramesForX(View *v, int x, int modelZoomLevel, |
219 int &f0, int &f1) const; | 219 sv_frame_t &f0, sv_frame_t &f1) const; |
220 | 220 |
221 float getNormalizeGain(View *v, int channel) const; | 221 float getNormalizeGain(View *v, int channel) const; |
222 | 222 |
223 virtual void flagBaseColourChanged() { m_cacheValid = false; } | 223 virtual void flagBaseColourChanged() { m_cacheValid = false; } |
224 | 224 |
227 bool m_showMeans; | 227 bool m_showMeans; |
228 bool m_greyscale; | 228 bool m_greyscale; |
229 ChannelMode m_channelMode; | 229 ChannelMode m_channelMode; |
230 int m_channel; | 230 int m_channel; |
231 Scale m_scale; | 231 Scale m_scale; |
232 float m_middleLineHeight; | 232 double m_middleLineHeight; |
233 bool m_aggressive; | 233 bool m_aggressive; |
234 | 234 |
235 mutable std::vector<float> m_effectiveGains; | 235 mutable std::vector<float> m_effectiveGains; |
236 | 236 |
237 mutable QPixmap *m_cache; | 237 mutable QPixmap *m_cache; |