Mercurial > hg > svgui
diff layer/FlexiNoteLayer.cpp @ 1423:62e908518c71 single-point
Update to Event api in place of Clipboard points
author | Chris Cannam |
---|---|
date | Fri, 08 Mar 2019 13:37:30 +0000 |
parents | c8a6fd3f9dff |
children | e1a08da75427 |
line wrap: on
line diff
--- a/layer/FlexiNoteLayer.cpp Tue Mar 05 10:02:48 2019 +0000 +++ b/layer/FlexiNoteLayer.cpp Fri Mar 08 13:37:30 2019 +0000 @@ -1740,9 +1740,8 @@ for (FlexiNoteModel::PointList::iterator i = points.begin(); i != points.end(); ++i) { if (s.contains(i->frame)) { - Clipboard::Point point(i->frame, i->value, i->duration, i->level, i->label); - point.setReferenceFrame(alignToReference(v, i->frame)); - to.addPoint(point); + Event point(i->frame, i->value, i->duration, i->level, i->label); + to.addPoint(point.withReferenceFrame(alignToReference(v, i->frame))); } } } @@ -1752,7 +1751,7 @@ { if (!m_model) return false; - const Clipboard::PointList &points = from.getPoints(); + const EventVector &points = from.getPoints(); bool realign = false; @@ -1776,10 +1775,9 @@ FlexiNoteModel::EditCommand *command = new FlexiNoteModel::EditCommand(m_model, tr("Paste")); - for (Clipboard::PointList::const_iterator i = points.begin(); + for (EventVector::const_iterator i = points.begin(); i != points.end(); ++i) { - if (!i->haveFrame()) continue; sv_frame_t frame = 0; if (!realign) { @@ -1788,7 +1786,7 @@ } else { - if (i->haveReferenceFrame()) { + if (i->hasReferenceFrame()) { frame = i->getReferenceFrame(); frame = alignFromReference(v, frame); } else { @@ -1798,17 +1796,16 @@ FlexiNoteModel::Point newPoint(frame); - if (i->haveLabel()) newPoint.label = i->getLabel(); - if (i->haveValue()) newPoint.value = i->getValue(); + if (i->hasLabel()) newPoint.label = i->getLabel(); + if (i->hasValue()) newPoint.value = i->getValue(); else newPoint.value = (m_model->getValueMinimum() + m_model->getValueMaximum()) / 2; - if (i->haveLevel()) newPoint.level = i->getLevel(); - if (i->haveDuration()) newPoint.duration = i->getDuration(); + if (i->hasLevel()) newPoint.level = i->getLevel(); + if (i->hasDuration()) newPoint.duration = i->getDuration(); else { sv_frame_t nextFrame = frame; - Clipboard::PointList::const_iterator j = i; + EventVector::const_iterator j = i; for (; j != points.end(); ++j) { - if (!j->haveFrame()) continue; if (j != i) break; } if (j != points.end()) {