if (effect.attribute("id") == "fadein") {
if (m_effectList.hasEffect(QString(), "fade_from_black") == -1) {
int effectDuration = EffectsList::parameter(effect, "out").toInt();
+ if (offset != 0) effectDuration -= offset - cropStart().frames(m_fps);
if (effectDuration > cropDuration().frames(m_fps)) {
effectDuration = cropDuration().frames(m_fps) / 2;
}
} else if (effect.attribute("id") == "fade_from_black") {
if (m_effectList.hasEffect(QString(), "fadein") == -1) {
int effectDuration = EffectsList::parameter(effect, "out").toInt();
+ if (offset != 0) effectDuration -= offset - cropStart().frames(m_fps);
if (effectDuration > cropDuration().frames(m_fps)) {
effectDuration = cropDuration().frames(m_fps) / 2;
}
// Update index to the real one
effect.setAttribute("kdenlive_ix", insertedEffect.attribute("kdenlive_ix"));
+ int effectIn;
+ int effectOut;
+
+ if (effect.attribute("tag") == "affine") {
+ // special case: the affine effect needs in / out points
+ effectIn = effect.attribute("in").toInt();
+ effectOut = effect.attribute("out").toInt();
+ }
+ else {
+ effectIn = EffectsList::parameter(effect, "in").toInt();
+ effectOut = EffectsList::parameter(effect, "out").toInt();
+ }
EffectsParameterList parameters;
parameters.addParam("tag", insertedEffect.attribute("tag"));
if (effectId.isEmpty()) effectId = insertedEffect.attribute("tag");
parameters.addParam("id", effectId);
- // special case: the affine effect needs in / out points
-
QDomNodeList params = insertedEffect.elementsByTagName("parameter");
int fade = 0;
bool needInOutSync = false;
+
+ // check if it is a fade effect
+ if (effectId == "fadein") {
+ needRepaint = true;
+ if (m_effectList.hasEffect(QString(), "fade_from_black") == -1) {
+ fade = effectOut - effectIn;
+ }/* else {
+ QDomElement fadein = m_effectList.getEffectByTag(QString(), "fade_from_black");
+ if (fadein.attribute("name") == "out") fade += fadein.attribute("value").toInt();
+ else if (fadein.attribute("name") == "in") fade -= fadein.attribute("value").toInt();
+ }*/
+ } else if (effectId == "fade_from_black") {
+ kDebug()<<"// FOUND FTB:"<<effectOut<<" - "<<effectIn;
+ needRepaint = true;
+ if (m_effectList.hasEffect(QString(), "fadein") == -1) {
+ fade = effectOut - effectIn;
+ }/* else {
+ QDomElement fadein = m_effectList.getEffectByTag(QString(), "fadein");
+ if (fadein.attribute("name") == "out") fade += fadein.attribute("value").toInt();
+ else if (fadein.attribute("name") == "in") fade -= fadein.attribute("value").toInt();
+ }*/
+ } else if (effectId == "fadeout") {
+ needRepaint = true;
+ if (m_effectList.hasEffect(QString(), "fade_to_black") == -1) {
+ fade = effectIn - effectOut;
+ } /*else {
+ QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fade_to_black");
+ if (fadeout.attribute("name") == "out") fade -= fadeout.attribute("value").toInt();
+ else if (fadeout.attribute("name") == "in") fade += fadeout.attribute("value").toInt();
+ }*/
+ } else if (effectId == "fade_to_black") {
+ needRepaint = true;
+ if (m_effectList.hasEffect(QString(), "fadeout") == -1) {
+ fade = effectIn - effectOut;
+ }/* else {
+ QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fadeout");
+ if (fadeout.attribute("name") == "out") fade -= fadeout.attribute("value").toInt();
+ else if (fadeout.attribute("name") == "in") fade += fadeout.attribute("value").toInt();
+ }*/
+ }
+
for (int i = 0; i < params.count(); i++) {
QDomElement e = params.item(i).toElement();
if (!e.isNull()) {
} else if (e.attribute("factor", "1") == "1" && e.attribute("offset", "0") == "0") {
parameters.addParam(e.attribute("name"), e.attribute("value"));
- // check if it is a fade effect
- if (effectId == "fadein") {
- needRepaint = true;
- if (m_effectList.hasEffect(QString(), "fade_from_black") == -1) {
- if (e.attribute("name") == "out") fade += e.attribute("value").toInt();
- else if (e.attribute("name") == "in") fade -= e.attribute("value").toInt();
- } else {
- QDomElement fadein = m_effectList.getEffectByTag(QString(), "fade_from_black");
- if (fadein.attribute("name") == "out") fade += fadein.attribute("value").toInt();
- else if (fadein.attribute("name") == "in") fade -= fadein.attribute("value").toInt();
- }
- } else if (effectId == "fade_from_black") {
- needRepaint = true;
- if (m_effectList.hasEffect(QString(), "fadein") == -1) {
- if (e.attribute("name") == "out") fade += e.attribute("value").toInt();
- else if (e.attribute("name") == "in") fade -= e.attribute("value").toInt();
- } else {
- QDomElement fadein = m_effectList.getEffectByTag(QString(), "fadein");
- if (fadein.attribute("name") == "out") fade += fadein.attribute("value").toInt();
- else if (fadein.attribute("name") == "in") fade -= fadein.attribute("value").toInt();
- }
- } else if (effectId == "fadeout") {
- needRepaint = true;
- if (m_effectList.hasEffect(QString(), "fade_to_black") == -1) {
- if (e.attribute("name") == "out") fade -= e.attribute("value").toInt();
- else if (e.attribute("name") == "in") fade += e.attribute("value").toInt();
- } else {
- QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fade_to_black");
- if (fadeout.attribute("name") == "out") fade -= fadeout.attribute("value").toInt();
- else if (fadeout.attribute("name") == "in") fade += fadeout.attribute("value").toInt();
- }
- } else if (effectId == "fade_to_black") {
- needRepaint = true;
- if (m_effectList.hasEffect(QString(), "fadeout") == -1) {
- if (e.attribute("name") == "out") fade -= e.attribute("value").toInt();
- else if (e.attribute("name") == "in") fade += e.attribute("value").toInt();
- } else {
- QDomElement fadeout = m_effectList.getEffectByTag(QString(), "fadeout");
- if (fadeout.attribute("name") == "out") fade -= fadeout.attribute("value").toInt();
- else if (fadeout.attribute("name") == "in") fade += fadeout.attribute("value").toInt();
- }
- }
} else {
double fact;
if (e.attribute("factor").contains('%')) {