Mercurial > hg > svgui
comparison layer/ImageLayer.cpp @ 806:4c8ca536b54f warnfix_no_size_t
Some more unsigned/long removal
author | Chris Cannam |
---|---|
date | Tue, 17 Jun 2014 15:36:56 +0100 |
parents | 1d526ba11a24 |
children | b66fb15de477 |
comparison
equal
deleted
inserted
replaced
805:1d526ba11a24 | 806:4c8ca536b54f |
---|---|
183 } else { | 183 } else { |
184 return ""; | 184 return ""; |
185 } | 185 } |
186 } | 186 } |
187 | 187 |
188 // long useFrame = points.begin()->frame; | 188 // int useFrame = points.begin()->frame; |
189 | 189 |
190 // RealTime rt = RealTime::frame2RealTime(useFrame, m_model->getSampleRate()); | 190 // RealTime rt = RealTime::frame2RealTime(useFrame, m_model->getSampleRate()); |
191 | 191 |
192 QString text; | 192 QString text; |
193 /* | 193 /* |
290 // Profiler profiler("ImageLayer::paint", true); | 290 // Profiler profiler("ImageLayer::paint", true); |
291 | 291 |
292 // int x0 = rect.left(), x1 = rect.right(); | 292 // int x0 = rect.left(), x1 = rect.right(); |
293 int x0 = 0, x1 = v->width(); | 293 int x0 = 0, x1 = v->width(); |
294 | 294 |
295 long frame0 = v->getFrameForX(x0); | 295 int frame0 = v->getFrameForX(x0); |
296 long frame1 = v->getFrameForX(x1); | 296 int frame1 = v->getFrameForX(x1); |
297 | 297 |
298 ImageModel::PointList points(m_model->getPoints(frame0, frame1)); | 298 ImageModel::PointList points(m_model->getPoints(frame0, frame1)); |
299 if (points.empty()) return; | 299 if (points.empty()) return; |
300 | 300 |
301 paint.save(); | 301 paint.save(); |
561 if (!m_model) { | 561 if (!m_model) { |
562 SVDEBUG << "ImageLayer::drawStart: no model" << endl; | 562 SVDEBUG << "ImageLayer::drawStart: no model" << endl; |
563 return; | 563 return; |
564 } | 564 } |
565 | 565 |
566 long frame = v->getFrameForX(e->x()); | 566 int frame = v->getFrameForX(e->x()); |
567 if (frame < 0) frame = 0; | 567 if (frame < 0) frame = 0; |
568 frame = frame / m_model->getResolution() * m_model->getResolution(); | 568 frame = frame / m_model->getResolution() * m_model->getResolution(); |
569 | 569 |
570 m_editingPoint = ImageModel::Point(frame, "", ""); | 570 m_editingPoint = ImageModel::Point(frame, "", ""); |
571 m_originalPoint = m_editingPoint; | 571 m_originalPoint = m_editingPoint; |
582 { | 582 { |
583 // SVDEBUG << "ImageLayer::drawDrag(" << e->x() << "," << e->y() << ")" << endl; | 583 // SVDEBUG << "ImageLayer::drawDrag(" << e->x() << "," << e->y() << ")" << endl; |
584 | 584 |
585 if (!m_model || !m_editing) return; | 585 if (!m_model || !m_editing) return; |
586 | 586 |
587 long frame = v->getFrameForX(e->x()); | 587 int frame = v->getFrameForX(e->x()); |
588 if (frame < 0) frame = 0; | 588 if (frame < 0) frame = 0; |
589 frame = frame / m_model->getResolution() * m_model->getResolution(); | 589 frame = frame / m_model->getResolution() * m_model->getResolution(); |
590 | 590 |
591 m_editingCommand->deletePoint(m_editingPoint); | 591 m_editingCommand->deletePoint(m_editingPoint); |
592 m_editingPoint.frame = frame; | 592 m_editingPoint.frame = frame; |
617 m_editingCommand = 0; | 617 m_editingCommand = 0; |
618 m_editing = false; | 618 m_editing = false; |
619 } | 619 } |
620 | 620 |
621 bool | 621 bool |
622 ImageLayer::addImage(long frame, QString url) | 622 ImageLayer::addImage(int frame, QString url) |
623 { | 623 { |
624 QImage image(getLocalFilename(url)); | 624 QImage image(getLocalFilename(url)); |
625 if (image.isNull()) { | 625 if (image.isNull()) { |
626 cerr << "Failed to open image from url \"" << url << "\" (local filename \"" << getLocalFilename(url) << "\"" << endl; | 626 cerr << "Failed to open image from url \"" << url << "\" (local filename \"" << getLocalFilename(url) << "\"" << endl; |
627 delete m_fileSources[url]; | 627 delete m_fileSources[url]; |
662 void | 662 void |
663 ImageLayer::editDrag(View *v, QMouseEvent *e) | 663 ImageLayer::editDrag(View *v, QMouseEvent *e) |
664 { | 664 { |
665 if (!m_model || !m_editing) return; | 665 if (!m_model || !m_editing) return; |
666 | 666 |
667 long frameDiff = v->getFrameForX(e->x()) - v->getFrameForX(m_editOrigin.x()); | 667 int frameDiff = v->getFrameForX(e->x()) - v->getFrameForX(m_editOrigin.x()); |
668 long frame = m_originalPoint.frame + frameDiff; | 668 int frame = m_originalPoint.frame + frameDiff; |
669 | 669 |
670 if (frame < 0) frame = 0; | 670 if (frame < 0) frame = 0; |
671 frame = (frame / m_model->getResolution()) * m_model->getResolution(); | 671 frame = (frame / m_model->getResolution()) * m_model->getResolution(); |
672 | 672 |
673 if (!m_editingCommand) { | 673 if (!m_editingCommand) { |