]> git.sesse.net Git - kdenlive/commitdiff
Start using new MLT format for image sequences
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 6 Nov 2012 22:08:52 +0000 (23:08 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 6 Nov 2012 22:08:52 +0000 (23:08 +0100)
src/mainwindow.cpp
src/slideshowclip.cpp

index 2936b538703ba00cc22e593364ddfd8481e86d51..7f8917a3692ec8dd2ab85df9de36d835eeda6fa4 100644 (file)
@@ -3319,7 +3319,7 @@ void MainWindow::slotShowClipProperties(DocClipBase *clip)
     // any type of clip but a title
     ClipProperties *dia = new ClipProperties(clip, m_activeDocument->timecode(), m_activeDocument->fps(), this);
 
-    if (clip->clipType() == AV || clip->clipType() == VIDEO || clip->clipType() == PLAYLIST) {
+    if (clip->clipType() == AV || clip->clipType() == VIDEO || clip->clipType() == PLAYLIST || clip->clipType() == SLIDESHOW) {
        // request clip thumbnails
        m_activeDocument->clipManager()->requestThumbs(QString('?' + clip->getId()), QList<int>() << clip->getClipThumbFrame());
        connect(m_activeDocument->clipManager(), SIGNAL(gotClipPropertyThumbnail(const QString&,QImage)), dia, SLOT(slotGotThumbnail(const QString&,QImage)));
index 8a0b5c9716709a61684e8e7606f2c26cff913dbd..ffc7661742852d7d396b29a34b03a1fafa9a3207 100644 (file)
@@ -156,44 +156,6 @@ void SlideshowClip::slotEnableLumaFile(int state)
     m_view.label_softness->setEnabled(enable);
 }
 
-// static
-//TODO: sequence begin
-int SlideshowClip::sequenceCount(KUrl file)
-{
-    // find pattern
-    int count = 0;
-    QString filter = file.fileName();
-    QString ext = filter.section('.', -1);
-    filter = filter.section('.', 0, -2);
-    int fullSize = filter.size();
-    bool hasDigit = false;
-    while (filter.at(filter.size() - 1).isDigit()) {
-        hasDigit = true;
-        filter.remove(filter.size() - 1, 1);
-    }
-    if (!hasDigit) return 0;
-
-
-    // Find number of digits in sequence
-    int precision = fullSize - filter.size();
-    int firstFrame = file.fileName().section('.', 0, -2).right(precision).toInt();    
-    QString folder = file.directory(KUrl::AppendTrailingSlash);
-    // Check how many files we have
-    QDir dir(folder);
-    QString path;
-    int gap = 0;
-    for (int i = firstFrame; gap < 100; i++) {
-        path = filter + QString::number(i).rightJustified(precision, '0', false) + ext;
-        if (dir.exists(path)) {
-            count ++;
-            gap = 0;
-        } else {
-            gap++;
-        }
-    }
-    return count;
-}
-
 void SlideshowClip::parseFolder()
 {
     m_view.icon_list->clear();
@@ -348,9 +310,6 @@ QString SlideshowClip::selectedPath(KUrl url, bool isMime, QString extension, QS
         int precision = fullSize - filter.size();
        int firstFrame = firstFrameData.right(precision).toInt();
 
-       // Workaround bug in MLT image sequence detection
-       if (firstFrame < 3) firstFrame = 0;
-
         // Check how many files we have
         QDir dir(folder);
         QString path;
@@ -364,8 +323,8 @@ QString SlideshowClip::selectedPath(KUrl url, bool isMime, QString extension, QS
                 gap++;
             }
         }
-        if (firstFrame > 0) extension = filter + '%' + QString::number(firstFrame).rightJustified(precision, '0', false) + 'd' + ext;
-        else extension = filter + "%0" + QString::number(precision) + 'd' + ext;
+        extension = filter + "%0" + QString::number(precision) + 'd' + ext;
+       if (firstFrame > 0) extension.append(QString("?begin:%1").arg(firstFrame));
     }
     kDebug() << "// FOUND " << (*list).count() << " items for " << url.path();
     return  folder + extension;