[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdenlive] src: Fix saving timeline thumbnails and revert no metadata in project file which caused m
From:       Jean-Baptiste Mardelle <jb () kdenlive ! org>
Date:       2016-06-05 19:40:52
Message-ID: E1b9dum-0004zK-Ox () scm ! kde ! org
[Download RAW message or body]

Git commit 4f2f5a6c3bdeceb6d4b6deb6e8500a3479a072b5 by Jean-Baptiste Mardelle.
Committed on 05/06/2016 at 19:40.
Pushed by mardelle into branch 'master'.

Fix saving timeline thumbnails and revert no metadata in project file which caused \
missing audiothumbs

M  +1    -0    src/bin/projectclip.cpp
M  +2    -3    src/doc/kdenlivedoc.cpp
M  +0    -1    src/monitor/glwidget.cpp
M  +3    -1    src/renderer.cpp
M  +6    -10   src/timeline/customtrackview.cpp

http://commits.kde.org/kdenlive/4f2f5a6c3bdeceb6d4b6deb6e8500a3479a072b5

diff --git a/src/bin/projectclip.cpp b/src/bin/projectclip.cpp
index 887fe7d..f251ae2 100644
--- a/src/bin/projectclip.cpp
+++ b/src/bin/projectclip.cpp
@@ -960,6 +960,7 @@ void ProjectClip::discardAudioThumb()
     if (!audioThumbPath.isEmpty())
         QFile::remove(audioThumbPath);
     audioFrameCache.clear();
+    qDebug()<<"////////////////////  DISCARD AUIIO THUMBNS";
     m_controller->audioThumbCreated = false;
     m_abortAudioThumb = false;
 }
diff --git a/src/doc/kdenlivedoc.cpp b/src/doc/kdenlivedoc.cpp
index ba7dad1..75a3c5c 100644
--- a/src/doc/kdenlivedoc.cpp
+++ b/src/doc/kdenlivedoc.cpp
@@ -298,7 +298,6 @@ void KdenliveDoc::slotSetDocumentNotes(const QString &notes)
 
 KdenliveDoc::~KdenliveDoc()
 {
-    qDebug()<<"** * ** *CLOSING DOC: \
"<<getDocumentProperty(QStringLiteral("documentid"))<<", URL: "<<m_url;  if \
(m_url.isEmpty()) {  // Document was never saved, delete cache folder
         QString documentId = \
QDir::cleanPath(getDocumentProperty(QStringLiteral("documentid"))); @@ -690,11 \
                +689,11 @@ bool KdenliveDoc::saveSceneList(const QString &path, const \
                QString &scene)
         KMessageBox::error(QApplication::activeWindow(), i18n("Cannot write to file \
%1, scene list is corrupted.", path));  return false;
     }
-    
+
     // Backup current version
     backupLastSavedVersion(path);
     QFile file(path);
-    
+
     if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
         qWarning() << "//////  ERROR writing to file: " << path;
         KMessageBox::error(QApplication::activeWindow(), i18n("Cannot write to file \
                %1", path));
diff --git a/src/monitor/glwidget.cpp b/src/monitor/glwidget.cpp
index c85c0d1..25b64eb 100644
--- a/src/monitor/glwidget.cpp
+++ b/src/monitor/glwidget.cpp
@@ -1444,7 +1444,6 @@ void GLWidget::setAudioThumb(int channels, QVariantList \
audioCache)  double value;
                 double scale = (double) width() / (audioLevelCount / channels);
                 if (scale < 1) {
-                    // 
                     painter.setPen(QColor(80, 80, 150, 200));
                     for (int i = 0; i < img.width(); i++) {
                         int framePos = i / scale;
diff --git a/src/renderer.cpp b/src/renderer.cpp
index 0659a44..cc56fca 100644
--- a/src/renderer.cpp
+++ b/src/renderer.cpp
@@ -549,7 +549,9 @@ const QString Render::sceneList()
     m_mltProducer->optimise();
     xmlConsumer.set("terminate_on_pause", 1);
     xmlConsumer.set("store", "kdenlive");
-    xmlConsumer.set("no_meta", 1);
+    // Disabling meta creates cleaner files, but then we don't have access to \
metadata on the fly (meta channels, etc) +    // And we must use "avformat" instead \
of "avformat-novalidate" on project loading which causes a big delay on project \
opening +    //xmlConsumer.set("no_meta", 1);
     Mlt::Producer prod(m_mltProducer->get_producer());
     if (!prod.is_valid()) return QString();
     xmlConsumer.connect(prod);
diff --git a/src/timeline/customtrackview.cpp b/src/timeline/customtrackview.cpp
index 408850e..f746c25 100644
--- a/src/timeline/customtrackview.cpp
+++ b/src/timeline/customtrackview.cpp
@@ -7111,7 +7111,7 @@ void CustomTrackView::setOutPoint()
 void CustomTrackView::slotUpdateAllThumbs()
 {
     if (!isEnabled()) return;
-    QList<QGraphicsItem *> itemList = items();
+    QList<QGraphicsItem *> itemList = scene()->items();
     //if (itemList.isEmpty()) return;
     ClipItem *item;
     bool ok = false;
@@ -7153,21 +7153,19 @@ void CustomTrackView::slotUpdateAllThumbs()
 
 void CustomTrackView::saveThumbnails()
 {
-    QList<QGraphicsItem *> itemList = items();
+    QList<QGraphicsItem *> itemList = scene()->items();
     ClipItem *item;
     bool ok = false;
     QDir thumbsFolder = m_document->getCacheDir(CacheThumbs, &ok);
-    QString thumbBase = m_document->projectFolder().path() + "/thumbs/";
     for (int i = 0; i < itemList.count(); ++i) {
         if (itemList.at(i)->type() == AVWidget) {
             item = static_cast <ClipItem *>(itemList.at(i));
-            if (item->clipType() != Color) {
+            if (item->clipType() != Color && item->clipType() != Audio) {
                 // Check if we have a cached thumbnail
                 if (item->clipType() == Image || item->clipType() == Text || \
                item->clipType() == Audio) {
                     QString thumb = thumbsFolder.absoluteFilePath(item->getBinHash() \
+ "#0.png");  if (!QFile::exists(thumb)) {
-                        QPixmap pix(item->startThumb());
-                        pix.save(thumb);
+                        item->startThumb().save(thumb);
                     }
                 } else {
                     QString startThumb = \
thumbsFolder.absoluteFilePath(item->getBinHash() + '#'); @@ -7175,12 +7173,10 @@ void \
                CustomTrackView::saveThumbnails()
                     startThumb.append(QString::number((int) \
item->speedIndependantCropStart().frames(m_document->fps())) + ".png");  \
endThumb.append(QString::number((int) (item->speedIndependantCropStart() + \
item->speedIndependantCropDuration()).frames(m_document->fps()) - 1) + ".png");  if \
                (!QFile::exists(startThumb)) {
-                        QPixmap pix(item->startThumb());
-                        pix.save(startThumb);
+                        item->startThumb().save(startThumb);
                     }
                     if (!QFile::exists(endThumb)) {
-                        QPixmap pix(item->endThumb());
-                        pix.save(endThumb);
+                        item->endThumb().save(endThumb);
                     }
                 }
             }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic