]> git.sesse.net Git - kdenlive/blobdiff - src/docclipbase.cpp
Properly disable bitrate combobox
[kdenlive] / src / docclipbase.cpp
index 485fe907627cd4aabd8dd53992e4f2504d6c0a3a..50300cc4a26d4c0fe13db2796f9c56ce86122c8a 100644 (file)
 #include "slideshowclip.h"
 
 #include <KIO/NetAccess>
+#include <KStandardDirs>
 #include <KDebug>
 
 #include <QCryptographicHash>
+#include <QtConcurrentRun>
 
 #include <cstdio>
 
@@ -655,7 +657,6 @@ const char *DocClipBase::producerProperty(const char *name) const
 void DocClipBase::slotRefreshProducer()
 {
     if (m_baseTrackProducers.count() == 0) return;
-    kDebug() << "////////////   REFRESH CLIP !!!!!!!!!!!!!!!!";
     if (m_clipType == SLIDESHOW) {
         /*Mlt::Producer producer(*(m_clipProducer->profile()), getProperty("resource").toUtf8().data());
         delete m_clipProducer;
@@ -861,7 +862,11 @@ QString DocClipBase::getClipHash() const
     if (m_clipType == SLIDESHOW) hash = QCryptographicHash::hash(m_properties.value("resource").toAscii().data(), QCryptographicHash::Md5).toHex();
     else if (m_clipType == COLOR) hash = QCryptographicHash::hash(m_properties.value("colour").toAscii().data(), QCryptographicHash::Md5).toHex();
     else if (m_clipType == TEXT) hash = QCryptographicHash::hash(QString("title" + getId() + m_properties.value("xmldata")).toUtf8().data(), QCryptographicHash::Md5).toHex();
-    else hash = m_properties.value("file_hash");
+    else {
+        if (m_properties.contains("file_hash")) hash = m_properties.value("file_hash");
+        else hash = getHash(fileURL().path());
+        
+    }
     return hash;
 }
 
@@ -965,6 +970,16 @@ void DocClipBase::setProperty(const QString &key, const QString &value)
             resetProducerProperty("set.force_full_luma");
         } else setProducerProperty("set.force_full_luma", value.toInt());
     }
+    else if (key == "proxy") {
+        // If value is "-", that means user manually disabled proxy on this clip
+        if (value.isEmpty() || value == "-") {
+            // reset proxy
+            emit abortProxy(m_id);
+        }
+        else {
+            emit createProxy(m_id);
+        }
+    }
 }
 
 QMap <QString, QString> DocClipBase::properties() const
@@ -1079,3 +1094,5 @@ bool DocClipBase::hasAudioCodec(const QString &codec) const
     return prod->get(property) == codec;
 }
 
+
+