]> git.sesse.net Git - kdenlive/commitdiff
Fix some MLT effects (Mono to Stereo was showing twice the "To" param)
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 16 Feb 2013 20:04:02 +0000 (21:04 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sat, 16 Feb 2013 20:04:38 +0000 (21:04 +0100)
data/blacklisted_effects.txt
effects/channelcopy.xml
src/initeffects.cpp

index 276248f31e47bc31de209972063a944a0ff2f900..d54044bcaed2f0d7bbae20643b4cfa5818e963f4 100644 (file)
@@ -75,6 +75,8 @@ frei0r.vignette
 
 
 #MLT effects with XML UI
+channelcopy
+crop
 dust
 grain
 lines
@@ -82,10 +84,8 @@ oldfilm
 tcolor
 rotoscoping
 wave
-volume
 vignette
-crop
-
+volume
 
 #Effects not usable with a simple GUI
 sox
index 9223899d96c9b8212f2d7aab1e1a7d08ea7a5e84..ca96a7934ff6f34edb0a8b9d7583d5142c9cbb63 100644 (file)
@@ -1,5 +1,5 @@
 <!DOCTYPE kpartgui>
- <effect tag="channelcopy" id="channelcopy" type="audio">
+ <effect tag="channelcopy" id="stereocopy" type="audio">
          <name>Mono to stereo</name>
          <description>Copy one channel to another</description>
          <author>Dan Dennedy</author>
index d7a190d3284dec864adb4c2490181d78fc23bb12..df29192a01f90ca80bc92d0e97a602407873c7ae 100644 (file)
@@ -200,8 +200,10 @@ void initEffects::parseEffectFiles(const QString &locale)
         while (!in.atEnd()) {
             QString black = in.readLine().simplified();
             if (!black.isEmpty() && !black.startsWith('#') &&
-                    mltFiltersList.contains(black))
+                    mltFiltersList.contains(black)) {
                 mltFiltersList.removeAll(black);
+           }
+           
         }
         file2.close();
     }
@@ -242,7 +244,9 @@ void initEffects::parseEffectFiles(const QString &locale)
                     if (desc.startsWith("Process audio using a SoX")) {
                         // Remove MLT's SOX generated effects since the parameters properties are unusable for us
                     }
-                    else audioEffectsMap.insert(doc.documentElement().firstChildElement("name").text().toLower().toUtf8().data(), doc.documentElement());
+                    else {
+                       audioEffectsMap.insert(doc.documentElement().firstChildElement("name").text().toLower().toUtf8().data(), doc.documentElement());
+                   }
                 }
             }
             else
@@ -481,16 +485,23 @@ QDomDocument initEffects::createDescriptionFromMlt(Mlt::Repository* repository,
                 QDomElement params = ret.createElement("parameter");
 
                 Mlt::Properties paramdesc((mlt_properties) param_props.get_data(param_props.get_name(j)));
-
                 params.setAttribute("name", paramdesc.get("identifier"));
+               if (params.attribute("name") == "argument") {
+                   // This parameter has to be given as attribute when using command line, do not show it in Kdenlive
+                   continue;
+               }
 
                 if (paramdesc.get("maximum")) params.setAttribute("max", paramdesc.get("maximum"));
                 if (paramdesc.get("minimum")) params.setAttribute("min", paramdesc.get("minimum"));
 
                 QString paramType = paramdesc.get("type");
                 
-                if (paramType == "integer")
-                    params.setAttribute("type", "constant");
+                if (paramType == "integer") {
+                   if (params.attribute("min") == "0" && params.attribute("max") == "1")
+                       params.setAttribute("type", "bool");
+                    else params.setAttribute("type", "constant");
+                   
+               }
                 else if (paramType == "float") {
                     params.setAttribute("type", "constant");
                     // param type is float, set default decimals to 3