]> git.sesse.net Git - kdenlive/blobdiff - src/docclipbase.cpp
Fix small bug in audio thumbs creation
[kdenlive] / src / docclipbase.cpp
index 2b36b8bbc861071919bbd11a59646f4b02d28143..287610925e09930063f44787f29e61b6b0da13c3 100644 (file)
@@ -87,7 +87,6 @@ DocClipBase::DocClipBase(ClipManager *clipManager, QDomElement xml, const QStrin
     if (!m_properties.contains("name")) m_properties.insert("name", url.fileName());
 
     m_thumbProd = new KThumb(clipManager, url, m_id, m_properties.value("file_hash"));
-    if (m_clipType & (AV | AUDIO | PLAYLIST)) getAudioThumbs();
 }
 
 DocClipBase::~DocClipBase()
@@ -116,6 +115,12 @@ QPoint DocClipBase::zone() const
 }
 
 
+bool DocClipBase::hasAudioThumb() const
+{
+    if (m_clipType == AUDIO || m_clipType == AV || m_clipType == PLAYLIST) return true;
+    return false;
+}
+
 void DocClipBase::slotClearAudioCache()
 {
     m_audioFrameCache.clear();
@@ -251,17 +256,6 @@ void DocClipBase::setAudioThumbCreated(bool isDone)
     m_audioThumbCreated = isDone;
 }
 
-
-void DocClipBase::setThumbnail(const QPixmap & pixmap)
-{
-    m_thumbnail = pixmap;
-}
-
-const QPixmap & DocClipBase::thumbnail() const
-{
-    return m_thumbnail;
-}
-
 void DocClipBase::updateAudioThumbnail(const audioByteArray& data)
 {
     //kDebug() << "CLIPBASE RECIEDVED AUDIO DATA*********************************************";
@@ -476,6 +470,7 @@ void DocClipBase::setProducer(Mlt::Producer *producer, bool reset, bool readProp
                 m_thumbProd->setProducer(producer);
         }
         else m_thumbProd->setProducer(producer);
+        getAudioThumbs();
     }
     bool updated = false;
     if (id.contains('_')) {
@@ -1193,12 +1188,11 @@ void DocClipBase::slotExtractImage(QList <int> frames)
     m_thumbProd->extractImage(frames);
 }
 
-QPixmap DocClipBase::extractImage(int frame, int width, int height)
+QImage DocClipBase::extractImage(int frame, int width, int height)
 {
-    if (m_thumbProd == NULL) return QPixmap(width, height);
+    if (m_thumbProd == NULL) return QImage();
     QMutexLocker locker(&m_producerMutex);
-    QPixmap p = m_thumbProd->extractImage(frame, width, height);
-    return p;
+    return m_thumbProd->extractImage(frame, width, height);
 }