Mercurial > hg > svgui
comparison layer/ImageLayer.cpp @ 805:1d526ba11a24 warnfix_no_size_t
Remove size_t's and fix warnings in layer/
author | Chris Cannam |
---|---|
date | Tue, 17 Jun 2014 15:18:06 +0100 |
parents | 1a0dfcbffaf1 |
children | 4c8ca536b54f |
comparison
equal
deleted
inserted
replaced
782:ddae586bc47b | 805:1d526ba11a24 |
---|---|
76 { | 76 { |
77 return Layer::getProperties(); | 77 return Layer::getProperties(); |
78 } | 78 } |
79 | 79 |
80 QString | 80 QString |
81 ImageLayer::getPropertyLabel(const PropertyName &name) const | 81 ImageLayer::getPropertyLabel(const PropertyName &) const |
82 { | 82 { |
83 return ""; | 83 return ""; |
84 } | 84 } |
85 | 85 |
86 Layer::PropertyType | 86 Layer::PropertyType |
114 { | 114 { |
115 return false; | 115 return false; |
116 } | 116 } |
117 | 117 |
118 bool | 118 bool |
119 ImageLayer::isLayerScrollable(const View *v) const | 119 ImageLayer::isLayerScrollable(const View *) const |
120 { | 120 { |
121 return true; | 121 return true; |
122 } | 122 } |
123 | 123 |
124 | 124 |
125 ImageModel::PointList | 125 ImageModel::PointList |
126 ImageLayer::getLocalPoints(View *v, int x, int y) const | 126 ImageLayer::getLocalPoints(View *v, int x, int ) const |
127 { | 127 { |
128 if (!m_model) return ImageModel::PointList(); | 128 if (!m_model) return ImageModel::PointList(); |
129 | 129 |
130 // SVDEBUG << "ImageLayer::getLocalPoints(" << x << "," << y << "):"; | 130 // SVDEBUG << "ImageLayer::getLocalPoints(" << x << "," << y << "):"; |
131 const ImageModel::PointList &points(m_model->getPoints()); | 131 const ImageModel::PointList &points(m_model->getPoints()); |
183 } else { | 183 } else { |
184 return ""; | 184 return ""; |
185 } | 185 } |
186 } | 186 } |
187 | 187 |
188 long useFrame = points.begin()->frame; | 188 // long 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 /* |
194 if (points.begin()->label == "") { | 194 if (points.begin()->label == "") { |
195 text = QString(tr("Time:\t%1\nHeight:\t%2\nLabel:\t%3")) | 195 text = QString(tr("Time:\t%1\nHeight:\t%2\nLabel:\t%3")) |
207 | 207 |
208 //!!! too much overlap with TimeValueLayer/TimeInstantLayer/TextLayer | 208 //!!! too much overlap with TimeValueLayer/TimeInstantLayer/TextLayer |
209 | 209 |
210 bool | 210 bool |
211 ImageLayer::snapToFeatureFrame(View *v, int &frame, | 211 ImageLayer::snapToFeatureFrame(View *v, int &frame, |
212 size_t &resolution, | 212 int &resolution, |
213 SnapType snap) const | 213 SnapType snap) const |
214 { | 214 { |
215 if (!m_model) { | 215 if (!m_model) { |
216 return Layer::snapToFeatureFrame(v, frame, resolution, snap); | 216 return Layer::snapToFeatureFrame(v, frame, resolution, snap); |
217 } | 217 } |
517 } | 517 } |
518 | 518 |
519 QImage | 519 QImage |
520 ImageLayer::getImage(View *v, QString name, QSize maxSize) const | 520 ImageLayer::getImage(View *v, QString name, QSize maxSize) const |
521 { | 521 { |
522 bool need = false; | |
523 | |
524 // SVDEBUG << "ImageLayer::getImage(" << v << ", " << name << ", (" | 522 // SVDEBUG << "ImageLayer::getImage(" << v << ", " << name << ", (" |
525 // << maxSize.width() << "x" << maxSize.height() << "))" << endl; | 523 // << maxSize.width() << "x" << maxSize.height() << "))" << endl; |
526 | 524 |
527 if (!m_scaled[v][name].isNull() && | 525 if (!m_scaled[v][name].isNull() && |
528 ((m_scaled[v][name].width() == maxSize.width() && | 526 ((m_scaled[v][name].width() == maxSize.width() && |
594 m_editingPoint.frame = frame; | 592 m_editingPoint.frame = frame; |
595 m_editingCommand->addPoint(m_editingPoint); | 593 m_editingCommand->addPoint(m_editingPoint); |
596 } | 594 } |
597 | 595 |
598 void | 596 void |
599 ImageLayer::drawEnd(View *v, QMouseEvent *) | 597 ImageLayer::drawEnd(View *, QMouseEvent *) |
600 { | 598 { |
601 // SVDEBUG << "ImageLayer::drawEnd(" << e->x() << "," << e->y() << ")" << endl; | 599 // SVDEBUG << "ImageLayer::drawEnd(" << e->x() << "," << e->y() << ")" << endl; |
602 if (!m_model || !m_editing) return; | 600 if (!m_model || !m_editing) return; |
603 | |
604 bool ok = false; | |
605 | 601 |
606 ImageDialog dialog(tr("Select image"), "", ""); | 602 ImageDialog dialog(tr("Select image"), "", ""); |
607 | 603 |
608 if (dialog.exec() == QDialog::Accepted) { | 604 if (dialog.exec() == QDialog::Accepted) { |
609 | 605 |
725 | 721 |
726 return true; | 722 return true; |
727 } | 723 } |
728 | 724 |
729 void | 725 void |
730 ImageLayer::moveSelection(Selection s, size_t newStartFrame) | 726 ImageLayer::moveSelection(Selection s, int newStartFrame) |
731 { | 727 { |
732 if (!m_model) return; | 728 if (!m_model) return; |
733 | 729 |
734 ImageModel::EditCommand *command = | 730 ImageModel::EditCommand *command = |
735 new ImageModel::EditCommand(m_model, tr("Drag Selection")); | 731 new ImageModel::EditCommand(m_model, tr("Drag Selection")); |
821 } | 817 } |
822 } | 818 } |
823 } | 819 } |
824 | 820 |
825 bool | 821 bool |
826 ImageLayer::paste(View *v, const Clipboard &from, int frameOffset, bool /* interactive */) | 822 ImageLayer::paste(View *v, const Clipboard &from, int /* frameOffset */, bool /* interactive */) |
827 { | 823 { |
828 if (!m_model) return false; | 824 if (!m_model) return false; |
829 | 825 |
830 const Clipboard::PointList &points = from.getPoints(); | 826 const Clipboard::PointList &points = from.getPoints(); |
831 | 827 |
854 for (Clipboard::PointList::const_iterator i = points.begin(); | 850 for (Clipboard::PointList::const_iterator i = points.begin(); |
855 i != points.end(); ++i) { | 851 i != points.end(); ++i) { |
856 | 852 |
857 if (!i->haveFrame()) continue; | 853 if (!i->haveFrame()) continue; |
858 | 854 |
859 size_t frame = 0; | 855 int frame = 0; |
860 | 856 |
861 if (!realign) { | 857 if (!realign) { |
862 | 858 |
863 frame = i->getFrame(); | 859 frame = i->getFrame(); |
864 | 860 |
968 { | 964 { |
969 Layer::toXml(stream, indent, extraAttributes); | 965 Layer::toXml(stream, indent, extraAttributes); |
970 } | 966 } |
971 | 967 |
972 void | 968 void |
973 ImageLayer::setProperties(const QXmlAttributes &attributes) | 969 ImageLayer::setProperties(const QXmlAttributes &) |
974 { | 970 { |
975 } | 971 } |
976 | 972 |