]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackview.cpp
cleanup
[kdenlive] / src / customtrackview.cpp
index 8313d813ea0db6c14859d5436d381d2427c21a99..1edb555b9e51ab6b0c9782a6e5d60608108ed8e0 100644 (file)
@@ -87,6 +87,8 @@
 #include <QGraphicsDropShadowEffect>
 #endif
 
+#define SEEK_INACTIVE (-1)
+
 //#define DEBUG
 
 bool sortGuidesList(const Guide *g1 , const Guide *g2)
@@ -388,12 +390,13 @@ void CustomTrackView::slotCheckPositionScrolling()
     // If mouse is at a border of the view, scroll
     if (m_moveOpMode != SEEK) return;
     if (mapFromScene(m_cursorPos, 0).x() < 3) {
+       if (horizontalScrollBar()->value() == 0) return;
         horizontalScrollBar()->setValue(horizontalScrollBar()->value() - 2);
         QTimer::singleShot(200, this, SLOT(slotCheckPositionScrolling()));
-        setCursorPos(mapToScene(QPoint(-2, 0)).x());
+        seekCursorPos(mapToScene(QPoint(-2, 0)).x());
     } else if (viewport()->width() - 3 < mapFromScene(m_cursorPos + 1, 0).x()) {
         horizontalScrollBar()->setValue(horizontalScrollBar()->value() + 2);
-        setCursorPos(mapToScene(QPoint(viewport()->width(), 0)).x() + 1);
+        seekCursorPos(mapToScene(QPoint(viewport()->width(), 0)).x() + 1);
         QTimer::singleShot(200, this, SLOT(slotCheckPositionScrolling()));
     }
 }
@@ -420,6 +423,7 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
         bool move = (event->pos() - m_clickEvent).manhattanLength() >= QApplication::startDragDistance();
         if (m_dragItem && m_tool == SELECTTOOL) {
             if (m_operationMode == MOVE && move) {
+               //m_dragItem->setProperty("y_absolute", event->pos().y());
                 QGraphicsView::mouseMoveEvent(event);
                 // If mouse is at a border of the view, scroll
                 if (pos < 5) {
@@ -706,7 +710,7 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
         if (event->buttons() != Qt::NoButton && event->modifiers() == Qt::NoModifier) {
             QGraphicsView::mouseMoveEvent(event);
             m_moveOpMode = SEEK;
-            setCursorPos(mappedXPos);
+            seekCursorPos(mappedXPos);
             slotCheckPositionScrolling();
             return;
         } else m_moveOpMode = NONE;
@@ -797,6 +801,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
             else
                 m_dragItem = collisionClip;
             found = true;
+           m_dragItem->setProperty("y_absolute", mapToScene(m_clickEvent).y() - m_dragItem->scenePos().y());
             m_dragItemInfo = m_dragItem->info();
             if (m_dragItem->parentItem() && m_dragItem->parentItem()->type() == GROUPWIDGET && m_dragItem->parentItem() != m_selectionGroup) {
                 // kDebug()<<"// KLIK FOUND GRP: "<<m_dragItem->sceneBoundingRect();
@@ -938,7 +943,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
             }
             m_operationMode = SPACER;
         } else {
-            setCursorPos((int)(mapToScene(event->x(), 0).x()));
+            seekCursorPos((int)(mapToScene(event->x(), 0).x()));
         }
         //QGraphicsView::mousePressEvent(event);
         event->ignore();
@@ -1406,8 +1411,8 @@ void CustomTrackView::editItemDuration()
                 updateTrackDuration(clipInfo.track, moveCommand);
                 m_commandStack->push(moveCommand);
             }
-        delete d;
         }
+        delete d;
     } else {
         emit displayMessage(i18n("Item is locked"), ErrorMessage);
     }
@@ -2200,7 +2205,13 @@ ClipItem *CustomTrackView::cutClip(ItemInfo info, GenTime cutTime, bool cut, boo
             return NULL;
         }
 
