From 0325ce2c0ce81ab5a097dd90f7495daa7608cc12 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Tue, 17 May 2011 16:02:00 +0000 Subject: [PATCH] Disable old LADSPA xml effects svn path=/trunk/kdenlive/; revision=5594 --- src/customtrackview.cpp | 20 +++++++++++++------- src/initeffects.cpp | 10 +++++++--- src/trackview.cpp | 6 ++++-- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index 1ce7d165..3d0d67e3 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -1706,11 +1706,14 @@ void CustomTrackView::slotAddGroupEffect(QDomElement effect, AbstractGroupItem * continue; } item->initEffect(effect); + + // Old LADSPA filter, deprecated + /* if (effect.attribute("tag") == "ladspa") { QString ladpsaFile = m_document->getLadspaFile(); initEffects::ladspaEffectFile(ladpsaFile, effect.attribute("ladspaid").toInt(), getLadspaParams(effect)); effect.setAttribute("src", ladpsaFile); - } + }*/ new AddEffectCommand(this, m_document->tracksCount() - item->track(), item->startPos(), effect, true, effectCommand); count++; } @@ -1783,12 +1786,13 @@ void CustomTrackView::slotAddEffect(QDomElement effect, GenTime pos, int track) } else { item->initEffect(effect); } - - if (effect.attribute("tag") == "ladspa") { + // Old LADSPA filter, deprecated + /* if (effect.attribute("tag") == "ladspa") { QString ladpsaFile = m_document->getLadspaFile(); initEffects::ladspaEffectFile(ladpsaFile, effect.attribute("ladspaid").toInt(), getLadspaParams(effect)); effect.setAttribute("src", ladpsaFile); } + */ new AddEffectCommand(this, m_document->tracksCount() - item->track(), item->startPos(), effect, true, effectCommand); } } @@ -1875,10 +1879,11 @@ void CustomTrackView::updateEffect(int track, GenTime pos, QDomElement insertedE if (pos < GenTime()) { // editing a track effect EffectsParameterList effectParams = getEffectArgs(effect); - if (effect.attribute("tag") == "ladspa") { + // Old LADSPA filter, deprecated + /*if (effect.attribute("tag") == "ladspa") { // Update the ladspa affect file initEffects::ladspaEffectFile(effect.attribute("src"), effect.attribute("ladspaid").toInt(), getLadspaParams(effect)); - } + }*/ // check if we are trying to reset a keyframe effect /*if (effectParams.hasParam("keyframes") && effectParams.paramValue("keyframes").isEmpty()) { clip->initEffect(effect); @@ -1914,10 +1919,11 @@ void CustomTrackView::updateEffect(int track, GenTime pos, QDomElement insertedE } EffectsParameterList effectParams = getEffectArgs(effect); - if (effect.attribute("tag") == "ladspa") { + // Old LADSPA filter, deprecated + /*if (effect.attribute("tag") == "ladspa") { // Update the ladspa affect file initEffects::ladspaEffectFile(effect.attribute("src"), effect.attribute("ladspaid").toInt(), getLadspaParams(effect)); - } + }*/ // check if we are trying to reset a keyframe effect if (effectParams.hasParam("keyframes") && effectParams.paramValue("keyframes").isEmpty()) { clip->initEffect(effect); diff --git a/src/initeffects.cpp b/src/initeffects.cpp index 0da445dd..50b6224a 100644 --- a/src/initeffects.cpp +++ b/src/initeffects.cpp @@ -185,6 +185,8 @@ Mlt::Repository *initEffects::parseEffectFiles() // Fill transitions list. fillTransitionsList(repository, &MainWindow::transitions, transitionsItemList); + //WARNING: deprecated, we now use MLT to detect LADSPA filters + /* // Set the directories to look into for ladspa plugins. KGlobal::dirs()->addResourceType("ladspa_plugin", 0, "lib/ladspa"); KGlobal::dirs()->addResourceDir("ladspa_plugin", "/usr/lib/ladspa"); @@ -192,7 +194,7 @@ Mlt::Repository *initEffects::parseEffectFiles() KGlobal::dirs()->addResourceDir("ladspa_plugin", "/opt/lib/ladspa"); KGlobal::dirs()->addResourceDir("ladspa_plugin", "/opt/local/lib/ladspa"); KGlobal::dirs()->addResourceDir("ladspa_plugin", "/usr/lib64/ladspa"); - KGlobal::dirs()->addResourceDir("ladspa_plugin", "/usr/local/lib64/ladspa"); + KGlobal::dirs()->addResourceDir("ladspa_plugin", "/usr/local/lib64/ladspa");*/ // Set the directories to look into for effects. QStringList direc = KGlobal::dirs()->findDirs("appdata", "effects"); @@ -354,8 +356,10 @@ void initEffects::parseEffectFile(EffectsList *customEffectList, EffectsList *au bool ladspaOk = true; if (tag == "ladspa") { - QString library = documentElement.attribute("library", QString()); - if (KStandardDirs::locate("ladspa_plugin", library).isEmpty()) ladspaOk = false; + //WARNING: old LADSPA xml effects are deprecated, so hide them + /*QString library = documentElement.attribute("library", QString()); + if (KStandardDirs::locate("ladspa_plugin", library).isEmpty()) ladspaOk = false;*/ + ladspaOk = false; } // Parse effect information. diff --git a/src/trackview.cpp b/src/trackview.cpp index 3b29f735..edabf94a 100644 --- a/src/trackview.cpp +++ b/src/trackview.cpp @@ -857,7 +857,8 @@ void TrackView::slotAddProjectEffects(QDomNodeList effects, QDomElement parentNo } } } - if (effecttag == "ladspa") { + // Old LADSPA filter, deprecated + /*if (effecttag == "ladspa") { //QString ladspaEffectFile = EffectsList::parameter(effect, "src", "property"); if (!QFile::exists(ladspaEffectFile)) { @@ -865,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); -- 2.39.2