[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdenlive] src: We don't need an audio mix with black background track (spare 1 audio transition)
From:       Jean-Baptiste Mardelle <jb () kdenlive ! org>
Date:       2016-05-30 21:29:38
Message-ID: E1b7Ukk-0007M1-26 () scm ! kde ! org
[Download RAW message or body]

Git commit d1f78ac62ace9e6ea2ed12d41f089e3c499fac74 by Jean-Baptiste Mardelle.
Committed on 30/05/2016 at 21:29.
Pushed by mardelle into branch 'master'.

We don't need an audio mix with black background track (spare 1 audio transition)

M  +38   -35   src/doc/kdenlivedoc.cpp
M  +1    -1    src/timeline/timeline.cpp

http://commits.kde.org/kdenlive/d1f78ac62ace9e6ea2ed12d41f089e3c499fac74

diff --git a/src/doc/kdenlivedoc.cpp b/src/doc/kdenlivedoc.cpp
index 1196a6a..4c99508 100644
--- a/src/doc/kdenlivedoc.cpp
+++ b/src/doc/kdenlivedoc.cpp
@@ -465,44 +465,47 @@ QDomDocument KdenliveDoc::createEmptyDocument(const QList \
<TrackInfo> &tracks)  tractor.appendChild(track);
     }
 
+    // Transitions
     for (int i = 0; i < total; i++) {
-        QDomElement transition = doc.createElement(QStringLiteral("transition"));
-        transition.setAttribute(QStringLiteral("always_active"), \
                QStringLiteral("1"));
-
-        QDomElement property = doc.createElement(QStringLiteral("property"));
-        property.setAttribute(QStringLiteral("name"), \
                QStringLiteral("mlt_service"));
-        value = doc.createTextNode(QStringLiteral("mix"));
-        property.appendChild(value);
-        transition.appendChild(property);
-
-        property = doc.createElement(QStringLiteral("property"));
-        property.setAttribute(QStringLiteral("name"), QStringLiteral("a_track"));
-        QDomText value = doc.createTextNode(QStringLiteral("0"));
-        property.appendChild(value);
-        transition.appendChild(property);
-
-        property = doc.createElement(QStringLiteral("property"));
-        property.setAttribute(QStringLiteral("name"), QStringLiteral("b_track"));
-        value = doc.createTextNode(QString::number(i + 1));
-        property.appendChild(value);
-        transition.appendChild(property);
-
-        property = doc.createElement(QStringLiteral("property"));
-        property.setAttribute(QStringLiteral("name"), QStringLiteral("combine"));
-        value = doc.createTextNode(QStringLiteral("1"));
-        property.appendChild(value);
-        transition.appendChild(property);
-
-        property = doc.createElement(QStringLiteral("property"));
-        property.setAttribute(QStringLiteral("name"), \
                QStringLiteral("internal_added"));
-        value = doc.createTextNode(QStringLiteral("237"));
-        property.appendChild(value);
-        transition.appendChild(property);
-
-        tractor.appendChild(transition);
+        if (i > 0) {
+            QDomElement transition = \
doc.createElement(QStringLiteral("transition")); +            \
transition.setAttribute(QStringLiteral("always_active"), QStringLiteral("1")); +
+            QDomElement property = doc.createElement(QStringLiteral("property"));
+            property.setAttribute(QStringLiteral("name"), \
QStringLiteral("mlt_service")); +            value = \
doc.createTextNode(QStringLiteral("mix")); +            property.appendChild(value);
+            transition.appendChild(property);
+
+            property = doc.createElement(QStringLiteral("property"));
+            property.setAttribute(QStringLiteral("name"), \
QStringLiteral("a_track")); +            QDomText value = \
doc.createTextNode(QStringLiteral("1")); +            property.appendChild(value);
+            transition.appendChild(property);
+
+            property = doc.createElement(QStringLiteral("property"));
+            property.setAttribute(QStringLiteral("name"), \
QStringLiteral("b_track")); +            value = doc.createTextNode(QString::number(i \
+ 1)); +            property.appendChild(value);
+            transition.appendChild(property);
+
+            property = doc.createElement(QStringLiteral("property"));
+            property.setAttribute(QStringLiteral("name"), \
QStringLiteral("combine")); +            value = \
doc.createTextNode(QStringLiteral("1")); +            property.appendChild(value);
+            transition.appendChild(property);
+
+            property = doc.createElement(QStringLiteral("property"));
+            property.setAttribute(QStringLiteral("name"), \
QStringLiteral("internal_added")); +            value = \
doc.createTextNode(QStringLiteral("237")); +            property.appendChild(value);
+            transition.appendChild(property);
+
+            tractor.appendChild(transition);
+        }
         if (i >= lowerVideoTrack && tracks.at(i).type == VideoTrack) {
             // Only add composite transition if both tracks are video
-            transition = doc.createElement(QStringLiteral("transition"));
+            QDomElement transition = \
doc.createElement(QStringLiteral("transition"));  property = \
                doc.createElement(QStringLiteral("property"));
             property.setAttribute(QStringLiteral("name"), \
                QStringLiteral("mlt_service"));
             property.appendChild(doc.createTextNode(KdenliveSettings::gpu_accel() ? \
                "movit.overlay" : "frei0r.cairoblend"));
diff --git a/src/timeline/timeline.cpp b/src/timeline/timeline.cpp
index eb1e314..83ac70a 100644
--- a/src/timeline/timeline.cpp
+++ b/src/timeline/timeline.cpp
@@ -874,7 +874,7 @@ void Timeline::fixAudioMixing()
 
     // Re-add correct audio transitions
     // Find lowest track with audio
-    int minTrack = 0;
+    int minTrack = 1;
     for (int i = 1; i < m_tractor->count(); i++) {
         bool muted = track(i)->state() & 2;
         if (!muted) {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic