]> git.sesse.net Git - kdenlive/commitdiff
Add option to automatically import all clips in multi stream clips
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 19 Sep 2012 09:01:42 +0000 (11:01 +0200)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 19 Sep 2012 09:01:42 +0000 (11:01 +0200)
src/documentvalidator.cpp
src/kdenlivesettings.kcfg
src/renderer.cpp
src/widgets/configmisc_ui.ui

index 896d9cf682199dec74dcb5e234d4f7e2404a911b..a0775b5c68636589f152f2a0b594e8300c8a6463 100644 (file)
@@ -60,7 +60,7 @@ bool DocumentValidator::validate(const double currentVersion)
     
     QString rootDir = mlt.attribute("root");
     if (rootDir == "$CURRENTPATH") {
-        // The document was extracted from a Kdenlive archived project, fix root directory$
+        // The document was extracted from a Kdenlive archived project, fix root directory
         QString playlist = m_doc.toString();
         playlist.replace("$CURRENTPATH", m_url.directory(KUrl::IgnoreTrailingSlash));
         m_doc.setContent(playlist);
index 0a3bbaa50e7fc3ff2427ae5aa8306f2824b61b0a..16a0b8b5c503062c52ec8cab63e609fa4b65049b 100644 (file)
       <default>false</default>
     </entry>
 
+    <entry name="automultistreams" type="Bool">
+      <label>Automatically import all streams in multi streams clips.</label>
+      <default>false</default>
+    </entry>
+
     <entry name="title_duration" type="String">
       <label>Default title clip duration.</label>
       <default>00:00:05:00</default>
index 51670b58118d0e16a4a3131f7b337dd36564b34e..9f0b2b19657d759f1d081942caac4e55cd46f6e3 100644 (file)
@@ -4511,7 +4511,22 @@ bool Render::getBlackMagicOutputDeviceList(KComboBox *devicelist)
 }
 
 void Render::slotMultiStreamProducerFound(const QString path, QList<int> audio_list, QList<int> video_list, stringMap data)
