]> git.sesse.net Git - kdenlive/commitdiff
Correctly update timeline if a slideshow "loop" feature is changed, and add some...
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 25 Jan 2011 18:20:40 +0000 (18:20 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 25 Jan 2011 18:20:40 +0000 (18:20 +0000)
svn path=/trunk/kdenlive/; revision=5353

src/clipitem.cpp
src/clipitem.h
src/customtrackview.cpp
src/customtrackview.h
src/mainwindow.cpp
src/projectlist.cpp
src/projectlist.h
src/renderer.cpp

index 81768faa6c899d772f2932efe8cc62479f9c6fe4..f7e2b985b46b53aa378d1cea967e2553bd58c9e1 100644 (file)
@@ -508,7 +508,7 @@ void ClipItem::resetThumbs(bool clearExistingThumbs)
 }
 
 
-void ClipItem::refreshClip(bool checkDuration)
+void ClipItem::refreshClip(bool checkDuration, bool forceResetThumbs)
 {
     if (checkDuration && (m_maxDuration != m_clip->maxDuration())) {
         m_maxDuration = m_clip->maxDuration();
@@ -530,7 +530,7 @@ void ClipItem::refreshClip(bool checkDuration)
         colour = colour.replace(0, 2, "#");
         m_baseColor = QColor(colour.left(7));
         update();
-    } else resetThumbs(checkDuration);
+    } else resetThumbs(forceResetThumbs);
 }
 
 void ClipItem::slotFetchThumbs()
index e5b02450d1ed91d8d5267f06be6b59a241449494..8a3de4f2081c0ed127d8e1e937a7ac8d44453c73 100644 (file)
@@ -107,8 +107,9 @@ public:
     void resetThumbs(bool clearExistingThumbs);
 
     /** @brief Updates clip properties from base clip.
-    * @param checkDuration whether or not to check for a valid duration. */
-    void refreshClip(bool checkDuration);
+    * @param checkDuration whether or not to check for a valid duration. 
+    * @param resetThumbs whether or not to recreate the image thumbnails. */
+    void refreshClip(bool checkDuration, bool resetThumbs);
 
     /** @brief Gets clip's marker times.
     * @return A list of the times. */
index 74afb07db2e0267c7d5191cb528c101cfa5e9e6f..bdefdf5b61afc9fc0bc7b9f50c023af3cc63cdf5 100644 (file)
@@ -4057,7 +4057,7 @@ void CustomTrackView::slotUpdateClip(const QString &clipId, bool reload)
                 if (reload && !m_document->renderer()->mltUpdateClip(info, clip->xml(), clip->baseClip()->producer(info.track))) {
                     emit displayMessage(i18n("Cannot update clip (time: %1, track: %2)", info.startPos.frames(m_document->fps()), info.track), ErrorMessage);
                 }
-                clip->refreshClip(true);
+                clip->refreshClip(true, true);
             }
         }
     }
@@ -5599,7 +5599,7 @@ void CustomTrackView::slotUpdateAllThumbs()
                         item->slotSetEndThumb(pix);
                     }
                 }
-                item->refreshClip(false);
+                item->refreshClip(false, false);
             }
         }
     }
@@ -6618,7 +6618,7 @@ void CustomTrackView::updateTrackDuration(int track, QUndoCommand *command)
     }
 }
 
-void CustomTrackView::slotRefreshThumbs(const QString &id)
+void CustomTrackView::slotRefreshThumbs(const QString &id, bool resetThumbs)
 {
     QList<QGraphicsItem *> list = scene()->items();
     ClipItem *clip = NULL;
@@ -6626,7 +6626,7 @@ void CustomTrackView::slotRefreshThumbs(const QString &id)
         if (list.at(i)->type() == AVWIDGET) {
             clip = static_cast <ClipItem *>(list.at(i));
             if (clip->clipProducer() == id) {
-                clip->refreshClip(true);
+                clip->refreshClip(true, resetThumbs);
             }
         }
     }
index 6f0d6e6c2a7453052e905860ccb0abf2c94bfa8a..2abde9e26ece31dbdeaee15bc72493c18c3c481b 100644 (file)
@@ -444,8 +444,10 @@ private slots:
     void slotGoToMarker(QAction *action);
     void slotResetMenuPosition();
     void slotDoResetMenuPosition();
-    /** @brief Re-create the clip thumbnails. */
-    void slotRefreshThumbs(const QString &id);
+    /** @brief Re-create the clip thumbnails.
+     *  @param id The clip's Id string.
+     *  @param resetThumbs Should we recreate the timeline thumbnails. */
+    void slotRefreshThumbs(const QString &id, bool resetThumbs);
 
 signals:
     void cursorMoved(int, int);
index fe2eb9dff73546538c27e38211330cbfa14ee882..95eb7c5a66db3ab70341d94e9fb0bfd3ac2a792d 100644 (file)
@@ -869,7 +869,7 @@ void MainWindow::slotConnectMonitors()
 
     connect(m_projectMonitor->render, SIGNAL(removeInvalidClip(const QString &, bool)), m_projectList, SLOT(slotRemoveInvalidClip(const QString &, bool)));
 
