From: Jean-Baptiste Mardelle Date: Tue, 7 Sep 2010 07:55:28 +0000 (+0000) Subject: When creating slideshow with mimetype based option, use "image duration" as default... X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=f8df7dd275da66d3df99d02deafe043d9a538555;p=kdenlive When creating slideshow with mimetype based option, use "image duration" as default length for each frame. When using the "name pattern" option, we are more likely using a frame by frame animation, so use "sequence duration" as default duration svn path=/trunk/kdenlive/; revision=4857 --- diff --git a/src/slideshowclip.cpp b/src/slideshowclip.cpp index 10f4c25e..dcdbd845 100644 --- a/src/slideshowclip.cpp +++ b/src/slideshowclip.cpp @@ -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; }