]> git.sesse.net Git - kdenlive/blobdiff - src/slideshowclip.cpp
some progress on slideshow clips
[kdenlive] / src / slideshowclip.cpp
index 79ce97f0bb8cf2e5a26a569202a268ca9e214e67..6fba36736f9e0ec17cb598015bbfed4f766f785b 100644 (file)
@@ -40,15 +40,51 @@ SlideshowClip::SlideshowClip(QWidget * parent): QDialog(parent), m_count(0) {
     m_view.icon_list->setIconSize(QSize(50, 50));
     connect(m_view.folder_url, SIGNAL(textChanged(const QString &)), this, SLOT(parseFolder()));
     connect(m_view.image_type, SIGNAL(currentIndexChanged(int)), this, SLOT(parseFolder()));
+
+    connect(m_view.slide_fade, SIGNAL(stateChanged(int)), this, SLOT(slotEnableLuma(int)));
+    connect(m_view.luma_fade, SIGNAL(stateChanged(int)), this, SLOT(slotEnableLumaFile(int)));
+
     m_view.image_type->addItem("JPG");
     m_view.image_type->addItem("PNG");
     m_view.image_type->addItem("BMP");
     m_view.image_type->addItem("GIF");
-    m_view.clip_duration->setText("00:00:03:00");
+    m_view.clip_duration->setText(KdenliveSettings::image_duration());
+    m_view.luma_duration->setText("00:00:00:24");
     m_view.folder_url->setUrl(QDir::homePath());
+
+
+    QString profilePath = KdenliveSettings::mltpath();
+    profilePath = profilePath.section('/', 0, -3);
+    profilePath += "/lumas/PAL/";
+
+    QDir dir(profilePath);
+    QStringList result = dir.entryList(QDir::Files);
+    QStringList imagefiles;
+    QStringList imagenamelist;
+    foreach(QString file, result) {
+        if (file.endsWith(".pgm")) {
+            m_view.luma_file->addItem(KIcon(profilePath + file), file, profilePath + file);
+        }
+    }
+
     adjustSize();
 }
 
+void SlideshowClip::slotEnableLuma(int state) {
+    bool enable = false;
+    if (state == Qt::Checked) enable = true;
+    m_view.luma_duration->setEnabled(enable);
+    m_view.luma_fade->setEnabled(enable);
+    if (enable) m_view.luma_file->setEnabled(m_view.luma_fade->isChecked());
+    else m_view.luma_file->setEnabled(false);
+}
+
+void SlideshowClip::slotEnableLumaFile(int state) {
+    bool enable = false;
+    if (state == Qt::Checked) enable = true;
+    m_view.luma_file->setEnabled(enable);
+}
+
 void SlideshowClip::parseFolder() {
     m_view.icon_list->clear();
     QDir dir(m_view.folder_url->url().path());
@@ -117,6 +153,20 @@ int SlideshowClip::imageCount() const {
 bool SlideshowClip::loop() const {
     return m_view.slide_loop->isChecked();
 }
+
+bool SlideshowClip::fade() const {
+    return m_view.slide_fade->isChecked();
+}
+
+QString SlideshowClip::lumaDuration() const {
+    return m_view.luma_duration->text();
+}
+
+QString SlideshowClip::lumaFile() const {
+    if (!m_view.luma_fade->isChecked() || !m_view.luma_file->isEnabled()) return QString();
+    return m_view.luma_file->itemData(m_view.luma_file->currentIndex()).toString();
+}
+
 #include "slideshowclip.moc"