Mercurial > hg > svgui
comparison layer/TimeValueLayer.cpp @ 248:28c8e8e3c537
* Fix many compile warnings, remove some debug output
author | Chris Cannam |
---|---|
date | Mon, 30 Apr 2007 13:36:23 +0000 |
parents | 34bbbcb3c01f |
children | e175ade2d6b0 |
comparison
equal
deleted
inserted
replaced
247:0e9f59f991aa | 248:28c8e8e3c537 |
---|---|
334 | 334 |
335 SparseTimeValueModel::PointList usePoints = prevPoints; | 335 SparseTimeValueModel::PointList usePoints = prevPoints; |
336 | 336 |
337 if (prevPoints.empty()) { | 337 if (prevPoints.empty()) { |
338 usePoints = nextPoints; | 338 usePoints = nextPoints; |
339 } else if (prevPoints.begin()->frame < v->getStartFrame() && | 339 } else if (long(prevPoints.begin()->frame) < v->getStartFrame() && |
340 !(nextPoints.begin()->frame > v->getEndFrame())) { | 340 !(nextPoints.begin()->frame > v->getEndFrame())) { |
341 usePoints = nextPoints; | 341 usePoints = nextPoints; |
342 } else if (nextPoints.begin()->frame - frame < | 342 } else if (nextPoints.begin()->frame - frame < |
343 frame - prevPoints.begin()->frame) { | 343 frame - prevPoints.begin()->frame) { |
344 usePoints = nextPoints; | 344 usePoints = nextPoints; |
548 { | 548 { |
549 float min, max; | 549 float min, max; |
550 bool log; | 550 bool log; |
551 getScaleExtents(v, min, max, log); | 551 getScaleExtents(v, min, max, log); |
552 | 552 |
553 float logthresh = -80; | |
554 | |
555 if (min > max) std::swap(min, max); | 553 if (min > max) std::swap(min, max); |
556 if (max == min) max = min + 1; | 554 if (max == min) max = min + 1; |
557 | 555 |
558 if (log) { | 556 if (log) { |
559 LogRange::mapRange(min, max); | 557 LogRange::mapRange(min, max); |
781 // looks like save/restore doesn't deal with this: | 779 // looks like save/restore doesn't deal with this: |
782 paint.setRenderHint(QPainter::Antialiasing, false); | 780 paint.setRenderHint(QPainter::Antialiasing, false); |
783 } | 781 } |
784 | 782 |
785 int | 783 int |
786 TimeValueLayer::getVerticalScaleWidth(View *v, QPainter &paint) const | 784 TimeValueLayer::getVerticalScaleWidth(View *, QPainter &paint) const |
787 { | 785 { |
788 int w = paint.fontMetrics().width("-000.000"); | 786 int w = paint.fontMetrics().width("-000.000"); |
789 if (m_plotStyle == PlotSegmentation) return w + 20; | 787 if (m_plotStyle == PlotSegmentation) return w + 20; |
790 else return w + 10; | 788 else return w + 10; |
791 } | 789 } |
792 | 790 |
793 void | 791 void |
794 TimeValueLayer::paintVerticalScale(View *v, QPainter &paint, QRect rect) const | 792 TimeValueLayer::paintVerticalScale(View *v, QPainter &paint, QRect) const |
795 { | 793 { |
796 if (!m_model) return; | 794 if (!m_model) return; |
797 | 795 |
798 int h = v->height(); | 796 int h = v->height(); |
799 | 797 |
964 m_editingPoint.value = value; | 962 m_editingPoint.value = value; |
965 m_editingCommand->addPoint(m_editingPoint); | 963 m_editingCommand->addPoint(m_editingPoint); |
966 } | 964 } |
967 | 965 |
968 void | 966 void |
969 TimeValueLayer::drawEnd(View *v, QMouseEvent *e) | 967 TimeValueLayer::drawEnd(View *, QMouseEvent *) |
970 { | 968 { |
971 // std::cerr << "TimeValueLayer::drawEnd(" << e->x() << "," << e->y() << ")" << std::endl; | 969 // std::cerr << "TimeValueLayer::drawEnd(" << e->x() << "," << e->y() << ")" << std::endl; |
972 if (!m_model || !m_editing) return; | 970 if (!m_model || !m_editing) return; |
973 m_editingCommand->finish(); | 971 m_editingCommand->finish(); |
974 m_editingCommand = 0; | 972 m_editingCommand = 0; |
1019 m_editingPoint.value = value; | 1017 m_editingPoint.value = value; |
1020 m_editingCommand->addPoint(m_editingPoint); | 1018 m_editingCommand->addPoint(m_editingPoint); |
1021 } | 1019 } |
1022 | 1020 |
1023 void | 1021 void |
1024 TimeValueLayer::editEnd(View *v, QMouseEvent *e) | 1022 TimeValueLayer::editEnd(View *, QMouseEvent *) |
1025 { | 1023 { |
1026 // std::cerr << "TimeValueLayer::editEnd(" << e->x() << "," << e->y() << ")" << std::endl; | 1024 // std::cerr << "TimeValueLayer::editEnd(" << e->x() << "," << e->y() << ")" << std::endl; |
1027 if (!m_model || !m_editing) return; | 1025 if (!m_model || !m_editing) return; |
1028 | 1026 |
1029 if (m_editingCommand) { | 1027 if (m_editingCommand) { |