-{
+{ 
+    if (KdenliveSettings::automultistreams()) {
+       for (int i = 1; i < video_list.count(); i++) {
+           int vindex = video_list.at(i);
+           int aindex = 0;
+           if (i <= audio_list.count() -1) {
+               aindex = audio_list.at(i);
+           }
+           data.insert("video_index", QString::number(vindex));
+           data.insert("audio_index", QString::number(aindex));
+           data.insert("bypassDuplicate", "1");
+           emit addClip(KUrl(path), data);
+       }
+       return;
+    }
+    
     int width = 60.0 * m_mltProfile->dar();
     int swidth = 60.0 * m_mltProfile->width() / m_mltProfile->height();
     if (width % 2 == 1) width++;
@@ -4531,13 +4546,12 @@ void Render::slotMultiStreamProducerFound(const QString path, QList<int> audio_l
     for (int j = 1; j < video_list.count(); j++) {
        Mlt::Producer multiprod(* m_mltProfile, path.toUtf8().constData());
        multiprod.set("video_index", video_list.at(j));
-       kDebug()<<"// LOADING: "<<j<<" = "<<video_list.at(j);
        QImage thumb = KThumb::getFrame(&multiprod, 0, swidth, width, 60);
        QGroupBox *streamFrame = new QGroupBox(i18n("Video stream %1", video_list.at(j)), content);
        streamFrame->setProperty("vindex", video_list.at(j));
        groupList << streamFrame;
        streamFrame->setCheckable(true);
-       streamFrame->setChecked(false);
+       streamFrame->setChecked(true);
        QVBoxLayout *vh = new QVBoxLayout( streamFrame );
        QLabel *iconLabel = new QLabel(content);
        iconLabel->setPixmap(QPixmap::fromImage(thumb));
@@ -4548,7 +4562,7 @@ void Render::slotMultiStreamProducerFound(const QString path, QList<int> audio_l
                cb->addItem(i18n("Audio stream %1", audio_list.at(k)), audio_list.at(k));
            }
            comboList << cb;
-           cb->setCurrentIndex(j);
+           cb->setCurrentIndex(qMin(j, audio_list.count() - 1));
            vh->addWidget(cb);
        }
        vbox->addWidget(streamFrame);
index 58560fcd6f38e3bccb5c76cef80161b6c40a06d8..8f151efd5caf1962caa4cdc66580496574e1fb6c 100644 (file)
@@ -7,7 +7,7 @@
     <x>0</x>
     <y>0</y>
     <width>380</width>
-    <height>320</height>
+    <height>345</height>
    </rect>
   </property>
   <layout class="QGridLayout" name="gridLayout_4">
      </property>
     </widget>
    </item>
-   <item row="2" column="0" colspan="3">
-    <widget class="QCheckBox" name="kcfg_crashrecovery">
-     <property name="text">
-      <string>Crash recovery (automatic backup)</string>
-     </property>
-    </widget>
-   </item>
-   <item row="3" column="0" colspan="3">
-    <widget class="QCheckBox" name="kcfg_activatetabs">
-     <property name="text">
-      <string>Open projects in new tabs</string>
-     </property>
-    </widget>
-   </item>
-   <item row="8" column="0" colspan="3">
+   <item row="9" column="0" colspan="3">
     <widget class="QGroupBox" name="groupBox">
      <property name="title">
       <string>Default Durations</string>
      </layout>
     </widget>
    </item>
-   <item row="11" column="0" colspan="3">
+   <item row="12" column="0" colspan="3">
     <spacer>
      <property name="orientation">
       <enum>Qt::Vertical</enum>
      </property>
     </spacer>
    </item>
-   <item row="4" column="0" colspan="2">
-    <widget class="QCheckBox" name="kcfg_usekuiserver">
+   <item row="10" column="0">
+    <widget class="QCheckBox" name="kcfg_autoimagesequence">
      <property name="text">
-      <string>Use KDE job tracking for render jobs</string>
+      <string>Automatically import image sequences</string>
      </property>
     </widget>
    </item>
-   <item row="5" column="0">
-    <widget class="QCheckBox" name="kcfg_on_monitor_effects">
+   <item row="1" column="0" colspan="2">
+    <widget class="QCheckBox" name="kcfg_checkfirstprojectclip">
      <property name="text">
-      <string>Use on-monitor effects</string>
+      <string>Check if first added clip matches project profile</string>
      </property>
     </widget>
    </item>
-   <item row="9" column="0">
-    <widget class="QCheckBox" name="kcfg_autoimagesequence">
+   <item row="5" column="0">
+    <widget class="QCheckBox" name="kcfg_on_monitor_effects">
      <property name="text">
-      <string>Automatically import image sequences</string>
+      <string>Use on-monitor effects</string>
      </property>
     </widget>
    </item>
-   <item row="1" column="0" colspan="2">
-    <widget class="QCheckBox" name="kcfg_checkfirstprojectclip">
+   <item row="11" column="0">
+    <widget class="QCheckBox" name="kcfg_autoimagetransparency">
      <property name="text">
-      <string>Check if first added clip matches project profile</string>
+      <string>Transparent background for imported images</string>
      </property>
     </widget>
    </item>
      </property>
     </widget>
    </item>
+   <item row="2" column="0" colspan="3">
+    <widget class="QCheckBox" name="kcfg_crashrecovery">
+     <property name="text">
+      <string>Crash recovery (automatic backup)</string>
+     </property>
+    </widget>
+   </item>
+   <item row="4" column="0" colspan="2">
+    <widget class="QCheckBox" name="kcfg_usekuiserver">
+     <property name="text">
+      <string>Use KDE job tracking for render jobs</string>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="0" colspan="3">
+    <widget class="QCheckBox" name="kcfg_activatetabs">
+     <property name="text">
+      <string>Open projects in new tabs</string>
+     </property>
+    </widget>
+   </item>
    <item row="7" column="0">
     <widget class="QCheckBox" name="kcfg_disable_effect_parameters">
      <property name="text">
      </property>
     </widget>
    </item>
-   <item row="10" column="0">
-    <widget class="QCheckBox" name="kcfg_autoimagetransparency">
+   <item row="8" column="0">
+    <widget class="QCheckBox" name="kcfg_automultistreams">
      <property name="text">
-      <string>Transparent background for imported images</string>
+      <string>Automatically import all streams in multi stream clips</string>
      </property>
     </widget>
    </item>