m_view.icon_list->setIconSize(QSize(50, 50));
m_view.show_thumbs->setChecked(KdenliveSettings::showslideshowthumbs());
- connect(m_view.folder_url, SIGNAL(textChanged(const QString &)), this, SLOT(parseFolder()));
+ connect(m_view.folder_url, SIGNAL(textChanged(QString)), this, SLOT(parseFolder()));
connect(m_view.image_type, SIGNAL(currentIndexChanged(int)), this, SLOT(parseFolder()));
- connect(m_view.pattern_url, SIGNAL(textChanged(const QString &)), this, SLOT(parseFolder()));
+ connect(m_view.pattern_url, SIGNAL(textChanged(QString)), this, SLOT(parseFolder()));
connect(m_view.show_thumbs, SIGNAL(stateChanged(int)), this, SLOT(slotEnableThumbs(int)));
connect(m_view.slide_fade, SIGNAL(stateChanged(int)), this, SLOT(slotEnableLuma(int)));
} else {
KdenliveSettings::setShowslideshowthumbs(false);
if (m_thumbJob) {
- disconnect(m_thumbJob, SIGNAL(gotPreview(const KFileItem &, const QPixmap &)), this, SLOT(slotSetPixmap(const KFileItem &, const QPixmap &)));
+ disconnect(m_thumbJob, SIGNAL(gotPreview(KFileItem,QPixmap)), this, SLOT(slotSetPixmap(KFileItem,QPixmap)));
m_thumbJob->kill();
m_thumbJob = NULL;
}
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();
#endif
m_thumbJob->setAutoDelete(false);
- connect(m_thumbJob, SIGNAL(gotPreview(const KFileItem &, const QPixmap &)), this, SLOT(slotSetPixmap(const KFileItem &, const QPixmap &)));
+ connect(m_thumbJob, SIGNAL(gotPreview(KFileItem,QPixmap)), this, SLOT(slotSetPixmap(KFileItem,QPixmap)));
m_thumbJob->start();
}
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;
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;