]> git.sesse.net Git - kdenlive/blobdiff - src/trackview.cpp
Properly disable bitrate combobox
[kdenlive] / src / trackview.cpp
index cdfd02fd6ad09b39111bd644ed80e49261640113..edabf94a03fced8d39eb86c7bc07e9d115349ffa 100644 (file)
@@ -718,8 +718,12 @@ void TrackView::slotAddProjectEffects(QDomNodeList effects, QDomElement parentNo
         //kDebug() << "+ + CLIP EFF FND: " << effecttag << ", " << effectid << ", " << effectindex;
         // get effect standard tags
         QDomElement clipeffect = MainWindow::customEffects.getEffectByTag(QString(), effectid);
-        if (clipeffect.isNull()) clipeffect = MainWindow::videoEffects.getEffectByTag(effecttag, effectid);
-        if (clipeffect.isNull()) clipeffect = MainWindow::audioEffects.getEffectByTag(effecttag, effectid);
+        if (clipeffect.isNull()) {
+            clipeffect = MainWindow::videoEffects.getEffectByTag(effecttag, effectid);
+        }
+        if (clipeffect.isNull()) {
+            clipeffect = MainWindow::audioEffects.getEffectByTag(effecttag, effectid);
+        }
         if (clipeffect.isNull()) {
             kDebug() << "///  WARNING, EFFECT: " << effecttag << ": " << effectid << " not found, removing it from project";
             m_documentErrors.append(i18n("Effect %1:%2 not found in MLT, it was removed from this project\n", effecttag, effectid));
@@ -828,27 +832,33 @@ void TrackView::slotAddProjectEffects(QDomNodeList effects, QDomElement parentNo
                 for (int k = 0; k < clipeffectparams.count(); k++) {
                     e = clipeffectparams.item(k).toElement();
                     if (!e.isNull() && e.tagName() == "parameter" && e.attribute("name") == paramname) {
-                        if (e.attribute("factor", "1") != "1") {
-                            QString factor = e.attribute("factor", "1");
-                            double fact;
-                            if (factor.startsWith('%')) {
-                                fact = ProfilesDialog::getStringEval(m_doc->mltProfile(), factor);
-                            } else fact = factor.toDouble();
-                            if (e.attribute("type") == "simplekeyframe") {
-                                QStringList kfrs = paramvalue.split(";");
-                                for (int l = 0; l < kfrs.count(); l++) {
-                                    QString fr = kfrs.at(l).section('=', 0, 0);
-                                    double val = kfrs.at(l).section('=', 1, 1).toDouble();
-                                    kfrs[l] = fr + ":" + QString::number((int)(val * fact));
-                                }
-                                e.setAttribute("keyframes", kfrs.join(";"));
-                            } else e.setAttribute("value", paramvalue.toDouble() * fact);
-                        } else e.setAttribute("value", paramvalue);
+                        QString factor = e.attribute("factor", "1");
+                        double fact;
+                        if (factor.startsWith('%')) {
+                            fact = ProfilesDialog::getStringEval(m_doc->mltProfile(), factor);
+                        } else {
+                            fact = factor.toDouble();
+                        }
+                        if (e.attribute("type") == "simplekeyframe") {
+                            QStringList kfrs = paramvalue.split(";");
+                            for (int l = 0; l < kfrs.count(); l++) {
+                                QString fr = kfrs.at(l).section('=', 0, 0);
+                                double val = kfrs.at(l).section('=', 1, 1).toDouble();
+                                kfrs[l] = fr + ":" + QString::number((int)(val * fact));
+                            }
+                            e.setAttribute("keyframes", kfrs.join(";"));
+                        } else {
+                            bool ok;
+                            e.setAttribute("value", paramvalue.toDouble(&ok) * fact);
+                            if (!ok)
+                                e.setAttribute("value", paramvalue);
+                        }
                         break;
                     }
                 }
             }
-            if (effecttag == "ladspa") {
+            // Old LADSPA filter, deprecated
+            /*if (effecttag == "ladspa") {
                 //QString ladspaEffectFile = EffectsList::parameter(effect, "src", "property");
 
                 if (!QFile::exists(ladspaEffectFile)) {
@@ -856,7 +866,8 @@ void TrackView::slotAddProjectEffects(QDomNodeList effects, QDomElement parentNo
                     initEffects::ladspaEffectFile(ladspaEffectFile, currenteffect.attribute("ladspaid").toInt(), m_trackview->getLadspaParams(currenteffect));
                 }
                 currenteffect.setAttribute("src", ladspaEffectFile);
-            }
+            }*/
+            
             if (disableeffect) currenteffect.setAttribute("disable", "1");
             if (clip)
                 clip->addEffect(currenteffect, false);