]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackscene.cpp
Save load splitter size
[kdenlive] / src / customtrackscene.cpp
index 13672c1f0c18da2c20e7a8b1330be442961fa952..44e1a9bffd6aa0c4bef5dd69157ee7e21e06dc86 100644 (file)
@@ -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)
 {
 }
 
@@ -49,23 +50,23 @@ double CustomTrackScene::getSnapPointForPos(double pos, bool doSnap)
     return GenTime(pos, m_document->fps()).frames(m_document->fps());
 }
 
-void CustomTrackScene::setSnapList(QList <GenTime> snaps)
+void CustomTrackScene::setSnapList(const QList <GenTime>& snaps)
 {
     m_snapPoints = snaps;
 }
 
-GenTime CustomTrackScene::previousSnapPoint(GenTime pos)
+GenTime CustomTrackScene::previousSnapPoint(const GenTime &pos) const
 {
     for (int i = 0; i < m_snapPoints.size(); ++i) {
         if (m_snapPoints.at(i) >= pos) {
-            if (i == 0) i = 1;
+            if (i == 0) return GenTime();
             return m_snapPoints.at(i - 1);
         }
     }
     return GenTime();
 }
 
-GenTime CustomTrackScene::nextSnapPoint(GenTime pos)
+GenTime CustomTrackScene::nextSnapPoint(const GenTime &pos) const
 {
     for (int i = 0; i < m_snapPoints.size(); ++i) {
         if (m_snapPoints.at(i) > pos) {
@@ -96,4 +97,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"