From 472606c9ae0785902dd1c431f68f2a57515734bc Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Wed, 19 Sep 2012 11:01:42 +0200 Subject: [PATCH] Add option to automatically import all clips in multi stream clips --- src/documentvalidator.cpp | 2 +- src/kdenlivesettings.kcfg | 5 +++ src/renderer.cpp | 22 +++++++++-- src/widgets/configmisc_ui.ui | 71 ++++++++++++++++++++---------------- 4 files changed, 63 insertions(+), 37 deletions(-) diff --git a/src/documentvalidator.cpp b/src/documentvalidator.cpp index 896d9cf6..a0775b5c 100644 --- a/src/documentvalidator.cpp +++ b/src/documentvalidator.cpp @@ -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); diff --git a/src/kdenlivesettings.kcfg b/src/kdenlivesettings.kcfg index 0a3bbaa5..16a0b8b5 100644 --- a/src/kdenlivesettings.kcfg +++ b/src/kdenlivesettings.kcfg @@ -55,6 +55,11 @@ false + + + false + + 00:00:05:00 diff --git a/src/renderer.cpp b/src/renderer.cpp index 51670b58..9f0b2b19 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -4511,7 +4511,22 @@ bool Render::getBlackMagicOutputDeviceList(KComboBox *devicelist) } void Render::slotMultiStreamProducerFound(const QString path, QList audio_list, QList 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 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: "<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 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); diff --git a/src/widgets/configmisc_ui.ui b/src/widgets/configmisc_ui.ui index 58560fcd..8f151efd 100644 --- a/src/widgets/configmisc_ui.ui +++ b/src/widgets/configmisc_ui.ui @@ -7,7 +7,7 @@ 0 0 380 - 320 + 345 @@ -24,21 +24,7 @@ - - - - Crash recovery (automatic backup) - - - - - - - Open projects in new tabs - - - - + Default Durations @@ -106,7 +92,7 @@ - + Qt::Vertical @@ -119,31 +105,31 @@ - - + + - Use KDE job tracking for render jobs + Automatically import image sequences - - + + - Use on-monitor effects + Check if first added clip matches project profile - - + + - Automatically import image sequences + Use on-monitor effects - - + + - Check if first added clip matches project profile + Transparent background for imported images @@ -154,6 +140,27 @@ + + + + Crash recovery (automatic backup) + + + + + + + Use KDE job tracking for render jobs + + + + + + + Open projects in new tabs + + + @@ -161,10 +168,10 @@ - - + + - Transparent background for imported images + Automatically import all streams in multi stream clips -- 2.39.2