comparison layer/SpectrogramLayer.h @ 1504:150d4e561b07

Only set maximum frequency on FFT model when in a special verticallyFixed mode
author Chris Cannam
date Thu, 12 Sep 2019 13:50:24 +0100
parents e540aa5d89cd
children 4eafe5a1b655
comparison
equal deleted inserted replaced
1503:2c7a480f93ca 1504:150d4e561b07
53 { 53 {
54 Q_OBJECT 54 Q_OBJECT
55 55
56 public: 56 public:
57 enum Configuration { FullRangeDb, MelodicRange, MelodicPeaks }; 57 enum Configuration { FullRangeDb, MelodicRange, MelodicPeaks };
58 58
59 /**
60 * Construct a SpectrogramLayer with default parameters
61 * appropriate for the given configuration.
62 */
59 SpectrogramLayer(Configuration = FullRangeDb); 63 SpectrogramLayer(Configuration = FullRangeDb);
60 ~SpectrogramLayer(); 64 ~SpectrogramLayer();
61 65
62 const ZoomConstraint *getZoomConstraint() const override { return this; } 66 const ZoomConstraint *getZoomConstraint() const override { return this; }
63 ModelId getModel() const override { return m_model; } 67 ModelId getModel() const override { return m_model; }
64 void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override; 68 void paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const override;
65 void setSynchronousPainting(bool synchronous) override; 69 void setSynchronousPainting(bool synchronous) override;
66 70
87 QString getPropertyLabel(const PropertyName &) const override; 91 QString getPropertyLabel(const PropertyName &) const override;
88 QString getPropertyIconName(const PropertyName &) const override; 92 QString getPropertyIconName(const PropertyName &) const override;
89 PropertyType getPropertyType(const PropertyName &) const override; 93 PropertyType getPropertyType(const PropertyName &) const override;
90 QString getPropertyGroupName(const PropertyName &) const override; 94 QString getPropertyGroupName(const PropertyName &) const override;
91 int getPropertyRangeAndValue(const PropertyName &, 95 int getPropertyRangeAndValue(const PropertyName &,
92 int *min, int *max, int *deflt) const override; 96 int *min, int *max, int *deflt) const override;
93 QString getPropertyValueLabel(const PropertyName &, 97 QString getPropertyValueLabel(const PropertyName &,
94 int value) const override; 98 int value) const override;
95 QString getPropertyValueIconName(const PropertyName &, 99 QString getPropertyValueIconName(const PropertyName &,
96 int value) const override; 100 int value) const override;
97 RangeMapper *getNewPropertyRangeMapper(const PropertyName &) const override; 101 RangeMapper *getNewPropertyRangeMapper(const PropertyName &) const override;
130 * 134 *
131 * The default is 10^-8 (-80dB). 135 * The default is 10^-8 (-80dB).
132 */ 136 */
133 void setThreshold(float threshold); 137 void setThreshold(float threshold);
134 float getThreshold() const; 138 float getThreshold() const;
139
140 /**
141 * Mark the spectrogram layer as having a fixed range in the
142 * vertical axis. This indicates that the visible frequency range
143 * is determined entirely by the configuration requested on
144 * construction, and that setMinFrequency, setMaxFrequency, and
145 * setDisplayExtents will never be called. This may allow some
146 * cache-size-related optimisations. It should be called
147 * immediately after construction, if at all.
148 *
149 * Note that this cannot be reversed on a given object (this call
150 * takes no argument and there is no inverse call).
151 */
152 void setVerticallyFixed();
135 153
136 void setMinFrequency(int); 154 void setMinFrequency(int);
137 int getMinFrequency() const; 155 int getMinFrequency() const;
138 156
139 void setMaxFrequency(int); // 0 -> no maximum 157 void setMaxFrequency(int); // 0 -> no maximum
257 int m_colourRotation; 275 int m_colourRotation;
258 int m_initialRotation; 276 int m_initialRotation;
259 int m_minFrequency; 277 int m_minFrequency;
260 int m_maxFrequency; 278 int m_maxFrequency;
261 int m_initialMaxFrequency; 279 int m_initialMaxFrequency;
280 bool m_verticallyFixed;
262 ColourScaleType m_colourScale; 281 ColourScaleType m_colourScale;
263 double m_colourScaleMultiple; 282 double m_colourScaleMultiple;
264 int m_colourMap; 283 int m_colourMap;
265 bool m_colourInverted; 284 bool m_colourInverted;
266 mutable QColor m_crosshairColour; 285 mutable QColor m_crosshairColour;