]> git.sesse.net Git - kdenlive/blobdiff - src/slideshowclip.cpp
Moved kiss_fft to the lib/ directory
[kdenlive] / src / slideshowclip.cpp
index dbe15e2dc7c1094bbf5742ecacd4424c4a0c92b7..db30cfc0e4ec54b8ff77d1cfd5e6a321246b4d8c 100644 (file)
@@ -31,6 +31,7 @@
 SlideshowClip::SlideshowClip(Timecode tc, QWidget * parent) :
     QDialog(parent),
     m_count(0),
+    m_patternBegin(0),
     m_timecode(tc),
     m_thumbJob(NULL)
 {
@@ -157,6 +158,7 @@ void SlideshowClip::slotEnableLumaFile(int state)
 }
 
 // static
+//TODO: sequence begin
 int SlideshowClip::sequenceCount(KUrl file)
 {
     // find pattern
@@ -220,9 +222,10 @@ void SlideshowClip::parseFolder()
             filter.remove(filter.size() - 1, 1);
         }
         int precision = fullSize - filter.size();
+        m_patternBegin = m_view.pattern_url->url().fileName().section('.', 0, -2).right(precision).toInt();
         QString path;
         int gap = 0;
-        for (int i = 0; gap < 100; i++) {
+        for (int i = m_patternBegin; gap < 100; i++) {
             path = filter + QString::number(i).rightJustified(precision, '0', false) + ext;
             if (dir.exists(path)) {
                 result.append(path);
@@ -417,15 +420,11 @@ void SlideshowClip::slotUpdateDurationFormat(int ix)
     bool framesFormat = ix == 1;
     if (framesFormat) {
         // switching to frames count, update widget
-        m_view.clip_duration->setInputMask("");
         m_view.clip_duration_frames->setValue(m_timecode.getFrameCount(m_view.clip_duration->text()));
-        m_view.luma_duration->setInputMask("");
         m_view.luma_duration_frames->setValue(m_timecode.getFrameCount(m_view.luma_duration->text()));
     } else {
         // switching to timecode format
-        m_view.clip_duration->setInputMask(m_timecode.mask());
         m_view.clip_duration->setText(m_timecode.getTimecodeFromFrames(m_view.clip_duration_frames->value()));
-        m_view.luma_duration->setInputMask(m_timecode.mask());
         m_view.luma_duration->setText(m_timecode.getTimecodeFromFrames(m_view.luma_duration_frames->value()));
     }
     m_view.clip_duration_frames->setHidden(!framesFormat);
@@ -438,16 +437,12 @@ 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.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.clip_duration->setText(m_timecode.reformatSeparators(KdenliveSettings::sequence_duration()));
         m_view.stackedWidget->setCurrentIndex(1);
         KdenliveSettings::setSlideshowbymime(false);
     }
@@ -472,6 +467,11 @@ QString SlideshowClip::animationToGeometry(const QString &animation, int &ttl)
     return geometry;
 }
 
+int SlideshowClip::begin() const
+{
+   return m_patternBegin;
+}
+
 #include "slideshowclip.moc"