// 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");
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");
*/
QDomElement effectInfo;
QMap<QString, QDomElement> effectsMap;
+ QMap<QString, QDomElement> videoEffectsMap;
+ QMap<QString, QDomElement> audioEffectsMap;
+
+ // Create transitions
for (int i = 0; i < MainWindow::transitions.count(); ++i) {
effectInfo = MainWindow::transitions.at(i);
effectsMap.insert(effectInfo.elementsByTagName("name").item(0).toElement().text().toLower().toUtf8().data(), effectInfo);
}
MainWindow::transitions.clearList();
foreach(const QDomElement & effect, effectsMap)
- MainWindow::transitions.append(effect);
+ MainWindow::transitions.append(effect);
effectsMap.clear();
+
+ // Create custom effects
for (int i = 0; i < MainWindow::customEffects.count(); ++i) {
effectInfo = MainWindow::customEffects.at(i);
effectsMap.insert(effectInfo.elementsByTagName("name").item(0).toElement().text().toLower().toUtf8().data(), effectInfo);
}
MainWindow::customEffects.clearList();
foreach(const QDomElement & effect, effectsMap)
- MainWindow::customEffects.append(effect);
+ MainWindow::customEffects.append(effect);
effectsMap.clear();
+
+ // Create effects from MLT
+ foreach(const QString & filtername, filtersList) {
+ QDomDocument doc = createDescriptionFromMlt(repository, "filters", filtername);
+ if (!doc.isNull()) {
+ //kDebug()<<"ADDING: "<<doc.documentElement().elementsByTagName("name").item(0).toElement().text().toLower().toUtf8().data();
+ if (doc.documentElement().attribute("type") == "audio") {
+ audioEffectsMap.insert(doc.documentElement().elementsByTagName("name").item(0).toElement().text().toLower().toUtf8().data(), doc.documentElement());
+ }
+ else
+ videoEffectsMap.insert(doc.documentElement().elementsByTagName("name").item(0).toElement().text().toLower().toUtf8().data(), doc.documentElement());
+ }
+ }
+
+ // Create audio effects
for (int i = 0; i < MainWindow::audioEffects.count(); ++i) {
effectInfo = MainWindow::audioEffects.at(i);
- effectsMap.insert(effectInfo.elementsByTagName("name").item(0).toElement().text().toLower().toUtf8().data(), effectInfo);
+ audioEffectsMap.insert(effectInfo.elementsByTagName("name").item(0).toElement().text().toLower().toUtf8().data(), effectInfo);
}
MainWindow::audioEffects.clearList();
- foreach(const QDomElement & effect, effectsMap)
- MainWindow::audioEffects.append(effect);
- effectsMap.clear();
+ foreach(const QDomElement & effect, audioEffectsMap)
+ MainWindow::audioEffects.append(effect);
+
+ // Create video effects
for (int i = 0; i < MainWindow::videoEffects.count(); ++i) {
effectInfo = MainWindow::videoEffects.at(i);
- effectsMap.insert(effectInfo.elementsByTagName("name").item(0).toElement().text().toLower().toUtf8().data(), effectInfo);
- }
- // Add remaining filters to the list of video effects.
- foreach(const QString & filtername, filtersList) {
- QDomDocument doc = createDescriptionFromMlt(repository, "filters", filtername);
- if (!doc.isNull())
- effectsMap.insert(doc.documentElement().elementsByTagName("name").item(0).toElement().text().toLower().toUtf8().data(), doc.documentElement());
+ videoEffectsMap.insert(effectInfo.elementsByTagName("name").item(0).toElement().text().toLower().toUtf8().data(), effectInfo);
}
MainWindow::videoEffects.clearList();
- foreach(const QDomElement & effect, effectsMap)
- MainWindow::videoEffects.append(effect);
+ foreach(const QDomElement & effect, videoEffectsMap)
+ MainWindow::videoEffects.append(effect);
return repository;
}
// a specific version of the filter is required
Mlt::Properties *metadata = repository->metadata(filter_type, tag.toUtf8().data());
if (metadata && metadata->is_valid()) {
- double version = atof(metadata->get("version"));
- if (documentElement.attribute("version").toDouble() > version)
+ double version = metadata->get_double("version");
+ if (documentElement.attribute("version").toDouble() > version) {
+ delete metadata;
return;
+ }
}
delete metadata;
}
- bool ladspaOk = true;
- if (tag == "ladspa") {
- QString library = documentElement.attribute("library", QString());
- if (KStandardDirs::locate("ladspa_plugin", library).isEmpty()) ladspaOk = false;
- }
-
// Parse effect information.
- if ((filtersList.contains(tag) || producersList.contains(tag)) && ladspaOk) {
+ if ((filtersList.contains(tag) || producersList.contains(tag))) {
QString type = documentElement.attribute("type", QString());
if (type == "audio")
audioEffectList->append(documentElement);
if (metadata && metadata->is_valid()) {
if (metadata->get("title") && metadata->get("identifier")) {
QDomElement eff = ret.createElement("effect");
- eff.setAttribute("tag", metadata->get("identifier"));
- eff.setAttribute("id", metadata->get("identifier"));
+ QString id = metadata->get("identifier");
+ eff.setAttribute("tag", id);
+ eff.setAttribute("id", id);
+ //kDebug()<<"Effect: "<<id;
QDomElement name = ret.createElement("name");
name.appendChild(ret.createTextNode(metadata->get("title")));
eff.appendChild(author);
eff.appendChild(desc);
+ Mlt::Properties tags((mlt_properties) metadata->get_data("tags"));
+ if (QString(tags.get(0)) == "Audio") eff.setAttribute("type", "audio");
+ /*for (int i = 0; i < tags.count(); i++)
+ kDebug()<<tags.get_name(i)<<"="<<tags.get(i);*/
+
Mlt::Properties param_props((mlt_properties) metadata->get_data("parameters"));
for (int j = 0; param_props.is_valid() && j < param_props.count(); j++) {
QDomElement params = ret.createElement("parameter");
if (paramdesc.get("maximum")) params.setAttribute("max", paramdesc.get("maximum"));
if (paramdesc.get("minimum")) params.setAttribute("min", paramdesc.get("minimum"));
- if (QString(paramdesc.get("type")) == "integer")
+
+ QString paramType = paramdesc.get("type");
+
+ if (paramType == "integer")
params.setAttribute("type", "constant");
- if (QString(paramdesc.get("type")) == "float") {
+ else if (paramType == "float") {
params.setAttribute("type", "constant");
- params.setAttribute("factor", "1000");
- if (paramdesc.get("maximum")) params.setAttribute("max", QString(paramdesc.get("maximum")).toFloat() * 1000.0);
- if (paramdesc.get("minimum")) params.setAttribute("min", QString(paramdesc.get("minimum")).toFloat() * 1000.0);
+ // param type is float, set default decimals to 3
+ params.setAttribute("decimals", "3");
}
- if (QString(paramdesc.get("type")) == "boolean")
+ else if (paramType == "boolean")
params.setAttribute("type", "bool");
- if (!QString(paramdesc.get("format")).isEmpty() && QString(paramdesc.get("type")) != "geometry") {
+ else if (paramType == "geometry") {
params.setAttribute("type", "geometry");
- params.setAttribute("format", paramdesc.get("format"));
}
- if (!QString(paramdesc.get("format")).isEmpty() && QString(paramdesc.get("type")) == "geometry") {
- params.setAttribute("type", "geometry");
- //params.setAttribute("format", paramdesc.get("format"));
+ else {
+ params.setAttribute("type", paramType);
+ if (!QString(paramdesc.get("format")).isEmpty()) params.setAttribute("format", paramdesc.get("format"));
}
if (paramdesc.get("default")) params.setAttribute("default", paramdesc.get("default"));
if (paramdesc.get("value")) {
params.setAttribute("value", paramdesc.get("default"));
}
-
QDomElement pname = ret.createElement("name");
pname.appendChild(ret.createTextNode(paramdesc.get("title")));
params.appendChild(pname);
}
delete metadata;
metadata = 0;
- /* QString outstr;
+ /*QString outstr;
QTextStream str(&outstr);
ret.save(str, 2);
kDebug() << outstr;*/
tname.appendChild(ret.createTextNode(i18n("Composite")));
desc.appendChild(ret.createTextNode(i18n("A key-framable alpha-channel compositor for two frames.")));
paramList.append(quickParameterFill(ret, i18n("Geometry"), "geometry", "geometry", "0%,0%:100%x100%:100", "-500;-500;-500;-500;0", "500;500;500;500;100"));
- paramList.append(quickParameterFill(ret, i18n("Alpha Channel Operation"), "operator", "list", "over", "", "", "over,and,or,xor", "over,and,or,xor"));
+ paramList.append(quickParameterFill(ret, i18n("Alpha Channel Operation"), "operator", "list", "over", "", "", "over,and,or,xor", i18n("Over,And,Or,Xor")));
paramList.append(quickParameterFill(ret, i18n("Align"), "aligned", "bool", "1", "0", "1"));
paramList.append(quickParameterFill(ret, i18n("Fill"), "fill", "bool", "1", "0", "1"));
paramList.append(quickParameterFill(ret, i18n("Distort"), "distort", "bool", "0", "0", "1"));
paramList.append(quickParameterFill(ret, i18n("Force Deinterlace Overlay"), "deinterlace", "bool", "0", "0", "1"));
} else if (name == "affine") {
tname.appendChild(ret.createTextNode(i18n("Affine")));
- paramList.append(quickParameterFill(ret, i18n("Rotate Y"), "rotate_y", "double", "0", "0", "360"));
+ ret.documentElement().setAttribute("showrotation", "1");
+ /*paramList.append(quickParameterFill(ret, i18n("Rotate Y"), "rotate_y", "double", "0", "0", "360"));
paramList.append(quickParameterFill(ret, i18n("Rotate X"), "rotate_x", "double", "0", "0", "360"));
paramList.append(quickParameterFill(ret, i18n("Rotate Z"), "rotate_z", "double", "0", "0", "360"));
paramList.append(quickParameterFill(ret, i18n("Fix Rotate Y"), "fix_rotate_y", "double", "0", "0", "360"));
paramList.append(quickParameterFill(ret, i18n("Fix Rotate Z"), "fix_rotate_z", "double", "0", "0", "360"));
paramList.append(quickParameterFill(ret, i18n("Shear Y"), "shear_y", "double", "0", "0", "360"));
paramList.append(quickParameterFill(ret, i18n("Shear X"), "shear_x", "double", "0", "0", "360"));
- paramList.append(quickParameterFill(ret, i18n("Shear Z"), "shear_z", "double", "0", "0", "360"));
+ paramList.append(quickParameterFill(ret, i18n("Shear Z"), "shear_z", "double", "0", "0", "360"));*/
+ /*paramList.append(quickParameterFill(ret, i18n("Fix Shear Y"), "fix_shear_y", "double", "0", "0", "360"));
+ paramList.append(quickParameterFill(ret, i18n("Fix Shear X"), "fix_shear_x", "double", "0", "0", "360"));
+ paramList.append(quickParameterFill(ret, i18n("Fix Shear Z"), "fix_shear_z", "double", "0", "0", "360"));*/
+
+ paramList.append(quickParameterFill(ret, "keyed", "keyed", "fixed", "1", "1", "1"));
+ paramList.append(quickParameterFill(ret, i18n("Geometry"), "geometry", "geometry", "0,0,100%,100%,100%", "0,0,100%,100%,100%", "0,0,100%,100%,100%", "", "", "", "", "", "true"));
+
+ paramList.append(quickParameterFill(ret, i18n("Rotate X"), "rotate_x", "addedgeometry", "0", "-1800", "1800", QString(), QString(), "10"));
+ paramList.append(quickParameterFill(ret, i18n("Rotate Y"), "rotate_y", "addedgeometry", "0", "-1800", "1800", QString(), QString(), "10"));
+ paramList.append(quickParameterFill(ret, i18n("Rotate Z"), "rotate_z", "addedgeometry", "0", "-1800", "1800", QString(), QString(), "10"));
+ /*paramList.append(quickParameterFill(ret, i18n("Rotate Y"), "rotate_y", "simplekeyframe", "0", "-1800", "1800", QString(), QString(), "10"));
+ paramList.append(quickParameterFill(ret, i18n("Rotate Z"), "rotate_z", "simplekeyframe", "0", "-1800", "1800", QString(), QString(), "10"));*/
+
paramList.append(quickParameterFill(ret, i18n("Fix Shear Y"), "fix_shear_y", "double", "0", "0", "360"));
paramList.append(quickParameterFill(ret, i18n("Fix Shear X"), "fix_shear_x", "double", "0", "0", "360"));
paramList.append(quickParameterFill(ret, i18n("Fix Shear Z"), "fix_shear_z", "double", "0", "0", "360"));
- paramList.append(quickParameterFill(ret, i18n("Geometry"), "geometry", "geometry", "0,0,100%,100%,100%", "0,0,100%,100%,100%", "0,0,100%,100%,100%", "", "", "", "", "", "false"));
} else if (name == "mix") {
tname.appendChild(ret.createTextNode(i18n("Mix")));
} else if (name == "region") {
desc.appendChild(ret.createTextNode(i18n("Use alpha channel of another clip to create a transition.")));
paramList.append(quickParameterFill(ret, i18n("Transparency clip"), "resource", "url", "", "", "", "", "", ""));
paramList.append(quickParameterFill(ret, i18n("Geometry"), "composite.geometry", "geometry", "0%,0%:100%x100%:100", "-500;-500;-500;-500;0", "500;500;500;500;100"));
- paramList.append(quickParameterFill(ret, i18n("Alpha Channel Operation"), "composite.operator", "list", "over", "", "", "over,and,or,xor", "over,and,or,xor"));
+ paramList.append(quickParameterFill(ret, i18n("Alpha Channel Operation"), "composite.operator", "list", "over", "", "", "over,and,or,xor", i18n("Over,And,Or,Xor")));
paramList.append(quickParameterFill(ret, i18n("Align"), "composite.aligned", "bool", "1", "0", "1"));
paramList.append(quickParameterFill(ret, i18n("Fill"), "composite.fill", "bool", "1", "0", "1"));
paramList.append(quickParameterFill(ret, i18n("Distort"), "composite.distort", "bool", "0", "0", "1"));