if (height() > lowerLimit)
painter->fillRect(QRectF(rectInView.left(), lowerLimit, rectInView.width(), height() - lowerLimit), QBrush(base));
}
+
+QDomElement CustomTrackView::xmlInfo() {
+ QDomDocument doc;
+ QDomElement e;
+ QDomElement guides = doc.createElement("guides");
+ for (int i = 0; i < m_guides.count(); i++) {
+ e = doc.createElement("guide");
+ e.setAttribute("time", m_guides.at(i)->position().ms() / 1000);
+ e.setAttribute("comment", m_guides.at(i)->label());
+ guides.appendChild(e);
+ }
+ return guides;
+}
+
/*
void CustomTrackView::drawForeground ( QPainter * painter, const QRectF & rect )
{
void slotSeekToPreviousSnap();
void slotSeekToNextSnap();
double getSnapPointForPos(double pos);
+ QDomElement xmlInfo();
public slots:
void setCursorPos(int pos, bool seek = true);
void slotSwitchTrackVideo(int ix);
void slotUpdateClip(int clipId);
void slotAddClipMarker(int id, GenTime t, QString c);
+ void addGuide(const GenTime pos, const QString &comment);
void slotAddGuide();
void slotDeleteGuide();
void editGuide(const GenTime oldPos, const GenTime pos, const QString &comment);
/** Get the index of the video track that is just below current track */
int getPreviousVideoTrack(int track);
void updateClipFade(ClipItem * item, bool updateFadeOut = false);
- void addGuide(const GenTime pos, const QString &comment);
signals:
void cursorMoved(int, int);
//kDebug() << "///////////////// END CONVERTEDĀ DOC:";
}
-QDomElement KdenliveDoc::documentInfoXml() {
+QDomElement KdenliveDoc::documentInfoXml(QDomElement timelineInfo) {
QDomDocument doc;
QDomElement e;
QDomElement addedXml = doc.createElement("kdenlivedoc");
}
}
addedXml.appendChild(markers);
+ addedXml.appendChild(doc.importNode(timelineInfo, true));
//kDebug() << m_document.toString();
return addedXml;
}
/** Returns the document format: PAL or NTSC */
QString getDocumentStandard();
void setUrl(KUrl url);
- QDomElement documentInfoXml();
+ QDomElement documentInfoXml(QDomElement timelineInfo);
void setProfilePath(QString path);
/** Set to true if document needs saving, false otherwise */
void setModified(bool mod);
}
void MainWindow::saveFileAs(const QString &outputFileName) {
- m_projectMonitor->saveSceneList(outputFileName, m_activeDocument->documentInfoXml());
+ m_projectMonitor->saveSceneList(outputFileName, m_activeDocument->documentInfoXml(m_activeTimeline->projectView()->xmlInfo()));
m_activeDocument->setUrl(KUrl(outputFileName));
setCaption(m_activeDocument->description());
m_timelineArea->setTabText(m_timelineArea->currentIndex(), m_activeDocument->description());
}
}
+ // Add guides
+ QDomNodeList guides = doc.elementsByTagName("guide");
+ kDebug() << "//////////// OPENING PRJECT FILE, FOUND: " << guides.count() << " GUIDES$$$$$$$$$";
+ for (int i = 0; i < guides.count(); i++) {
+ e = guides.item(i).toElement();
+ const QString comment = e.attribute("comment");
+ const GenTime pos = GenTime(e.attribute("time").toDouble());
+ m_trackview->addGuide(pos, comment);
+ }
m_trackview->setDuration(duration);
kDebug() << "/////////// TOTAL PROJECT DURATION: " << duration;