]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackview.cpp
Fix timeline video thumbnails sometimes not showing up
[kdenlive] / src / customtrackview.cpp
index f00f7ad69846910b54c92c08e2c21ed564692259..32e787908c36aa1fac9dce78094bba1e0addab94 100644 (file)
 #include "docclipbase.h"
 #include "clipitem.h"
 #include "definitions.h"
-#include "moveclipcommand.h"
-#include "movetransitioncommand.h"
-#include "resizeclipcommand.h"
-#include "editguidecommand.h"
-#include "addtimelineclipcommand.h"
-#include "addeffectcommand.h"
-#include "editeffectcommand.h"
-#include "moveeffectcommand.h"
-#include "addtransitioncommand.h"
-#include "edittransitioncommand.h"
-#include "editkeyframecommand.h"
-#include "changespeedcommand.h"
-#include "addmarkercommand.h"
-#include "razorclipcommand.h"
+#include "commands/moveclipcommand.h"
+#include "commands/movetransitioncommand.h"
+#include "commands/resizeclipcommand.h"
+#include "commands/editguidecommand.h"
+#include "commands/addtimelineclipcommand.h"
+#include "commands/addeffectcommand.h"
+#include "commands/editeffectcommand.h"
+#include "commands/moveeffectcommand.h"
+#include "commands/addtransitioncommand.h"
+#include "commands/edittransitioncommand.h"
+#include "commands/editkeyframecommand.h"
+#include "commands/changespeedcommand.h"
+#include "commands/addmarkercommand.h"
+#include "commands/razorclipcommand.h"
 #include "kdenlivesettings.h"
 #include "transition.h"
 #include "clipmanager.h"
 #include "ui_keyframedialog_ui.h"
 #include "clipdurationdialog.h"
 #include "abstractgroupitem.h"
-#include "insertspacecommand.h"
+#include "commands/insertspacecommand.h"
 #include "spacerdialog.h"
-#include "addtrackcommand.h"
-#include "movegroupcommand.h"
+#include "commands/addtrackcommand.h"
+#include "commands/movegroupcommand.h"
 #include "ui_addtrack_ui.h"
 #include "initeffects.h"
-#include "locktrackcommand.h"
-#include "groupclipscommand.h"
-#include "splitaudiocommand.h"
-#include "changecliptypecommand.h"
+#include "commands/locktrackcommand.h"
+#include "commands/groupclipscommand.h"
+#include "commands/splitaudiocommand.h"
+#include "commands/changecliptypecommand.h"
 #include "trackdialog.h"
 #include "tracksconfigdialog.h"
-#include "configtrackscommand.h"
-#include "rebuildgroupcommand.h"
-#include "razorgroupcommand.h"
+#include "commands/configtrackscommand.h"
+#include "commands/rebuildgroupcommand.h"
+#include "commands/razorgroupcommand.h"
 #include "profilesdialog.h"
 
 #include <KDebug>
@@ -1641,8 +1641,7 @@ void CustomTrackView::addEffect(int track, GenTime pos, QDomElement effect)
     if (pos < GenTime()) {
         // Add track effect
         if (effect.attribute("id") == "speed") {
-            // TODO: uncomment after 0.8.2 release
-            // emit displayMessage(i18n("Cannot add speed effect to track"));
+            emit displayMessage(i18n("Cannot add speed effect to track"), ErrorMessage);
             return;
         }
         clearSelection();
@@ -3884,34 +3883,6 @@ void CustomTrackView::deleteSelectedClips()
     m_commandStack->push(deleteSelected);
 }
 
-void CustomTrackView::changeClipSpeed()
-{
-  // TODO: remove after string freeze
-    QList<QGraphicsItem *> itemList = scene()->selectedItems();
-    if (itemList.count() == 0) {
-        emit displayMessage(i18n("Select clip to change speed"), ErrorMessage);
-        return;
-    }
-    QUndoCommand *changeSelected = new QUndoCommand();
-    changeSelected->setText("Edit clip speed");
-    int count = 0;
-    int percent = -1;
-    bool ok;
-    for (int i = 0; i < itemList.count(); i++) {
-        if (itemList.at(i)->type() == AVWIDGET) {
-            ClipItem *item = static_cast <ClipItem *>(itemList.at(i));
-            if (percent == -1) percent = QInputDialog::getInteger(this, i18n("Edit Clip Speed"), i18n("New speed (percents)"), item->speed() * 100, 1, 10000, 1, &ok);
-            if (!ok) break;
-            double speed = (double) percent / 100.0;
-            if (item->speed() != speed && (item->clipType() == VIDEO || item->clipType() == AV)) {
-                count++;
-                //new ChangeSpeedCommand(this, info, item->speed(), speed, item->clipProducer(), changeSelected);
-            }
-        }
-    }
-    if (count > 0) m_commandStack->push(changeSelected);
-    else delete changeSelected;
-}
 
 void CustomTrackView::doChangeClipSpeed(ItemInfo info, ItemInfo speedIndependantInfo, const double speed, const double oldspeed, int strobe, const QString &id)
 {
@@ -4470,7 +4441,7 @@ void CustomTrackView::moveGroup(QList <ItemInfo> startClip, QList <ItemInfo> sta
     } else kDebug() << "///////// WARNING; NO GROUP TO MOVE";
 }
 
-void CustomTrackView::moveTransition(const ItemInfo &start, const ItemInfo &end, bool m_refresh)
+void CustomTrackView::moveTransition(const ItemInfo &start, const ItemInfo &end, bool refresh)
 {
     Transition *item = getTransitionItemAt(start.startPos, start.track);
     if (!item) {
@@ -4514,7 +4485,7 @@ void CustomTrackView::moveTransition(const ItemInfo &start, const ItemInfo &end,
         }
         emit transitionItemSelected(item, getPreviousVideoTrack(item->track()), p);
     }
-    if (m_refresh) m_document->renderer()->doRefresh();
+    if (refresh) m_document->renderer()->doRefresh();
     setDocumentModified();
 }
 
@@ -6420,9 +6391,7 @@ QStringList CustomTrackView::extractTransitionsLumas()
             if (!luma.isEmpty()) urls << KUrl(luma).path();
         }
     }
-#if QT_VERSION >= 0x040500
     urls.removeDuplicates();
-#endif
     return urls;
 }