comparison layer/TimeValueLayer.cpp @ 296:ea37c229a578

* Fix #1757772 tempo, dynamic related plug-ins bug -- make auto-align only auto-align if there is a unit involved * Fix #1755366 text layer bug in retrieved session * Fix input model selection in plugin parameter dialog (was being ignored) * Use lighter background than the standard widget one for panes (assuming the widget background is light but not white) -- similarly darker if dark * Fix colour reference counting in loaded session in SingleColourLayer * Reset overview pane colour when switching dark background on or off
author Chris Cannam
date Tue, 14 Aug 2007 13:58:53 +0000
parents e27f546f83ad
children f4458c8bffa6
comparison
equal deleted inserted replaced
295:5804703450d8 296:ea37c229a578
257 } 257 }
258 258
259 bool 259 bool
260 TimeValueLayer::getDisplayExtents(float &min, float &max) const 260 TimeValueLayer::getDisplayExtents(float &min, float &max) const
261 { 261 {
262 if (!m_model || m_verticalScale == AutoAlignScale) return false; 262 if (!m_model || shouldAutoAlign()) return false;
263 263
264 min = m_model->getValueMinimum(); 264 min = m_model->getValueMinimum();
265 max = m_model->getValueMaximum(); 265 max = m_model->getValueMaximum();
266 return true; 266 return true;
267 } 267 }
429 { 429 {
430 min = 0.0; 430 min = 0.0;
431 max = 0.0; 431 max = 0.0;
432 log = false; 432 log = false;
433 433
434 if (m_verticalScale == AutoAlignScale) { 434 if (shouldAutoAlign()) {
435 435
436 if (!v->getValueExtents(m_model->getScaleUnits(), min, max, log)) { 436 if (!v->getValueExtents(m_model->getScaleUnits(), min, max, log)) {
437 min = m_model->getValueMinimum(); 437 min = m_model->getValueMinimum();
438 max = m_model->getValueMaximum(); 438 max = m_model->getValueMaximum();
439 } else if (log) { 439 } else if (log) {
494 } 494 }
495 495
496 return val; 496 return val;
497 } 497 }
498 498
499 bool
500 TimeValueLayer::shouldAutoAlign() const
501 {
502 if (!m_model) return false;
503 QString unit = m_model->getScaleUnits();
504 return (m_verticalScale == AutoAlignScale && unit != "");
505 }
506
499 QColor 507 QColor
500 TimeValueLayer::getColourForValue(View *v, float val) const 508 TimeValueLayer::getColourForValue(View *v, float val) const
501 { 509 {
502 float min, max; 510 float min, max;
503 bool log; 511 bool log;
564 long illuminateFrame = -1; 572 long illuminateFrame = -1;
565 573
566 if (v->shouldIlluminateLocalFeatures(this, localPos)) { 574 if (v->shouldIlluminateLocalFeatures(this, localPos)) {
567 SparseTimeValueModel::PointList localPoints = 575 SparseTimeValueModel::PointList localPoints =
568 getLocalPoints(v, localPos.x()); 576 getLocalPoints(v, localPos.x());
569 std::cerr << "TimeValueLayer: " << localPoints.size() << " local points" << std::endl; 577 // std::cerr << "TimeValueLayer: " << localPoints.size() << " local points" << std::endl;
570 if (!localPoints.empty()) illuminateFrame = localPoints.begin()->frame; 578 if (!localPoints.empty()) illuminateFrame = localPoints.begin()->frame;
571 } 579 }
572 580
573 int w = 581 int w =
574 v->getXForFrame(frame0 + m_model->getResolution()) - 582 v->getXForFrame(frame0 + m_model->getResolution()) -