Mercurial > hg > svgui
comparison layer/SliceLayer.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 | 3803f6dcf361 |
children | 1a0dfcbffaf1 |
comparison
equal
deleted
inserted
replaced
606:fbab21439115 | 607:5b72899d692b |
---|---|
328 } | 328 } |
329 } | 329 } |
330 | 330 |
331 paint.setPen(getBaseQColor()); | 331 paint.setPen(getBaseQColor()); |
332 | 332 |
333 int xorigin = getVerticalScaleWidth(v, paint) + 1; | 333 int xorigin = getVerticalScaleWidth(v, true, paint) + 1; |
334 int w = v->width() - xorigin - 1; | 334 int w = v->width() - xorigin - 1; |
335 | 335 |
336 m_xorigins[v] = xorigin; // for use in getFeatureDescription | 336 m_xorigins[v] = xorigin; // for use in getFeatureDescription |
337 | 337 |
338 int yorigin = v->height() - 20 - paint.fontMetrics().height() - 7; | 338 int yorigin = v->height() - 20 - paint.fontMetrics().height() - 7; |
496 } | 496 } |
497 */ | 497 */ |
498 } | 498 } |
499 | 499 |
500 int | 500 int |
501 SliceLayer::getVerticalScaleWidth(View *, QPainter &paint) const | 501 SliceLayer::getVerticalScaleWidth(View *, bool, QPainter &paint) const |
502 { | 502 { |
503 if (m_energyScale == LinearScale || m_energyScale == AbsoluteScale) { | 503 if (m_energyScale == LinearScale || m_energyScale == AbsoluteScale) { |
504 return std::max(paint.fontMetrics().width("0.0") + 13, | 504 return std::max(paint.fontMetrics().width("0.0") + 13, |
505 paint.fontMetrics().width("x10-10")); | 505 paint.fontMetrics().width("x10-10")); |
506 } else { | 506 } else { |
508 paint.fontMetrics().width(tr("-Inf"))) + 13; | 508 paint.fontMetrics().width(tr("-Inf"))) + 13; |
509 } | 509 } |
510 } | 510 } |
511 | 511 |
512 void | 512 void |
513 SliceLayer::paintVerticalScale(View *v, QPainter &paint, QRect rect) const | 513 SliceLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect rect) const |
514 { | 514 { |
515 float thresh = m_threshold; | 515 float thresh = m_threshold; |
516 if (m_energyScale != LinearScale && m_energyScale != AbsoluteScale) { | 516 if (m_energyScale != LinearScale && m_energyScale != AbsoluteScale) { |
517 thresh = AudioLevel::dB_to_multiplier(getThresholdDb()); | 517 thresh = AudioLevel::dB_to_multiplier(getThresholdDb()); |
518 } | 518 } |