-    connect(m_clipMonitor, SIGNAL(refreshClipThumbnail(const QString &)), m_projectList, SLOT(slotRefreshClipThumbnail(const QString &)));
+    connect(m_clipMonitor, SIGNAL(refreshClipThumbnail(const QString &, bool)), m_projectList, SLOT(slotRefreshClipThumbnail(const QString &, bool)));
 
     connect(m_clipMonitor, SIGNAL(adjustMonitorSize()), this, SLOT(slotAdjustClipMonitor()));
     connect(m_projectMonitor, SIGNAL(adjustMonitorSize()), this, SLOT(slotAdjustProjectMonitor()));
@@ -2409,7 +2409,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
         }
         //m_activeDocument->setRenderer(NULL);
         disconnect(m_projectList, SIGNAL(clipSelected(DocClipBase *)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *)));
-        disconnect(m_projectList, SIGNAL(refreshClip(const QString &)), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
+        disconnect(m_projectList, SIGNAL(refreshClip(const QString &, bool)), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
         m_clipMonitor->stop();
     }
     KdenliveSettings::setCurrent_profile(doc->profilePath());
@@ -2419,8 +2419,8 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
     m_transitionConfig->updateProjectFormat(doc->mltProfile(), doc->timecode(), doc->tracksList());
     m_effectStack->updateProjectFormat(doc->mltProfile(), doc->timecode());
     connect(m_projectList, SIGNAL(clipSelected(DocClipBase *, QPoint)), m_clipMonitor, SLOT(slotSetXml(DocClipBase *, QPoint)));
-    connect(m_projectList, SIGNAL(refreshClip(const QString &)), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
-    connect(m_projectList, SIGNAL(refreshClip(const QString &)), trackView->projectView(), SLOT(slotRefreshThumbs(const QString &)));
+    connect(m_projectList, SIGNAL(refreshClip(const QString &, bool)), m_monitorManager, SLOT(slotRefreshCurrentMonitor()));
+    connect(m_projectList, SIGNAL(refreshClip(const QString &, bool)), trackView->projectView(), SLOT(slotRefreshThumbs(const QString &, bool)));
     connect(m_projectList, SIGNAL(clipNeedsReload(const QString&, bool)), trackView->projectView(), SLOT(slotUpdateClip(const QString &, bool)));
 
     connect(m_projectList, SIGNAL(projectModified()), doc, SLOT(setModified()));
index e0666e3dabf3def82db8db24add97e53dc8249b6..ebb9b40564011ae939cd4d1f5ff20446171cc03f 100644 (file)
@@ -629,9 +629,9 @@ void ProjectList::slotUpdateClipProperties(const QString &id, QMap <QString, QSt
                    properties.contains("force_aspect_den") ||
                    properties.contains("templatetext")) {
             slotRefreshClipThumbnail(item);
-            emit refreshClip(id);
-        } else if (properties.contains("full_luma") || properties.contains("force_colorspace")) {
-            emit refreshClip(id);
+            emit refreshClip(id, true);
+        } else if (properties.contains("full_luma") || properties.contains("force_colorspace") || properties.contains("loop")) {
+            emit refreshClip(id, false);
         }
     }
 }
index c21c42fafb2392e8fa727827708683b0d9b7fe04..9446daebf0ca3244c44bdbdb70a4b9b6878b4b18 100644 (file)
@@ -314,8 +314,9 @@ signals:
     void clipNameChanged(const QString, const QString);
     void clipNeedsReload(const QString&, bool);
     /** @brief A property affecting display was changed, so we need to update monitors and thumbnails
-     *  @param id: The clip's id string */
-    void refreshClip(const QString &id);
+     *  @param id: The clip's id string
+     *  @param resetThumbs Should we recreate the timeline thumbnails. */
+    void refreshClip(const QString &id, bool resetThumbs);
     void updateRenderStatus();
     void deleteProjectClips(QStringList ids, QMap <QString, QString> folderids);
     void findInTimeline(const QString &clipId);
index 328d9aead6ce7422bdca47861765f68c34cbb9a8..b5b4c9a3e2c5da15fae1b93748137baa1392bfc7 100644 (file)
@@ -3666,8 +3666,12 @@ bool Render::mltAddTransition(QString tag, int a_track, int b_track, GenTime in,
         //kDebug() << " ------  ADDING TRANS PARAM: " << key << ": " << it.value();
     }
     // attach transition
+    m_isBlocked++;
+    mlt_service_lock(service.get_service());
     mltPlantTransition(field, *transition, a_track, b_track);
     // field->plant_transition(*transition, a_track, b_track);
+    mlt_service_unlock(service.get_service());
+    m_isBlocked--;
     if (do_refresh) refresh();
     return true;
 }