comparison layer/NoteLayer.cpp @ 248:28c8e8e3c537

* Fix many compile warnings, remove some debug output
author Chris Cannam
date Mon, 30 Apr 2007 13:36:23 +0000
parents b4809e942e7d
children e175ade2d6b0
comparison
equal deleted inserted replaced
247:0e9f59f991aa 248:28c8e8e3c537
293 293
294 NoteModel::PointList usePoints = prevPoints; 294 NoteModel::PointList usePoints = prevPoints;
295 295
296 if (prevPoints.empty()) { 296 if (prevPoints.empty()) {
297 usePoints = nextPoints; 297 usePoints = nextPoints;
298 } else if (prevPoints.begin()->frame < v->getStartFrame() && 298 } else if (long(prevPoints.begin()->frame) < v->getStartFrame() &&
299 !(nextPoints.begin()->frame > v->getEndFrame())) { 299 !(nextPoints.begin()->frame > v->getEndFrame())) {
300 usePoints = nextPoints; 300 usePoints = nextPoints;
301 } else if (nextPoints.begin()->frame - frame < 301 } else if (long(nextPoints.begin()->frame) - frame <
302 frame - prevPoints.begin()->frame) { 302 frame - long(prevPoints.begin()->frame)) {
303 usePoints = nextPoints; 303 usePoints = nextPoints;
304 } 304 }
305 305
306 if (!usePoints.empty()) { 306 if (!usePoints.empty()) {
307 int fuzz = 2; 307 int fuzz = 2;
602 602
603 float min = m_model->getValueMinimum(); 603 float min = m_model->getValueMinimum();
604 float max = m_model->getValueMaximum(); 604 float max = m_model->getValueMaximum();
605 if (max == min) max = min + 1.0; 605 if (max == min) max = min + 1.0;
606 606
607 int origin = int(nearbyint(v->height() -
608 (-min * v->height()) / (max - min)));
609
610 QPoint localPos; 607 QPoint localPos;
611 long illuminateFrame = -1; 608 long illuminateFrame = -1;
612 609
613 if (v->shouldIlluminateLocalFeatures(this, localPos)) { 610 if (v->shouldIlluminateLocalFeatures(this, localPos)) {
614 NoteModel::PointList localPoints = 611 NoteModel::PointList localPoints =
707 m_editingPoint.duration = newDuration; 704 m_editingPoint.duration = newDuration;
708 m_editingCommand->addPoint(m_editingPoint); 705 m_editingCommand->addPoint(m_editingPoint);
709 } 706 }
710 707
711 void 708 void
712 NoteLayer::drawEnd(View *v, QMouseEvent *e) 709 NoteLayer::drawEnd(View *, QMouseEvent *)
713 { 710 {
714 // std::cerr << "NoteLayer::drawEnd(" << e->x() << "," << e->y() << ")" << std::endl; 711 // std::cerr << "NoteLayer::drawEnd(" << e->x() << "," << e->y() << ")" << std::endl;
715 if (!m_model || !m_editing) return; 712 if (!m_model || !m_editing) return;
716 m_editingCommand->finish(); 713 m_editingCommand->finish();
717 m_editingCommand = 0; 714 m_editingCommand = 0;
762 m_editingPoint.value = value; 759 m_editingPoint.value = value;
763 m_editingCommand->addPoint(m_editingPoint); 760 m_editingCommand->addPoint(m_editingPoint);
764 } 761 }
765 762
766 void 763 void
767 NoteLayer::editEnd(View *v, QMouseEvent *e) 764 NoteLayer::editEnd(View *, QMouseEvent *)
768 { 765 {
769 // std::cerr << "NoteLayer::editEnd(" << e->x() << "," << e->y() << ")" << std::endl; 766 // std::cerr << "NoteLayer::editEnd(" << e->x() << "," << e->y() << ")" << std::endl;
770 if (!m_model || !m_editing) return; 767 if (!m_model || !m_editing) return;
771 768
772 if (m_editingCommand) { 769 if (m_editingCommand) {
934 } 931 }
935 } 932 }
936 } 933 }
937 934
938 bool 935 bool
939 NoteLayer::paste(const Clipboard &from, int frameOffset, bool interactive) 936 NoteLayer::paste(const Clipboard &from, int frameOffset, bool /* interactive */)
940 { 937 {
941 if (!m_model) return false; 938 if (!m_model) return false;
942 939
943 const Clipboard::PointList &points = from.getPoints(); 940 const Clipboard::PointList &points = from.getPoints();
944 941