#include <QInputDialog>
TrackView::TrackView(KdenliveDoc *doc, bool *ok, QWidget *parent) :
- QWidget(parent),
- m_scale(1.0),
- m_projectTracks(0),
- m_doc(doc),
- m_verticalZoom(1)
+ QWidget(parent),
+ m_scale(1.0),
+ m_projectTracks(0),
+ m_doc(doc),
+ m_verticalZoom(1)
{
setupUi(this);
}*/
// parse project tracks
- QDomElement tractor = doc.elementsByTagName("tractor").item(0).toElement();
- QDomNodeList tracks = doc.elementsByTagName("track");
+ QDomElement mlt = doc.firstChildElement("mlt");
+ QDomElement tractor = mlt.firstChildElement("tractor");
+ QDomNodeList tracks = tractor.elementsByTagName("track");
QDomNodeList playlists = doc.elementsByTagName("playlist");
int duration = 300;
m_projectTracks = tracks.count();
if (e.hasAttribute("in") == false && e.hasAttribute("out") == false) continue;
int in = e.attribute("in").toInt();
int out = e.attribute("out").toInt();
- if (in > out || in == out) {
+ if (in >= out) {
// invalid producer, remove it
QString id = e.attribute("id");
m_invalidProducers.append(id);
}
// parse transitions
- QDomNodeList transitions = doc.elementsByTagName("transition");
+ QDomNodeList transitions = tractor.elementsByTagName("transition");
//kDebug() << "//////////// TIMELINE FOUND: " << projectTransitions << " transitions";
for (int i = 0; i < transitions.count(); i++) {
}
}
+
+ QDomElement infoXml = mlt.firstChildElement("kdenlivedoc");
+
// Add guides
- QDomNodeList guides = doc.elementsByTagName("guide");
+ QDomNodeList guides = infoXml.elementsByTagName("guide");
for (int i = 0; i < guides.count(); i++) {
e = guides.item(i).toElement();
const QString comment = e.attribute("comment");
}
// Rebuild groups
- QDomNodeList groups = doc.elementsByTagName("group");
+ QDomNodeList groups = infoXml.elementsByTagName("group");
m_trackview->loadGroups(groups);
m_trackview->setDuration(duration);
kDebug() << "/////////// TOTAL PROJECT DURATION: " << duration;
// Remove Kdenlive extra info from xml doc before sending it to MLT
- QDomElement mlt = doc.firstChildElement("mlt");
- QDomElement infoXml = mlt.firstChildElement("kdenlivedoc");
mlt.removeChild(infoXml);
slotRebuildTrackHeaders();
void TrackView::slotAddProjectEffects(QDomNodeList effects, QDomElement parentNode, ClipItem *clip, int trackIndex)
{
+ int effectNb = 0;
for (int ix = 0; ix < effects.count(); ix++) {
bool disableeffect = false;
QDomElement effect = effects.at(ix).toElement();
if (effect.tagName() != "filter") continue;
-
+ effectNb++;
// add effect to clip
QString effecttag;
QString effectid;
- QString effectindex = QString::number(ix + 1);
+ QString effectindex = QString::number(effectNb);
QString ladspaEffectFile;
// Get effect tag & index
for (QDomNode n3 = effect.firstChild(); !n3.isNull(); n3 = n3.nextSibling()) {
}
// add first keyframe
if (effectout <= effectin) {
- // there is only one keyframe
+ // there is only one keyframe
keyframes.append(QString::number(effectin) + ':' + QString::number(startvalue) + ';');
} else keyframes.append(QString::number(effectin) + ':' + QString::number(startvalue) + ';' + QString::number(effectout) + ':' + QString::number(endvalue) + ';');
QDomNode lastParsedEffect;
currenteffect.setAttribute("src", ladspaEffectFile);
}
if (disableeffect) currenteffect.setAttribute("disable", "1");
- if (clip) clip->addEffect(currenteffect, false);
- else {
- kDebug() << "<< TRACK: " << trackIndex << ", adding effect";;
+ if (clip)
+ clip->addEffect(currenteffect, false);
+ else
m_doc->addTrackEffect(trackIndex, currenteffect);
- }
}
}
}