-        if (execute) m_document->renderer()->mltCutClip(m_document->tracksCount() - info.track, cutTime);
+        if (execute) {
+           if (!m_document->renderer()->mltCutClip(m_document->tracksCount() - info.track, cutTime)) {
+               // Error cuting clip in playlist
+               m_blockRefresh = false;
+               return NULL;
+           }
+       }
         int cutPos = (int) cutTime.frames(m_document->fps());
         ItemInfo newPos;
         newPos.startPos = cutTime;
@@ -3336,14 +3347,27 @@ void CustomTrackView::deleteClip(const QString &clipId)
     }
 }
 
-void CustomTrackView::setCursorPos(int pos, bool seek)
+void CustomTrackView::seekCursorPos(int pos)
 {
-    if (pos == m_cursorPos) return;
-    emit cursorMoved((int)(m_cursorPos), (int)(pos));
-    m_cursorPos = pos;
-    if (seek) m_document->renderer()->seek(m_cursorPos);
-    else if (m_autoScroll) checkScrolling();
-    m_cursorLine->setPos(m_cursorPos, 0);
+    m_document->renderer()->seek(qMax(pos, 0));
+    emit updateRuler();
+}
+
+int CustomTrackView::seekPosition() const
+{
+    return m_document->renderer()->requestedSeekPosition;
+}
+
+
+void CustomTrackView::setCursorPos(int pos)
+{
+    if (pos != m_cursorPos) {
+       emit cursorMoved((int)(m_cursorPos), (int)(pos));
+       m_cursorPos = pos;
+       m_cursorLine->setPos(m_cursorPos, 0);
+       if (m_autoScroll) checkScrolling();
+    }
+    else emit updateRuler();
 }
 
 void CustomTrackView::updateCursorPos()
@@ -3358,11 +3382,15 @@ int CustomTrackView::cursorPos()
 
 void CustomTrackView::moveCursorPos(int delta)
 {
-    if (m_cursorPos + delta < 0) delta = 0 - m_cursorPos;
-    emit cursorMoved((int)(m_cursorPos), (int)((m_cursorPos + delta)));
-    m_cursorPos += delta;
-    m_cursorLine->setPos(m_cursorPos, 0);
-    m_document->renderer()->seek(m_cursorPos);
+    int currentPos = m_document->renderer()->requestedSeekPosition;
+    if (currentPos == SEEK_INACTIVE) {
+       currentPos = m_document->renderer()->seekPosition().frames(m_document->fps()) + delta;
+    }
+    else {
+       currentPos += delta;
+    }
+    m_document->renderer()->seek(qMax(0, currentPos));
+    emit updateRuler();
 }
 
 void CustomTrackView::initCursorPos(int pos)
@@ -3413,6 +3441,7 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event)
             track = -1;
         } else track = (int)(mapToScene(m_clickEvent).y() / m_tracksHeight);
         GenTime timeOffset = GenTime((int)(m_selectionGroup->scenePos().x()), m_document->fps()) - m_selectionGroupInfo.startPos;
+       QList <AbstractGroupItem*> groups;
 
         if (timeOffset != GenTime()) {
             QList<QGraphicsItem *> items = m_selectionGroup->childItems();
@@ -3430,8 +3459,11 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event)
             }
 
             for (int i = 0; i < items.count(); i++) {
-                if (items.at(i)->type() == GROUPWIDGET)
-                    items += items.at(i)->childItems();
+                if (items.at(i)->type() == GROUPWIDGET) {
+                   AbstractGroupItem* group = (AbstractGroupItem*)items.at(i);
+                   if (!groups.contains(group)) groups.append(group);
+                   items += items.at(i)->childItems();
+               }
             }
 
             for (int i = 0; i < items.count(); i++) {
@@ -3461,7 +3493,13 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event)
                 setDocumentModified();
             }
         }
