From: Jean-Baptiste Mardelle Date: Tue, 6 Nov 2012 22:08:52 +0000 (+0100) Subject: Start using new MLT format for image sequences X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=51513e687f4f6d239370cfe7c7886ce2f8754d03;p=kdenlive Start using new MLT format for image sequences --- diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2936b538..7f8917a3 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -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() << clip->getClipThumbFrame()); connect(m_activeDocument->clipManager(), SIGNAL(gotClipPropertyThumbnail(const QString&,QImage)), dia, SLOT(slotGotThumbnail(const QString&,QImage))); diff --git a/src/slideshowclip.cpp b/src/slideshowclip.cpp index 8a0b5c97..ffc76617 100644 --- a/src/slideshowclip.cpp +++ b/src/slideshowclip.cpp @@ -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;