comparison layer/WaveformLayer.h @ 67:c4fff27cd651

* Add auto-normalize option to waveform layer * Various fixes to display of dB/metered levels in waveform layer. Still need to fix to ensure they don't waste half the display * Add mix channels option to waveform layer * Use multiple transforms menus, one per transform type -- not sure about this * Give centroid plugin two outputs, for log and linear frequency weightings * Show scale units from plugin in time-value display
author Chris Cannam
date Wed, 29 Mar 2006 12:35:17 +0000
parents 705f05ab42e3
children 193b569a975f
comparison
equal deleted inserted replaced
66:e9eac9368e29 67:c4fff27cd651
62 */ 62 */
63 void setGain(float gain); 63 void setGain(float gain);
64 float getGain() const { return m_gain; } 64 float getGain() const { return m_gain; }
65 65
66 /** 66 /**
67 * Toggle automatic normalization of the currently visible waveform.
68 */
69 void setAutoNormalize(bool);
70 bool getAutoNormalize() const { return m_autoNormalize; }
71
72 /**
67 * Set the basic display colour for waveforms. 73 * Set the basic display colour for waveforms.
68 * 74 *
69 * The default is black. 75 * The default is black.
70 *!!! NB should default to white if the associated View !hasLightBackground() 76 *!!! NB should default to white if the associated View !hasLightBackground()
71 */ 77 */
93 */ 99 */
94 void setUseGreyscale(bool); 100 void setUseGreyscale(bool);
95 bool getUseGreyscale() const { return m_greyscale; } 101 bool getUseGreyscale() const { return m_greyscale; }
96 102
97 103
98 enum ChannelMode { SeparateChannels, MergeChannels }; 104 enum ChannelMode { SeparateChannels, MixChannels, MergeChannels };
99 105
100 /** 106 /**
101 * Specify whether multi-channel audio data should be displayed 107 * Specify whether multi-channel audio data should be displayed
102 * with a separate axis per channel (SeparateChannels), or with a 108 * with a separate axis per channel (SeparateChannels), with a
103 * single synthetic axis showing channel 0 above the axis and 109 * single synthetic axis showing channel 0 above the axis and
104 * channel 1 below (MergeChannels). 110 * channel 1 below (MergeChannels), or with a single axis showing
111 * the average of the channels (MixChannels).
105 * 112 *
106 * MergeChannels does not work for files with more than 2 113 * MergeChannels does not work for files with more than 2
107 * channels. 114 * channels.
108 * 115 *
109 * The default is SeparateChannels. 116 * The default is SeparateChannels.
159 * The default is not to use aggressive cacheing. 166 * The default is not to use aggressive cacheing.
160 */ 167 */
161 void setAggressiveCacheing(bool); 168 void setAggressiveCacheing(bool);
162 bool getAggressiveCacheing() const { return m_aggressive; } 169 bool getAggressiveCacheing() const { return m_aggressive; }
163 170
171 virtual bool isLayerScrollable(const View *) const;
172
164 virtual int getCompletion() const; 173 virtual int getCompletion() const;
165 174
166 virtual QString toXmlString(QString indent = "", 175 virtual QString toXmlString(QString indent = "",
167 QString extraAttributes = "") const; 176 QString extraAttributes = "") const;
168 177
172 int dBscale(float sample, int m) const; 181 int dBscale(float sample, int m) const;
173 182
174 const RangeSummarisableTimeValueModel *m_model; // I do not own this 183 const RangeSummarisableTimeValueModel *m_model; // I do not own this
175 184
176 /// Return value is number of channels displayed 185 /// Return value is number of channels displayed
177 size_t getChannelArrangement(size_t &min, size_t &max, bool &merging) const; 186 size_t getChannelArrangement(size_t &min, size_t &max,
187 bool &merging, bool &mixing) const;
178 188
179 float m_gain; 189 float m_gain;
190 bool m_autoNormalize;
180 QColor m_colour; 191 QColor m_colour;
181 bool m_showMeans; 192 bool m_showMeans;
182 bool m_greyscale; 193 bool m_greyscale;
183 ChannelMode m_channelMode; 194 ChannelMode m_channelMode;
184 int m_channel; 195 int m_channel;
185 Scale m_scale; 196 Scale m_scale;
186 bool m_aggressive; 197 bool m_aggressive;
187 198
199 mutable std::vector<float> m_effectiveGains;
200
188 mutable QPixmap *m_cache; 201 mutable QPixmap *m_cache;
189 mutable bool m_cacheValid; 202 mutable bool m_cacheValid;
190 mutable int m_cacheZoomLevel; 203 mutable int m_cacheZoomLevel;
191 }; 204 };
192 205