X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcustomtrackscene.cpp;h=35d12061730a6662a261164e2f3d821869bcfc5d;hb=f69a24d18f8134c93e407ea485967ac31187da47;hp=1364d22d8e33a96d9daef78770edbfde8cf8b6ee;hpb=2b1c40908368fff4b20912551c266e45c89f6607;p=kdenlive diff --git a/src/customtrackscene.cpp b/src/customtrackscene.cpp index 1364d22d..35d12061 100644 --- a/src/customtrackscene.cpp +++ b/src/customtrackscene.cpp @@ -25,7 +25,8 @@ CustomTrackScene::CustomTrackScene(KdenliveDoc *doc, QObject *parent) : QGraphicsScene(parent), m_document(doc), - m_scale(1.0, 1.0) + m_scale(1.0, 1.0), + m_editMode(NormalEdit) { } @@ -43,18 +44,19 @@ double CustomTrackScene::getSnapPointForPos(double pos, bool doSnap) if (qAbs((int)(pos - m_snapPoints.at(i).frames(m_document->fps()))) < maximumOffset) { return m_snapPoints.at(i).frames(m_document->fps()); } - if (m_snapPoints.at(i).frames(m_document->fps()) > pos) break; + if (m_snapPoints.at(i).frames(m_document->fps()) > pos) + break; } } return GenTime(pos, m_document->fps()).frames(m_document->fps()); } -void CustomTrackScene::setSnapList(QList snaps) +void CustomTrackScene::setSnapList(const QList & snaps) { m_snapPoints = snaps; } -GenTime CustomTrackScene::previousSnapPoint(GenTime pos) const +GenTime CustomTrackScene::previousSnapPoint(const GenTime &pos) const { for (int i = 0; i < m_snapPoints.size(); ++i) { if (m_snapPoints.at(i) >= pos) { @@ -65,7 +67,7 @@ GenTime CustomTrackScene::previousSnapPoint(GenTime pos) const return GenTime(); } -GenTime CustomTrackScene::nextSnapPoint(GenTime pos) const +GenTime CustomTrackScene::nextSnapPoint(const GenTime &pos) const { for (int i = 0; i < m_snapPoints.size(); ++i) { if (m_snapPoints.at(i) > pos) { @@ -96,4 +98,14 @@ MltVideoProfile CustomTrackScene::profile() const return m_document->mltProfile(); } +void CustomTrackScene::setEditMode(EditMode mode) +{ + m_editMode = mode; +} + +EditMode CustomTrackScene::editMode() const +{ + return m_editMode; +} + #include "customtrackscene.moc"