]> git.sesse.net Git - kdenlive/blobdiff - src/clipmanager.cpp
* Allow to edit transparent background for images in group properties
[kdenlive] / src / clipmanager.cpp
index 6b464814e0780a9fa67e78495c6ee258c4fa5afb..c81526904d23fb2134ada69c7cb8b22d5885f8ec 100644 (file)
@@ -56,21 +56,21 @@ ClipManager::ClipManager(KdenliveDoc *doc) :
 
 ClipManager::~ClipManager()
 {
-    qDeleteAll(m_clipList);
-    m_clipList.clear();
     m_audioThumbsQueue.clear();
     m_generatingAudioId.clear();
+    qDeleteAll(m_clipList);
+    m_clipList.clear();
 }
 
 void ClipManager::clear()
 {
+    m_folderList.clear();
+    m_audioThumbsQueue.clear();
+    m_modifiedClips.clear();
     qDeleteAll(m_clipList);
     m_clipList.clear();
     m_clipIdCounter = 1;
     m_folderIdCounter = 1;
-    m_folderList.clear();
-    m_audioThumbsQueue.clear();
-    m_modifiedClips.clear();
 }
 
 void ClipManager::checkAudioThumbs()
@@ -225,22 +225,6 @@ const QList <DocClipBase *> ClipManager::getClipByResource(QString resource)
     return list;
 }
 
-void ClipManager::updatePreviewSettings()
-{
-    for (int i = 0; i < m_clipList.count(); i++) {
-        if (m_clipList.at(i)->clipType() == AV || m_clipList.at(i)->clipType() == VIDEO) {
-            if (m_clipList.at(i)->producerProperty("meta.media.0.codec.name") && strcmp(m_clipList.at(i)->producerProperty("meta.media.0.codec.name"), "h264") == 0) {
-                if (KdenliveSettings::dropbframes()) {
-                    m_clipList[i]->setProducerProperty("skip_loop_filter", "all");
-                    m_clipList[i]->setProducerProperty("skip_frame", "bidir");
-                } else {
-                    m_clipList[i]->setProducerProperty("skip_loop_filter", "");
-                    m_clipList[i]->setProducerProperty("skip_frame", "");
-                }
-            }
-        }
-    }
-}
 
 void ClipManager::clearUnusedProducers()
 {
@@ -294,7 +278,8 @@ void ClipManager::slotAddClipList(const KUrl::List urls, const QString group, co
             if (type->name().startsWith("image/")) {
                 prod.setAttribute("type", (int) IMAGE);
                 prod.setAttribute("in", 0);
-                prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::image_duration()) - 1);
+                prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::image_duration()));
+                if (KdenliveSettings::autoimagetransparency()) prod.setAttribute("transparency", 1);
                 // Read EXIF metadata for JPEG
                 if (type->is("image/jpeg")) {
                     KFileMetaInfo metaInfo(file.path(), QString("image/jpeg"), KFileMetaInfo::TechnicalInfo);
@@ -331,7 +316,7 @@ void ClipManager::slotAddClipList(const KUrl::List urls, const QString group, co
                     if (out > 0)
                         prod.setAttribute("out", out);
                     else
-                        prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::title_duration()) - 1);
+                        prod.setAttribute("out", m_doc->getFramePos(KdenliveSettings::title_duration()));
                 } else
                     txtfile.close();
             }
@@ -377,7 +362,7 @@ void ClipManager::slotAddColorClipFile(const QString name, const QString color,
     uint id = m_clipIdCounter++;
     prod.setAttribute("id", QString::number(id));
     prod.setAttribute("in", "0");
-    prod.setAttribute("out", m_doc->getFramePos(duration) - 1);
+    prod.setAttribute("out", m_doc->getFramePos(duration));
     prod.setAttribute("name", name);
     if (!group.isEmpty()) {
         prod.setAttribute("groupname", group);
@@ -400,7 +385,7 @@ void ClipManager::slotAddSlideshowClipFile(const QString name, const QString pat
     uint id = m_clipIdCounter++;
     prod.setAttribute("id", QString::number(id));
     prod.setAttribute("in", "0");
-    prod.setAttribute("out", m_doc->getFramePos(duration) * count - 1);
+    prod.setAttribute("out", m_doc->getFramePos(duration) * count);
     prod.setAttribute("ttl", m_doc->getFramePos(duration));
     prod.setAttribute("luma_duration", m_doc->getFramePos(luma_duration));
     prod.setAttribute("name", name);
@@ -467,7 +452,7 @@ void ClipManager::slotAddTextTemplateClip(QString titleName, const KUrl path, co
         out = titledoc.documentElement().attribute("out").toInt();
     } else txtfile.close();
 
-    if (out == 0) out = m_doc->getFramePos(KdenliveSettings::image_duration()) - 1;
+    if (out == 0) out = m_doc->getFramePos(KdenliveSettings::image_duration());
     prod.setAttribute("out", out);
 
     AddClipCommand *command = new AddClipCommand(m_doc, doc.documentElement(), QString::number(id), true);