]> git.sesse.net Git - kdenlive/commitdiff
When creating slideshow with mimetype based option, use "image duration" as default...
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 7 Sep 2010 07:55:28 +0000 (07:55 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 7 Sep 2010 07:55:28 +0000 (07:55 +0000)
svn path=/trunk/kdenlive/; revision=4857

src/slideshowclip.cpp

index 10f4c25e3246faba8ec33ad6483135e2ed83e691..dcdbd845c3162986f73e525704bc0a1d50a7e0c4 100644 (file)
@@ -68,7 +68,6 @@ SlideshowClip::SlideshowClip(Timecode tc, QWidget * parent) :
 
     m_view.clip_duration->setInputMask("");
     m_view.clip_duration->setValidator(m_timecode.validator());
-    m_view.clip_duration->setText(m_timecode.reformatSeparators(KdenliveSettings::sequence_duration()));
     m_view.luma_duration->setInputMask("");
     m_view.luma_duration->setValidator(m_timecode.validator());
     m_view.luma_duration->setText(m_timecode.getTimecodeFromFrames(int(ceil(m_timecode.fps()))));
@@ -83,6 +82,7 @@ SlideshowClip::SlideshowClip(Timecode tc, QWidget * parent) :
     connect(m_view.method_mime, SIGNAL(toggled(bool)), this, SLOT(slotMethodChanged(bool)));
     slotMethodChanged(m_view.method_mime->isChecked());
 
+
     // Check for Kdenlive installed luma files
     QStringList filters;
     filters << "*.pgm" << "*.png";
@@ -417,10 +417,16 @@ void SlideshowClip::slotMethodChanged(bool active)
 {
     if (active) {
         // User wants mimetype image sequence
+        if (m_view.clip_duration->text().isEmpty()) {
+           m_view.clip_duration->setText(m_timecode.reformatSeparators(KdenliveSettings::image_duration()));
+       }
         m_view.stackedWidget->setCurrentIndex(0);
         KdenliveSettings::setSlideshowbymime(true);
     } else {
         // User wants pattern image sequence
+        if (m_view.clip_duration->text().isEmpty()) {
+           m_view.clip_duration->setText(m_timecode.reformatSeparators(KdenliveSettings::sequence_duration()));
+       }
         m_view.stackedWidget->setCurrentIndex(1);
         KdenliveSettings::setSlideshowbymime(false);
     }
@@ -433,14 +439,14 @@ QString SlideshowClip::animationToGeometry(const QString &animation, int &ttl)
     QString geometry;
     if (animation.startsWith("Pan and zoom")) {
         geometry = QString().sprintf("0=0,0:100%%x100%%;%d=-14%%,-14%%:120%%x120%%;%d=-5%%,-5%%:110%%x110%%;%d=0,0:110%%x110%%;%d=0,-5%%:110%%x110%%;%d=-5%%,0:110%%x110%%",
-                                     ttl-1, ttl, ttl*2 - 1, ttl*2, ttl*3 - 1 );
+                                     ttl - 1, ttl, ttl * 2 - 1, ttl * 2, ttl * 3 - 1);
         ttl *= 3;
     } else if (animation.startsWith("Pan")) {
         geometry = QString().sprintf("0=-5%%,-5%%:110%%x110%%;%d=0,0:110%%x110%%;%d=0,0:110%%x110%%;%d=0,-5%%:110%%x110%%;%d=0,-5%%:110%%x110%%;%d=-5%%,-5%%:110%%x110%%;%d=0,-5%%:110%%x110%%;%d=-5%%,0:110%%x110%%",
-                                     ttl-1, ttl, ttl*2 - 1, ttl*2, ttl*3 - 1, ttl*3, ttl*4 - 1 );
+                                     ttl - 1, ttl, ttl * 2 - 1, ttl * 2, ttl * 3 - 1, ttl * 3, ttl * 4 - 1);
         ttl *= 4;
     } else if (animation.startsWith("Zoom")) {
-        geometry = QString().sprintf("0=0,0:100%%x100%%;%d=-14%%,-14%%:120%%x120%%", ttl-1 );
+        geometry = QString().sprintf("0=0,0:100%%x100%%;%d=-14%%,-14%%:120%%x120%%", ttl - 1);
     }
     return geometry;
 }