-        resetSelectionGroup(false);
+        for (int i = 0; i < groups.count(); i++)
+           rebuildGroup(groups.at(i));
+
+       resetSelectionGroup();
+       
+        clearSelection();
+       
         m_operationMode = NONE;
     } else if (m_operationMode == RUBBERSELECTION) {
         resetSelectionGroup();
@@ -3635,7 +3673,6 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event)
             else
                 group = static_cast <QGraphicsItemGroup *>(m_dragItem->parentItem());
             QList<QGraphicsItem *> items = group->childItems();
-
             QList<ItemInfo> clipsToMove;
             QList<ItemInfo> transitionsToMove;
 
@@ -3719,13 +3756,19 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event)
                     m_selectionGroupInfo.startPos = GenTime(m_selectionGroup->scenePos().x(), m_document->fps());
                     m_selectionGroupInfo.track = m_selectionGroup->track();
 
+                   QList <AbstractGroupItem*> groupList;
                     for (int i = 0; i < items.count(); ++i) {
                         if (items.at(i)->type() == GROUPWIDGET) {
-                            rebuildGroup((AbstractGroupItem*)items.at(i));
+                           AbstractGroupItem* group = (AbstractGroupItem*)items.at(i);
+                           if (!groupList.contains(group)) groupList.append(group);
                             items.removeAt(i);
                             --i;
                         }
                     }
