1 /***************************************************************************
2 * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
21 #include <KStandardDirs>
22 #include <KMessageBox>
24 #include <KFileDialog>
25 #include <KIO/NetAccess>
26 #include <KApplication>
28 #include "kdenlivedoc.h"
29 #include "docclipbase.h"
30 #include "profilesdialog.h"
31 #include "kdenlivesettings.h"
33 #include "clipmanager.h"
34 #include "addfoldercommand.h"
35 #include "editfoldercommand.h"
36 #include "titlewidget.h"
37 #include "mainwindow.h"
40 KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, MltVideoProfile profile, QUndoGroup *undoGroup, MainWindow *parent): QObject(parent), m_render(NULL), m_url(url), m_projectFolder(projectFolder), m_profile(profile), m_fps((double)profile.frame_rate_num / profile.frame_rate_den), m_width(profile.width), m_height(profile.height), m_commandStack(new KUndoStack(undoGroup)), m_modified(false), m_documentLoadingProgress(0), m_documentLoadingStep(0.0), m_startPos(0), m_zoom(7) {
41 kDebug() << "// init profile, ratnum: " << profile.frame_rate_num << ", " << profile.frame_rate_num << ", width: " << profile.width;
42 m_clipManager = new ClipManager(this);
43 KdenliveSettings::setProject_fps(m_fps);
46 if (KIO::NetAccess::download(url.path(), tmpFile, parent)) {
48 m_document.setContent(&file, false);
50 QDomNode infoXmlNode = m_document.elementsByTagName("kdenlivedoc").at(0);
51 QDomNode westley = m_document.elementsByTagName("westley").at(0);
52 if (!infoXmlNode.isNull()) {
53 QDomElement infoXml = infoXmlNode.toElement();
54 QString profilePath = infoXml.attribute("profile");
55 m_startPos = infoXml.attribute("position").toInt();
56 m_zoom = infoXml.attribute("zoom", "7").toInt();
57 if (!profilePath.isEmpty()) setProfilePath(profilePath);
58 double version = infoXml.attribute("version").toDouble();
59 if (version < 0.7) convertDocument(version);
61 //delete all mlt producers and instead, use Kdenlive saved producers
62 QDomNodeList prods = m_document.elementsByTagName("producer");
63 int maxprod = prods.count();
65 for (int i = 0; i < maxprod; i++) {
66 QDomNode m = prods.at(pos);
67 QString prodId = m.toElement().attribute("id");
68 if (prodId == "black" || prodId.startsWith("slowmotion"))
70 else westley.removeChild(m);
72 prods = m_document.elementsByTagName("kdenlive_producer");
73 maxprod = prods.count();
74 for (int i = 0; i < maxprod; i++) {
75 prods.at(0).toElement().setTagName("producer");
76 westley.insertBefore(prods.at(0), QDomNode());
80 QDomNodeList producers = m_document.elementsByTagName("producer");
81 const int max = producers.count();
83 m_documentLoadingStep = 100.0 / (max + m_document.elementsByTagName("entry").count());
84 parent->slotGotProgressInfo(i18n("Loading project clips"), (int) m_documentLoadingProgress);
87 for (int i = 0; i < max; i++) {
88 e = producers.item(i).cloneNode().toElement();
89 if (m_documentLoadingStep > 0) {
90 m_documentLoadingProgress += m_documentLoadingStep;
91 parent->slotGotProgressInfo(QString(), (int) m_documentLoadingProgress);
92 qApp->processEvents();
94 QString prodId = e.attribute("id");
95 if (!e.isNull() && prodId != "black" && prodId.toInt() > 0) {
96 addClip(e, e.attribute("id").toInt());
100 QDomNode markers = m_document.elementsByTagName("markers").at(0);
101 if (!markers.isNull()) {
102 QDomNodeList markerslist = markers.childNodes();
103 int maxchild = markerslist.count();
104 for (int k = 0; k < maxchild; k++) {
105 e = markerslist.at(k).toElement();
106 if (e.tagName() == "marker") {
107 int id = e.attribute("id").toInt();
108 m_clipManager->getClipById(id)->addSnapMarker(GenTime(e.attribute("time").toDouble()), e.attribute("comment"));
111 m_document.removeChild(markers);
113 m_document.removeChild(infoXmlNode);
115 kDebug() << "Reading file: " << url.path() << ", found clips: " << producers.count();
116 } else kWarning() << " NO KDENLIVE INFO FOUND IN FILE: " << url.path();
117 KIO::NetAccess::removeTempFile(tmpFile);
119 KMessageBox::error(parent, KIO::NetAccess::lastErrorString());
122 // Creating new document
123 QDomElement westley = m_document.createElement("westley");
124 m_document.appendChild(westley);
126 QDomElement tractor = m_document.createElement("tractor");
127 tractor.setAttribute("id", "maintractor");
128 QDomElement multitrack = m_document.createElement("multitrack");
129 QDomElement playlist = m_document.createElement("playlist");
130 playlist.setAttribute("id", "black_track");
131 westley.appendChild(playlist);
137 int total = audiotracks + videotracks + 1;
139 for (int i = 1; i < total; i++) {
140 QDomElement playlist = m_document.createElement("playlist");
141 playlist.setAttribute("id", "playlist" + QString::number(i));
142 westley.appendChild(playlist);
145 QDomElement track0 = m_document.createElement("track");
146 track0.setAttribute("producer", "black_track");
147 tractor.appendChild(track0);
149 // create audio tracks
150 for (int i = 1; i < audiotracks + 1; i++) {
151 QDomElement track = m_document.createElement("track");
152 track.setAttribute("producer", "playlist" + QString::number(i));
153 track.setAttribute("hide", "video");
154 tractor.appendChild(track);
157 // create video tracks
158 for (int i = audiotracks + 1; i < total; i++) {
159 QDomElement track = m_document.createElement("track");
160 track.setAttribute("producer", "playlist" + QString::number(i));
161 tractor.appendChild(track);
164 for (uint i = 2; i < total ; i++) {
165 QDomElement transition = m_document.createElement("transition");
166 transition.setAttribute("always_active", "1");
168 QDomElement property = m_document.createElement("property");
169 property.setAttribute("name", "a_track");
170 QDomText value = m_document.createTextNode(QString::number(1));
171 property.appendChild(value);
172 transition.appendChild(property);
174 property = m_document.createElement("property");
175 property.setAttribute("name", "b_track");
176 value = m_document.createTextNode(QString::number(i));
177 property.appendChild(value);
178 transition.appendChild(property);
180 property = m_document.createElement("property");
181 property.setAttribute("name", "mlt_service");
182 value = m_document.createTextNode("mix");
183 property.appendChild(value);
184 transition.appendChild(property);
186 property = m_document.createElement("property");
187 property.setAttribute("name", "combine");
188 value = m_document.createTextNode("1");
189 property.appendChild(value);
190 transition.appendChild(property);
192 property = m_document.createElement("property");
193 property.setAttribute("name", "internal_added");
194 value = m_document.createTextNode("237");
195 property.appendChild(value);
196 transition.appendChild(property);
197 tractor.appendChild(transition);
199 westley.appendChild(tractor);
201 m_scenelist = m_document.toString();
202 kDebug() << "KDEnnlive document, init timecode: " << m_fps;
203 if (m_fps == 30000.0 / 1001.0) m_timecode.setFormat(30, true);
204 else m_timecode.setFormat((int) m_fps);
206 m_autoSaveTimer = new QTimer(this);
207 m_autoSaveTimer->setSingleShot(true);
208 QString directory = m_url.directory();
209 QString fileName = m_url.fileName();
210 m_recoveryUrl.setDirectory(directory);
211 m_recoveryUrl.setFileName("~" + fileName);
212 connect(m_autoSaveTimer, SIGNAL(timeout()), this, SLOT(slotAutoSave()));
215 KdenliveDoc::~KdenliveDoc() {
216 delete m_commandStack;
217 delete m_clipManager;
218 delete m_autoSaveTimer;
219 if (!m_url.isEmpty()) {
220 // remove backup file
221 if (KIO::NetAccess::exists(m_recoveryUrl, KIO::NetAccess::SourceSide, NULL))
222 KIO::NetAccess::del(m_recoveryUrl, NULL);
226 void KdenliveDoc::syncGuides(QList <Guide *> guides) {
230 m_guidesXml = doc.createElement("guides");
231 for (int i = 0; i < guides.count(); i++) {
232 e = doc.createElement("guide");
233 e.setAttribute("time", guides.at(i)->position().ms() / 1000);
234 e.setAttribute("comment", guides.at(i)->label());
235 m_guidesXml.appendChild(e);
239 void KdenliveDoc::slotAutoSave() {
241 m_render->saveSceneList(m_recoveryUrl.path(), documentInfoXml());
245 void KdenliveDoc::setZoom(int factor) {
249 int KdenliveDoc::zoom() const {
253 void KdenliveDoc::convertDocument(double version) {
254 // Opening a old Kdenlive document
255 QDomNode westley = m_document.elementsByTagName("westley").at(1);
256 QDomNode tractor = m_document.elementsByTagName("tractor").at(0);
257 QDomNode kdenlivedoc = m_document.elementsByTagName("kdenlivedoc").at(0);
258 QDomNode multitrack = m_document.elementsByTagName("multitrack").at(0);
259 QDomNodeList playlists = m_document.elementsByTagName("playlist");
261 m_startPos = kdenlivedoc.toElement().attribute("timeline_position").toInt();
263 QDomNode props = m_document.elementsByTagName("properties").at(0).toElement();
264 QString profile = props.toElement().attribute("videoprofile");
265 if (profile == "dv_wide") profile = "dv_pal_wide";
266 if (!profile.isEmpty()) {
267 setProfilePath(profile);
268 } else setProfilePath("dv_pal");
270 // move playlists outside of tractor and add the tracks instead
271 int max = playlists.count();
272 for (int i = 0; i < max; i++) {
273 QDomNode n = playlists.at(i);
274 westley.insertBefore(n, QDomNode());
275 QDomElement pl = n.toElement();
276 QDomElement track = m_document.createElement("track");
277 QString trackType = pl.attribute("hide");
278 if (!trackType.isEmpty()) track.setAttribute("hide", trackType);
279 QString playlist_id = pl.attribute("id");
280 if (playlist_id.isEmpty()) {
281 playlist_id = "black_track";
282 pl.setAttribute("id", playlist_id);
284 track.setAttribute("producer", playlist_id);
285 tractor.appendChild(track);
287 tractor.removeChild(multitrack);
289 // audio track mixing transitions should not be added to track view, so add required attribute
290 QDomNodeList transitions = m_document.elementsByTagName("transition");
291 max = transitions.count();
292 for (int i = 0; i < max; i++) {
293 QDomElement tr = transitions.at(i).toElement();
294 if (tr.attribute("combine") == "1" && tr.attribute("mlt_service") == "mix") {
295 QDomElement property = m_document.createElement("property");
296 property.setAttribute("name", "internal_added");
297 QDomText value = m_document.createTextNode("237");
298 property.appendChild(value);
299 tr.appendChild(property);
301 // convert transition
302 QDomNamedNodeMap attrs = tr.attributes();
303 for (unsigned int j = 0; j < attrs.count(); j++) {
304 QString attrName = attrs.item(j).nodeName();
305 if (attrName != "in" && attrName != "out" && attrName != "id") {
306 QDomElement property = m_document.createElement("property");
307 property.setAttribute("name", attrName);
308 QDomText value = m_document.createTextNode(attrs.item(j).nodeValue());
309 property.appendChild(value);
310 tr.appendChild(property);
316 // move transitions after tracks
317 for (int i = 0; i < max; i++) {
318 tractor.insertAfter(transitions.at(0), QDomNode());
321 QDomElement markers = m_document.createElement("markers");
323 // change producer names
324 QDomNodeList producers = m_document.elementsByTagName("producer");
325 max = producers.count();
326 for (int i = 0; i < max; i++) {
327 QDomElement prod = producers.at(0).toElement();
328 QDomNode m = prod.firstChild();
329 if (!m.isNull() && m.toElement().tagName() == "markers") {
330 QDomNodeList prodchilds = m.childNodes();
331 int maxchild = prodchilds.count();
332 for (int k = 0; k < maxchild; k++) {
333 QDomElement mark = prodchilds.at(0).toElement();
334 mark.setAttribute("id", prod.attribute("id"));
335 markers.insertAfter(mark, QDomNode());
339 int duration = prod.attribute("duration").toInt();
340 if (duration > 0) prod.setAttribute("out", QString::number(duration));
341 westley.insertBefore(prod, QDomNode());
344 QDomNode westley0 = m_document.elementsByTagName("westley").at(0);
345 if (!markers.firstChild().isNull()) westley0.appendChild(markers);
346 westley0.removeChild(kdenlivedoc);
348 QDomNodeList elements = westley.childNodes();
349 max = elements.count();
350 for (int i = 0; i < max; i++) {
351 QDomElement prod = elements.at(0).toElement();
352 westley0.insertAfter(prod, QDomNode());
355 westley0.removeChild(westley);
357 //kDebug() << "///////////////// CONVERTED DOC:";
358 //kDebug() << m_document.toString();
359 //kDebug() << "///////////////// END CONVERTED DOC:";
362 QDomElement KdenliveDoc::documentInfoXml() {
365 QDomElement addedXml = doc.createElement("kdenlivedoc");
366 QDomElement markers = doc.createElement("markers");
367 addedXml.setAttribute("version", "0.7");
368 addedXml.setAttribute("profile", profilePath());
369 addedXml.setAttribute("position", m_render->seekPosition().frames(m_fps));
370 addedXml.setAttribute("zoom", m_zoom);
371 QList <DocClipBase*> list = m_clipManager->documentClipList();
372 for (int i = 0; i < list.count(); i++) {
373 e = list.at(i)->toXML();
374 e.setTagName("kdenlive_producer");
375 addedXml.appendChild(doc.importNode(e, true));
376 QList < CommentedTime > marks = list.at(i)->commentedSnapMarkers();
377 for (int j = 0; j < marks.count(); j++) {
378 QDomElement marker = doc.createElement("marker");
379 marker.setAttribute("time", marks.at(j).time().ms() / 1000);
380 marker.setAttribute("comment", marks.at(j).comment());
381 marker.setAttribute("id", e.attribute("id"));
382 markers.appendChild(marker);
385 addedXml.appendChild(markers);
386 if (!m_guidesXml.isNull()) addedXml.appendChild(doc.importNode(m_guidesXml, true));
387 //kDebug() << m_document.toString();
392 ClipManager *KdenliveDoc::clipManager() {
393 return m_clipManager;
396 KUrl KdenliveDoc::projectFolder() const {
397 if (m_projectFolder.isEmpty()) return KUrl(KStandardDirs::locateLocal("appdata", "/projects/"));
398 return m_projectFolder;
401 QString KdenliveDoc::getDocumentStandard() {
402 //WARNING: this way to tell the video standard is a bit hackish...
403 if (m_profile.description.contains("pal", Qt::CaseInsensitive) || m_profile.description.contains("25", Qt::CaseInsensitive) || m_profile.description.contains("50", Qt::CaseInsensitive)) return "PAL";
407 QString KdenliveDoc::profilePath() const {
408 return m_profile.path;
411 void KdenliveDoc::setProfilePath(QString path) {
412 KdenliveSettings::setCurrent_profile(path);
413 m_profile = ProfilesDialog::getVideoProfile(path);
414 m_fps = (double) m_profile.frame_rate_num / m_profile.frame_rate_den;
415 m_width = m_profile.width;
416 m_height = m_profile.height;
417 KdenliveSettings::setProject_fps(m_fps);
418 kDebug() << "KDEnnlive document, init timecode from path: " << path << ", " << m_fps;
419 if (m_fps == 30000.0 / 1001.0) m_timecode.setFormat(30, true);
420 else m_timecode.setFormat((int) m_fps);
423 void KdenliveDoc::setThumbsProgress(const QString &message, int progress) {
424 emit progressInfo(message, progress);
427 void KdenliveDoc::loadingProgressed() {
428 m_documentLoadingProgress += m_documentLoadingStep;
429 emit progressInfo(QString(), (int) m_documentLoadingProgress);
432 KUndoStack *KdenliveDoc::commandStack() {
433 return m_commandStack;
436 void KdenliveDoc::setRenderer(Render *render) {
438 emit progressInfo(i18n("Loading playlist..."), 0);
439 qApp->processEvents();
440 if (m_render) m_render->setSceneList(m_scenelist, m_startPos);
441 emit progressInfo(QString(), -1);
444 Render *KdenliveDoc::renderer() {
448 void KdenliveDoc::updateClip(int id) {
449 emit updateClipDisplay(id);
452 void KdenliveDoc::updateAllProjectClips() {
453 QList <DocClipBase*> list = m_clipManager->documentClipList();
454 for (int i = 0; i < list.count(); i++)
455 emit updateClipDisplay(list.at(i)->getId());
458 int KdenliveDoc::getFramePos(QString duration) {
459 return m_timecode.getFrameCount(duration, m_fps);
462 QString KdenliveDoc::producerName(int id) {
463 QString result = "unnamed";
464 QDomNodeList prods = producersList();
465 int ct = prods.count();
466 for (int i = 0; i < ct ; i++) {
467 QDomElement e = prods.item(i).toElement();
468 if (e.attribute("id") != "black" && e.attribute("id").toInt() == id) {
469 result = e.attribute("name");
470 if (result.isEmpty()) result = KUrl(e.attribute("resource")).fileName();
477 void KdenliveDoc::setProducerDuration(int id, int duration) {
478 QDomNodeList prods = producersList();
479 int ct = prods.count();
480 for (int i = 0; i < ct ; i++) {
481 QDomElement e = prods.item(i).toElement();
482 if (e.attribute("id") != "black" && e.attribute("id").toInt() == id) {
483 e.setAttribute("duration", QString::number(duration));
489 int KdenliveDoc::getProducerDuration(int id) {
491 QDomNodeList prods = producersList();
492 int ct = prods.count();
493 for (int i = 0; i < ct ; i++) {
494 QDomElement e = prods.item(i).toElement();
495 if (e.attribute("id") != "black" && e.attribute("id").toInt() == id) {
496 result = e.attribute("duration").toInt();
504 QDomDocument KdenliveDoc::generateSceneList() {
506 QDomElement westley = doc.createElement("westley");
507 doc.appendChild(westley);
508 QDomElement prod = doc.createElement("producer");
511 QDomDocument KdenliveDoc::toXml() const {
515 Timecode KdenliveDoc::timecode() const {
519 QDomNodeList KdenliveDoc::producersList() {
520 return m_document.elementsByTagName("producer");
523 void KdenliveDoc::backupMltPlaylist() {
524 if (m_render) m_scenelist = m_render->sceneList();
527 double KdenliveDoc::fps() const {
531 int KdenliveDoc::width() const {
535 int KdenliveDoc::height() const {
539 KUrl KdenliveDoc::url() const {
543 void KdenliveDoc::setUrl(KUrl url) {
545 QString directory = m_url.directory();
546 QString fileName = m_url.fileName();
547 m_recoveryUrl.setDirectory(directory);
548 m_recoveryUrl.setFileName("~" + fileName);
551 void KdenliveDoc::setModified(bool mod) {
552 if (!m_url.isEmpty() && mod && KdenliveSettings::crashrecovery()) {
553 m_autoSaveTimer->start(3000);
555 if (mod == m_modified) return;
557 emit docModified(m_modified);
560 bool KdenliveDoc::isModified() const {
564 QString KdenliveDoc::description() const {
566 return i18n("Untitled") + " / " + m_profile.description;
568 return m_url.fileName() + " / " + m_profile.description;
571 void KdenliveDoc::addClip(const QDomElement &elem, const int clipId) {
572 DocClipBase *clip = new DocClipBase(m_clipManager, elem, clipId);
573 kDebug() << "///////// DOCUM, CREATING NEW CLIP, ID:" << clipId << ", PAR ID:" << elem.attribute("groupid");
574 m_clipManager->addClip(clip);
575 emit addProjectClip(clip);
578 void KdenliveDoc::addFolder(const QString foldername, int clipId, bool edit) {
579 emit addProjectFolder(foldername, clipId, false, edit);
582 void KdenliveDoc::deleteFolder(const QString foldername, int clipId) {
583 emit addProjectFolder(foldername, clipId, true);
586 void KdenliveDoc::deleteProjectClip(QList <int> ids) {
587 for (int i = 0; i < ids.size(); ++i) {
588 emit deletTimelineClip(ids.at(i));
589 m_clipManager->slotDeleteClip(ids.at(i));
594 void KdenliveDoc::deleteProjectFolder(QMap <QString, int> map) {
595 QMapIterator<QString, int> i(map);
596 while (i.hasNext()) {
598 slotDeleteFolder(i.key(), i.value());
603 void KdenliveDoc::deleteClip(const uint clipId) {
604 emit signalDeleteProjectClip(clipId);
605 m_clipManager->deleteClip(clipId);
608 void KdenliveDoc::slotAddClipFile(const KUrl url, const QString group, const int groupId) {
609 kDebug() << "///////// DOCUM, ADD CLP: " << url;
610 m_clipManager->slotAddClipFile(url, group, groupId);
614 void KdenliveDoc::slotAddTextClipFile(const QString path, const QString xml, const QString group, const int groupId) {
615 kDebug() << "///////// DOCUM, ADD TXT CLP: " << path;
616 m_clipManager->slotAddTextClipFile(path, xml, group, groupId);
620 void KdenliveDoc::slotAddFolder(const QString folderName) {
621 AddFolderCommand *command = new AddFolderCommand(this, folderName, m_clipManager->getFreeClipId(), true);
622 commandStack()->push(command);
626 void KdenliveDoc::slotDeleteFolder(const QString folderName, const int id) {
627 AddFolderCommand *command = new AddFolderCommand(this, folderName, id, false);
628 commandStack()->push(command);
632 void KdenliveDoc::slotEditFolder(const QString newfolderName, const QString oldfolderName, int clipId) {
633 EditFolderCommand *command = new EditFolderCommand(this, newfolderName, oldfolderName, clipId, false);
634 commandStack()->push(command);
638 int KdenliveDoc::getFreeClipId() {
639 return m_clipManager->getFreeClipId();
642 DocClipBase *KdenliveDoc::getBaseClip(int clipId) {
643 return m_clipManager->getClipById(clipId);
646 void KdenliveDoc::slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group, const int groupId) {
647 m_clipManager->slotAddColorClipFile(name, color, duration, group, groupId);
651 void KdenliveDoc::slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, const bool loop, const bool fade, const QString &luma_duration, const QString &luma_file, const int softness, const QString group, const int groupId) {
652 m_clipManager->slotAddSlideshowClipFile(name, path, count, duration, loop, fade, luma_duration, luma_file, softness, group, groupId);
656 void KdenliveDoc::slotCreateTextClip(QString group, int groupId) {
657 QString titlesFolder = projectFolder().path() + "/titles/";
658 KStandardDirs::makeDir(titlesFolder);
659 TitleWidget *dia_ui = new TitleWidget(KUrl(), titlesFolder, m_render, kapp->activeWindow());
660 if (dia_ui->exec() == QDialog::Accepted) {
661 QString titleName = "title";
663 QString path = titlesFolder + titleName + QString::number(counter).rightJustified(3, '0', false);
664 while (QFile::exists(path + ".kdenlivetitle")) {
666 path = titlesFolder + titleName + QString::number(counter).rightJustified(3, '0', false);
668 QPixmap pix = dia_ui->renderedPixmap();
669 pix.save(path + ".png");
670 //dia_ui->saveTitle(path + ".kdenlivetitle");
671 slotAddTextClipFile(path, dia_ui->xml().toString(), QString(), -1);
676 void KdenliveDoc::editTextClip(QString path, int id) {
677 DocClipBase *clip = m_clipManager->getClipById(id);
679 TitleWidget *dia_ui = new TitleWidget(KUrl()/*path + ".kdenlivetitle")*/, path, m_render, kapp->activeWindow());
681 doc.setContent(clip->getProperty("xmldata"));
683 if (dia_ui->exec() == QDialog::Accepted) {
684 QPixmap pix = dia_ui->renderedPixmap();
685 pix.save(path + ".png");
686 //dia_ui->saveTitle(path + ".kdenlivetitle");
687 //slotAddClipFile(KUrl("/tmp/kdenlivetitle.png"), QString(), -1);
688 emit refreshClipThumbnail(id);
694 #include "kdenlivedoc.moc"