void ClipItem::setKeyframes(const int ix, const QString keyframes)
{
QDomElement effect = getEffectAt(ix);
- if (effect.attribute("disabled") == "1") return;
+ if (effect.attribute("disable") == "1") return;
QDomNodeList params = effect.elementsByTagName("parameter");
for (int i = 0; i < params.count(); i++) {
QDomElement e = params.item(i).toElement();
QDomElement effect = effectAt(m_selectedEffect);
if (effect.isNull() == false) {
QDomNodeList params = effect.elementsByTagName("parameter");
- if (effect.attribute("disabled") != "1")
+ if (effect.attribute("disable") != "1")
for (int i = 0; i < params.count(); i++) {
QDomElement e = params.item(i).toElement();
if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe")) {
{
// regenerate xml parameter from the clip keyframes
QDomElement effect = getEffectAt(m_selectedEffect);
- if (effect.attribute("disabled") == "1") return;
+ if (effect.attribute("disable") == "1") return;
QDomNodeList params = effect.elementsByTagName("parameter");
for (int i = 0; i < params.count(); i++) {
parameters.addParam("tag", effect.attribute("tag"));
parameters.addParam("kdenlive_ix", effect.attribute("kdenlive_ix"));
if (effect.hasAttribute("src")) parameters.addParam("src", effect.attribute("src"));
- if (effect.hasAttribute("disabled")) parameters.addParam("disabled", effect.attribute("disabled"));
+ if (effect.hasAttribute("disable")) parameters.addParam("disable", effect.attribute("disable"));
QString effectId = effect.attribute("id");
parameters.addParam("kdenlive_ix", effect.attribute("kdenlive_ix"));
parameters.addParam("id", effect.attribute("id"));
if (effect.hasAttribute("src")) parameters.addParam("src", effect.attribute("src"));
- if (effect.hasAttribute("disabled")) parameters.addParam("disabled", effect.attribute("disabled"));
+ if (effect.hasAttribute("disable")) parameters.addParam("disable", effect.attribute("disable"));
QDomNodeList params = effect.elementsByTagName("parameter");
for (int i = 0; i < params.count(); i++) {
void ClipItem::insertKeyframe(QDomElement effect, int pos, int val)
{
- if (effect.attribute("disabled") == "1") return;
+ if (effect.attribute("disable") == "1") return;
effect.setAttribute("active_keyframe", pos);
m_editedKeyframe = pos;
QDomNodeList params = effect.elementsByTagName("parameter");
void ClipItem::movedKeyframe(QDomElement effect, int oldpos, int newpos, double value)
{
- if (effect.attribute("disabled") == "1") return;
+ if (effect.attribute("disable") == "1") return;
effect.setAttribute("active_keyframe", newpos);
QDomNodeList params = effect.elementsByTagName("parameter");
int start = cropStart().frames(m_fps);
return;
}
EffectsParameterList params = clip->addEffect(effect);
- if (effect.attribute("disabled") == "1") {
- // Effect is disabled, don't add it to MLT playlist
- if (clip->isSelected()) emit clipItemSelected(clip);
- return;
- }
if (!m_document->renderer()->mltAddEffect(track, pos, params))
emit displayMessage(i18n("Problem adding effect to clip"), ErrorMessage);
if (clip->isSelected()) emit clipItemSelected(clip);
return;
}
}
- if (!m_document->renderer()->mltRemoveEffect(track, pos, index, true) && effect.attribute("disabled") != "1") {
- kDebug() << "// ERROR REMOV EFFECT: " << index << ", DISABLE: " << effect.attribute("disabled");
+ if (!m_document->renderer()->mltRemoveEffect(track, pos, index, true)) {
+ kDebug() << "// ERROR REMOV EFFECT: " << index << ", DISABLE: " << effect.attribute("disable");
emit displayMessage(i18n("Problem deleting effect"), ErrorMessage);
return;
}
if (clip) {
// Special case: speed effect
if (effect.attribute("id") == "speed") {
- if (effect.attribute("disabled") == "1") doChangeClipSpeed(clip->info(), clip->speedIndependantInfo(), 1.0, clip->speed(), 1, clip->baseClip()->getId());
+ if (effect.attribute("disable") == "1") doChangeClipSpeed(clip->info(), clip->speedIndependantInfo(), 1.0, clip->speed(), 1, clip->baseClip()->getId());
else {
double speed = EffectsList::parameter(effect, "speed").toDouble() / 100.0;
int strobe = EffectsList::parameter(effect, "strobe").toInt();
clip->initEffect(effect);
effectParams = clip->getEffectArgs(effect);
}
- if (effectParams.paramValue("disabled") == "1") {
- if (m_document->renderer()->mltRemoveEffect(track, pos, effectParams.paramValue("kdenlive_ix"), false)) {
- kDebug() << "////// DISABLING EFFECT: " << ix << ", CURRENTLA: " << clip->selectedEffectIndex();
- } else emit displayMessage(i18n("Problem deleting effect"), ErrorMessage);
- } else if (!m_document->renderer()->mltEditEffect(m_document->tracksCount() - clip->track(), clip->startPos(), effectParams))
+ if (!m_document->renderer()->mltEditEffect(m_document->tracksCount() - clip->track(), clip->startPos(), effectParams))
emit displayMessage(i18n("Problem editing effect"), ErrorMessage);
clip->setEffectAt(ix, effect);
QDomElement effect = clip->effectAt(effectPos);
QDomElement oldEffect = effect.cloneNode().toElement();
- effect.setAttribute("disabled", (int) disable);
+ effect.setAttribute("disable", (int) disable);
EditEffectCommand *command = new EditEffectCommand(this, m_document->tracksCount() - clip->track(), clip->startPos(), oldEffect, effect, effectPos, true);
m_commandStack->push(command);
setDocumentModified();;
m_ui.buttonReset->setEnabled(!disable);
int activeRow = m_ui.effectlist->currentRow();
if (activeRow >= 0) {
- m_effectedit->updateParameter("disabled", QString::number((int) disable));
+ m_effectedit->updateParameter("disable", QString::number((int) disable));
emit changeEffectState(m_clipref, activeRow, disable);
}
}
item = new QListWidgetItem(videoIcon, i18n(namenode.toElement().text().toUtf8().data()), m_ui.effectlist);
}
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
- if (d.attribute("disabled") == "1") item->setCheckState(Qt::Unchecked);
+ if (d.attribute("disable") == "1") item->setCheckState(Qt::Unchecked);
else item->setCheckState(Qt::Checked);
}
}
// parse clip effects
QDomNodeList effects = elem.childNodes();
for (int ix = 0; ix < effects.count(); ix++) {
+ bool disableeffect = false;
QDomElement effect = effects.at(ix).toElement();
if (effect.tagName() == "filter") {
// add effect to clip
effecttag = effectparam.text();
} else if (effectparam.attribute("name") == "kdenlive_id") {
effectid = effectparam.text();
+ } else if (effectparam.attribute("name") == "disable" && effectparam.text().toInt() == 1) {
+ // Fix effects index
+ disableeffect = true;
} else if (effectparam.attribute("name") == "kdenlive_ix") {
// Fix effects index
effectparam.firstChild().setNodeValue(effectindex);
}
currenteffect.setAttribute("src", ladspaEffectFile);
}
+ if (disableeffect) currenteffect.setAttribute("disable", "1");
item->addEffect(currenteffect, false);
}
}