comparison layer/WaveformLayer.cpp @ 607:5b72899d692b

Give a dedicated key to toggling the centre line, and move it out of the overlay level setting -- reducing number of overlay levels to 3. Introduce two distinct vertical scale types (so that we can hide the spectrogram colour scale part easily)
author Chris Cannam
date Mon, 30 Jan 2012 16:01:59 +0000
parents 4806715f7a19
children ea786e8bd931
comparison
equal deleted inserted replaced
606:fbab21439115 607:5b72899d692b
1152 1152
1153 return true; 1153 return true;
1154 } 1154 }
1155 1155
1156 int 1156 int
1157 WaveformLayer::getVerticalScaleWidth(View *, QPainter &paint) const 1157 WaveformLayer::getVerticalScaleWidth(View *, bool, QPainter &paint) const
1158 { 1158 {
1159 if (m_scale == LinearScale) { 1159 if (m_scale == LinearScale) {
1160 return paint.fontMetrics().width("0.0") + 13; 1160 return paint.fontMetrics().width("0.0") + 13;
1161 } else { 1161 } else {
1162 return std::max(paint.fontMetrics().width(tr("0dB")), 1162 return std::max(paint.fontMetrics().width(tr("0dB")),
1163 paint.fontMetrics().width(tr("-Inf"))) + 13; 1163 paint.fontMetrics().width(tr("-Inf"))) + 13;
1164 } 1164 }
1165 } 1165 }
1166 1166
1167 void 1167 void
1168 WaveformLayer::paintVerticalScale(View *v, QPainter &paint, QRect rect) const 1168 WaveformLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect rect) const
1169 { 1169 {
1170 if (!m_model || !m_model->isOK()) { 1170 if (!m_model || !m_model->isOK()) {
1171 return; 1171 return;
1172 } 1172 }
1173 1173