+                    for (int i = 0; i < groupList.count(); ++i) {
+                       rebuildGroup(groupList.at(i));
+                   }
+                    
                     for (int i = 0; i < items.count(); ++i) {
                         if (items.at(i)) {
                             items.at(i)->setSelected(true);
@@ -4327,7 +4370,7 @@ void CustomTrackView::slotUpdateClip(const QString &clipId, bool reload)
                 ItemInfo info = clip->info();
                 Mlt::Producer *prod = NULL;
                 if (clip->isAudioOnly()) prod = baseClip->audioProducer(info.track);
-                else if (clip->isVideoOnly()) prod = baseClip->videoProducer();
+                else if (clip->isVideoOnly()) prod = baseClip->videoProducer(info.track);
                 else prod = baseClip->getProducer(info.track);
                 if (reload && !m_document->renderer()->mltUpdateClip(tractor, info, clip->xml(), prod)) {
                     emit displayMessage(i18n("Cannot update clip (time: %1, track: %2)", info.startPos.frames(m_document->fps()), info.track), ErrorMessage);
@@ -4570,6 +4613,7 @@ void CustomTrackView::moveGroup(QList <ItemInfo> startClip, QList <ItemInfo> sta
         //m_selectionGroup->moveBy(offset.frames(m_document->fps()), trackOffset *(qreal) m_tracksHeight);
 
         QList<QGraphicsItem *> children = m_selectionGroup->childItems();
+       QList <AbstractGroupItem*> groupList;
         // Expand groups
         int max = children.count();
         for (int i = 0; i < max; i++) {
@@ -4579,6 +4623,8 @@ void CustomTrackView::moveGroup(QList <ItemInfo> startClip, QList <ItemInfo> sta
                 //grp->moveBy(offset.frames(m_document->fps()), trackOffset *(qreal) m_tracksHeight);
                 /*m_document->clipManager()->removeGroup(grp);
                 m_scene->destroyItemGroup(grp);*/
+               AbstractGroupItem *group = (AbstractGroupItem*) children.at(i);
+               if (!groupList.contains(group)) groupList.append(group);
                 children.removeAll(children.at(i));
                 i--;
             }
@@ -4620,11 +4666,9 @@ void CustomTrackView::moveGroup(QList <ItemInfo> startClip, QList <ItemInfo> sta
         }
 
         resetSelectionGroup(false);
+       for (int i = 0; i < groupList.count(); i++)
+           rebuildGroup(groupList.at(i));
 
-        for (int i = 0; i < children.count(); i++) {
-            if (children.at(i)->parentItem())
-                rebuildGroup((AbstractGroupItem*)children.at(i)->parentItem());
-        }
         clearSelection();
 
         KdenliveSettings::setSnaptopoints(snap);
@@ -5121,7 +5165,7 @@ void CustomTrackView::slotSeekToPreviousSnap()
 {
     updateSnapPoints(NULL);
     GenTime res = m_scene->previousSnapPoint(GenTime(m_cursorPos, m_document->fps()));
-    setCursorPos((int) res.frames(m_document->fps()));
+    seekCursorPos((int) res.frames(m_document->fps()));
     checkScrolling();
 }
 
@@ -5129,7 +5173,7 @@ void CustomTrackView::slotSeekToNextSnap()
 {
     updateSnapPoints(NULL);
     GenTime res = m_scene->nextSnapPoint(GenTime(m_cursorPos, m_document->fps()));
-    setCursorPos((int) res.frames(m_document->fps()));
+    seekCursorPos((int) res.frames(m_document->fps()));
     checkScrolling();
 }
 
@@ -5137,7 +5181,7 @@ void CustomTrackView::clipStart()
 {
     AbstractClipItem *item = getMainActiveClip();
     if (item != NULL) {
-        setCursorPos((int) item->startPos().frames(m_document->fps()));
+        seekCursorPos((int) item->startPos().frames(m_document->fps()));
         checkScrolling();
     }
 }
@@ -5146,7 +5190,7 @@ void CustomTrackView::clipEnd()
 {
     AbstractClipItem *item = getMainActiveClip();
     if (item != NULL) {
-        setCursorPos((int) item->endPos().frames(m_document->fps()) - 1);
+        seekCursorPos((int) item->endPos().frames(m_document->fps()) - 1);
         checkScrolling();
     }
 }
@@ -5208,7 +5252,7 @@ void CustomTrackView::buildGuidesMenu(QMenu *goMenu) const
     goMenu->clear();
     double fps = m_document->fps();
     for (int i = 0; i < m_guides.count(); i++) {
-        act = goMenu->addAction(m_guides.at(i)->label() + "/" + Timecode::getStringTimecode(m_guides.at(i)->position().frames(fps), fps));
+        act = goMenu->addAction(m_guides.at(i)->label() + '/' + Timecode::getStringTimecode(m_guides.at(i)->position().frames(fps), fps));
         act->setData(m_guides.at(i)->position().frames(m_document->fps()));
     }
     goMenu->setEnabled(!m_guides.isEmpty());
@@ -5430,7 +5474,7 @@ bool CustomTrackView::findString(const QString &text)
     for (int i = 0; i < m_searchPoints.size(); ++i) {
         marker = m_searchPoints.at(i).comment();
         if (marker.contains(text, Qt::CaseInsensitive)) {
-            setCursorPos(m_searchPoints.at(i).time().frames(m_document->fps()), true);
+            seekCursorPos(m_searchPoints.at(i).time().frames(m_document->fps()));
             int vert = verticalScrollBar()->value();
             int hor = cursorPos();
             ensureVisible(hor, vert + 10, 2, 2, 50, 0);
@@ -5443,7 +5487,7 @@ bool CustomTrackView::findString(const QString &text)
 
 void CustomTrackView::selectFound(QString track, QString pos)
 {
-    setCursorPos(m_document->timecode().getFrameCount(pos), true);
+    seekCursorPos(m_document->timecode().getFrameCount(pos));
     slotSelectTrack(track.toInt());
     selectClip(true);
     int vert = verticalScrollBar()->value();
@@ -5457,7 +5501,7 @@ bool CustomTrackView::findNextString(const QString &text)
     for (int i = m_findIndex + 1; i < m_searchPoints.size(); ++i) {
         marker = m_searchPoints.at(i).comment();
         if (marker.contains(text, Qt::CaseInsensitive)) {
-            setCursorPos(m_searchPoints.at(i).time().frames(m_document->fps()), true);
+            seekCursorPos(m_searchPoints.at(i).time().frames(m_document->fps()));
             int vert = verticalScrollBar()->value();
             int hor = cursorPos();
             ensureVisible(hor, vert + 10, 2, 2, 50, 0);
@@ -5754,7 +5798,7 @@ void CustomTrackView::adjustKeyfames(GenTime oldstart, GenTime newstart, GenTime
         if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe")) {
             QString def = e.attribute("default");
             // Effect has a keyframe type parameter, we need to adjust the values
-            QStringList keys = e.attribute("keyframes").split(";", QString::SkipEmptyParts);
+            QStringList keys = e.attribute("keyframes").split(';', QString::SkipEmptyParts);
             QStringList newKeyFrames;
             foreach(const QString &str, keys) {
                 int pos = str.section(':', 0, 0).toInt();
@@ -5836,7 +5880,26 @@ void CustomTrackView::setInPoint()
             return;
         }
     }
-    prepareResizeClipStart(clip, clip->info(), m_cursorPos, true);
+
+    AbstractGroupItem *parent = static_cast <AbstractGroupItem *>(clip->parentItem());
+    if (parent) {
+       // Resizing a group
+       QUndoCommand *resizeCommand = new QUndoCommand();
+        resizeCommand->setText(i18n("Resize group"));
+        QList <QGraphicsItem *> items = parent->childItems();
+        for (int i = 0; i < items.count(); ++i) {
+           AbstractClipItem *item = static_cast<AbstractClipItem *>(items.at(i));
+            if (item && item->type() == AVWIDGET) {
+                prepareResizeClipStart(item, item->info(), m_cursorPos, true, resizeCommand);
+            }
+        }
+        if (resizeCommand->childCount() > 0) m_commandStack->push(resizeCommand);
+       else {
+           //TODO warn user of failed resize
+           delete resizeCommand;
+       }
+    }
+    else prepareResizeClipStart(clip, clip->info(), m_cursorPos, true);
 }
 
 void CustomTrackView::setOutPoint()
@@ -5850,7 +5913,25 @@ void CustomTrackView::setOutPoint()
             return;
         }
     }
-    prepareResizeClipEnd(clip, clip->info(), m_cursorPos, true);
+    AbstractGroupItem *parent = static_cast <AbstractGroupItem *>(clip->parentItem());
+    if (parent) {
+       // Resizing a group
+       QUndoCommand *resizeCommand = new QUndoCommand();
+        resizeCommand->setText(i18n("Resize group"));
+        QList <QGraphicsItem *> items = parent->childItems();
+        for (int i = 0; i < items.count(); ++i) {
+           AbstractClipItem *item = static_cast<AbstractClipItem *>(items.at(i));
+            if (item && item->type() == AVWIDGET) {
+                prepareResizeClipEnd(item, item->info(), m_cursorPos, true, resizeCommand);
+            }
+        }
+        if (resizeCommand->childCount() > 0) m_commandStack->push(resizeCommand);
+       else {
+           //TODO warn user of failed resize
+           delete resizeCommand;
+       }
+    }
+    else prepareResizeClipEnd(clip, clip->info(), m_cursorPos, true);
 }
 
 void CustomTrackView::slotUpdateAllThumbs()
@@ -5933,21 +6014,21 @@ void CustomTrackView::saveThumbnails()
 
 void CustomTrackView::slotInsertTrack(int ix)
 {
-    TrackDialog d(m_document, parentWidget());
-    d.comboTracks->setCurrentIndex(ix);
-    d.label->setText(i18n("Insert track"));
-    d.setWindowTitle(i18n("Insert New Track"));
+    QPointer<TrackDialog> d = new TrackDialog(m_document, parentWidget());
+    d->comboTracks->setCurrentIndex(ix);
+    d->label->setText(i18n("Insert track"));
+    d->setWindowTitle(i18n("Insert New Track"));
 
-    if (d.exec() == QDialog::Accepted) {
-        ix = d.comboTracks->currentIndex();
-        if (d.before_select->currentIndex() == 1)
+    if (d->exec() == QDialog::Accepted) {
+        ix = d->comboTracks->currentIndex();
+        if (d->before_select->currentIndex() == 1)
             ix++;
         TrackInfo info;
         info.duration = 0;
         info.isMute = false;
         info.isLocked = false;
        info.effectsList = EffectsList(true);
-        if (d.video_track->isChecked()) {
+        if (d->video_track->isChecked()) {
             info.type = VIDEOTRACK;
             info.isBlind = false;
         } else {
@@ -5958,41 +6039,45 @@ void CustomTrackView::slotInsertTrack(int ix)
         m_commandStack->push(addTrack);
         setDocumentModified();
     }
+    delete d;
 }
 
 void CustomTrackView::slotDeleteTrack(int ix)
 {
     if (m_document->tracksCount() < 2) return;
-    TrackDialog d(m_document, parentWidget());
-    d.comboTracks->setCurrentIndex(ix);
-    d.label->setText(i18n("Delete track"));
-    d.before_select->setHidden(true);
-    d.setWindowTitle(i18n("Delete Track"));
-    d.video_track->setHidden(true);
-    d.audio_track->setHidden(true);
-    if (d.exec() == QDialog::Accepted) {
-        ix = d.comboTracks->currentIndex();
+    QPointer<TrackDialog> d = new TrackDialog(m_document, parentWidget());
+    d->comboTracks->setCurrentIndex(ix);
+    d->label->setText(i18n("Delete track"));
+    d->before_select->setHidden(true);
+    d->setWindowTitle(i18n("Delete Track"));
+    d->video_track->setHidden(true);
+    d->audio_track->setHidden(true);
+    if (d->exec() == QDialog::Accepted) {
+        ix = d->comboTracks->currentIndex();
         TrackInfo info = m_document->trackInfoAt(m_document->tracksCount() - ix - 1);
         deleteTimelineTrack(ix, info);
         setDocumentModified();
         /*AddTrackCommand* command = new AddTrackCommand(this, ix, info, false);
         m_commandStack->push(command);*/
     }
+    delete d;
 }
 
 void CustomTrackView::slotConfigTracks(int ix)
 {
-    TracksConfigDialog d(m_document, ix, parentWidget());
-    if (d.exec() == QDialog::Accepted) {
-        ConfigTracksCommand *configTracks = new ConfigTracksCommand(this, m_document->tracksList(), d.tracksList());
+    QPointer<TracksConfigDialog> d = new TracksConfigDialog(m_document,
+                                                        ix, parentWidget());
+    if (d->exec() == QDialog::Accepted) {
+        ConfigTracksCommand *configTracks = new ConfigTracksCommand(this, m_document->tracksList(), d->tracksList());
         m_commandStack->push(configTracks);
-        QList <int> toDelete = d.deletedTracks();
+        QList <int> toDelete = d->deletedTracks();
         for (int i = 0; i < toDelete.count(); ++i) {
             TrackInfo info = m_document->trackInfoAt(m_document->tracksCount() - toDelete.at(i) + i - 1);
             deleteTimelineTrack(toDelete.at(i) - i, info);
         }
         setDocumentModified();
     }
+    delete d;
 }
 
 void CustomTrackView::deleteTimelineTrack(int ix, TrackInfo trackinfo)
@@ -6153,7 +6238,7 @@ void CustomTrackView::setAudioAlignReference()
         if (clip->clipType() == AV || clip->clipType() == AUDIO) {
             m_audioAlignmentReference = clip;
 
-            AudioEnvelope *envelope = new AudioEnvelope(clip->getProducer(clip->track()));
+            AudioEnvelope *envelope = new AudioEnvelope(clip->baseClip()->fileURL().path(), clip->getProducer(clip->track()));
             m_audioCorrelator = new AudioCorrelation(envelope);
 
 
@@ -6198,9 +6283,7 @@ void CustomTrackView::alignAudio()
             }
 
             if (clip->clipType() == AV || clip->clipType() == AUDIO) {
-                AudioEnvelope *envelope = new AudioEnvelope(clip->getProducer(clip->track()),
-                                                            clip->info().cropStart.frames(m_document->fps()),
-                                                            clip->info().cropDuration.frames(m_document->fps()));
+                AudioEnvelope *envelope = new AudioEnvelope(clip->baseClip()->fileURL().path(), clip->getProducer(clip->track()), clip->info().cropStart.frames(m_document->fps()), clip->info().cropDuration.frames(m_document->fps()));
 
                 // FFT only for larger vectors. We could use it all time, but for small vectors
                 // the (anyway not noticeable) overhead is smaller with a nested for loop correlation.
@@ -6316,7 +6399,7 @@ void CustomTrackView::doSplitAudio(const GenTime &pos, int track, EffectsList ef
             if (audioClip) {
                 Mlt::Tractor *tractor = m_document->renderer()->lockService();
                 clip->setVideoOnly(true);
-                if (m_document->renderer()->mltUpdateClipProducer(tractor, m_document->tracksCount() - track, start, clip->baseClip()->videoProducer()) == false) {
+                if (m_document->renderer()->mltUpdateClipProducer(tractor, m_document->tracksCount() - track, start, clip->baseClip()->videoProducer(info.track)) == false) {
                     emit displayMessage(i18n("Cannot update clip (time: %1, track: %2)", start, track), ErrorMessage);
                 }
                 if (m_document->renderer()->mltUpdateClipProducer(tractor, m_document->tracksCount() - info.track, start, clip->baseClip()->audioProducer(info.track)) == false) {
@@ -6476,7 +6559,7 @@ void CustomTrackView::doChangeClipType(const GenTime &pos, int track, bool video
         int start = pos.frames(m_document->fps());
         clip->setVideoOnly(true);
         clip->setAudioOnly(false);
-        if (m_document->renderer()->mltUpdateClipProducer(tractor, m_document->tracksCount() - track, start, clip->baseClip()->videoProducer()) == false) {
+        if (m_document->renderer()->mltUpdateClipProducer(tractor, m_document->tracksCount() - track, start, clip->baseClip()->videoProducer(track)) == false) {
             emit displayMessage(i18n("Cannot update clip (time: %1, track: %2)", start, track), ErrorMessage);
         }
     } else if (audioOnly) {
@@ -6522,7 +6605,7 @@ void CustomTrackView::updateClipTypeActions(ClipItem *clip)
 void CustomTrackView::slotGoToMarker(QAction *action)
 {
     int pos = action->data().toInt();
-    setCursorPos(pos, true);
+    seekCursorPos(pos);
 }
 
 void CustomTrackView::reloadTransitionLumas()
@@ -7022,13 +7105,13 @@ void CustomTrackView::adjustEffectParameters(EffectsParameterList &parameters, Q
             parameters.addParam("_sync_in_out", "1");
         }
         if (e.attribute("type") == "simplekeyframe") {
-            QStringList values = e.attribute("keyframes").split(";", QString::SkipEmptyParts);
+            QStringList values = e.attribute("keyframes").split(';', QString::SkipEmptyParts);
             double factor = e.attribute("factor", "1").toDouble();
             double offset = e.attribute("offset", "0").toDouble();
             for (int j = 0; j < values.count(); j++) {
                 QString pos = values.at(j).section(':', 0, 0);
                 double val = (values.at(j).section(':', 1, 1).toDouble() - offset) / factor;
-                values[j] = pos + "=" + locale.toString(val);
+                values[j] = pos + '=' + locale.toString(val);
             }
             // kDebug() << "/ / / /SENDING KEYFR:" << values;
             parameters.addParam(paramname, values.join(";"));
@@ -7192,8 +7275,7 @@ void CustomTrackView::slotGotFilterJobResults(const QString &/*id*/, int startPo
         EditEffectCommand *command = new EditEffectCommand(this, m_document->tracksCount() - clip->track(), clip->startPos(), effect, newEffect, clip->selectedEffectIndex(), true, true);
         m_commandStack->push(command);
         emit clipItemSelected(clip);
-    }
-    
+    }    
 }