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 ***************************************************************************/
36 #include "definitions.h"
43 class KdenliveDoc: public QObject {
46 KdenliveDoc(const KUrl &url, const KUrl &projectFolder, MltVideoProfile profile, QUndoGroup *undoGroup, MainWindow *parent = 0);
48 QDomNodeList producersList();
53 void backupMltPlaylist();
54 Timecode timecode() const;
55 QDomDocument toXml() const;
56 void setRenderer(Render *render);
57 KUndoStack *commandStack();
58 QString producerName(int id);
59 void setProducerDuration(int id, int duration);
60 int getProducerDuration(int id);
62 ClipManager *clipManager();
63 void addClip(const QDomElement &elem, const int clipId);
64 void addFolder(const QString foldername, int clipId, bool edit);
65 void deleteFolder(const QString foldername, int clipId);
66 void slotAddClipFile(const KUrl url, const QString group, const int groupId = -1);
67 void slotAddTextClipFile(const QString path, const QString group, const int groupId = -1);
68 void editTextClip(QString path, int id);
69 void slotAddFolder(const QString folderName);
70 void slotDeleteFolder(const QString folderName, const int id);
71 void slotEditFolder(const QString folderName, const QString oldfolderName, int clipId);
72 void slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group, const int groupId = -1);
73 void slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, bool loop, const QString group, const int groupId = -1);
74 void deleteClip(const uint clipId);
75 int getFramePos(QString duration);
76 DocClipBase *getBaseClip(int clipId);
77 void updateClip(int id);
78 void deleteProjectClip(QList <int> ids);
79 void deleteProjectFolder(QMap <QString, int> map);
80 /** Inform application of the audio thumbnails generation progress */
81 void setThumbsProgress(const QString &message, int progress);
82 QString profilePath() const;
83 QString description() const;
84 /** Returns the document format: PAL or NTSC */
85 QString getDocumentStandard();
86 void setUrl(KUrl url);
87 QDomElement documentInfoXml(QDomElement timelineInfo);
88 void setProfilePath(QString path);
89 /** Set to true if document needs saving, false otherwise */
90 void setModified(bool mod);
92 /** does the document need saving */
93 bool isModified() const;
94 /** Returns project folder, used to store project files (titles, effects,...) */
95 KUrl projectFolder() const;
96 /** Used to inform main app of the current document loading progress */
97 void loadingProgressed();
98 void updateAllProjectClips();
102 QDomDocument m_document;
103 QString m_projectName;
105 /** Cursor position at document opening */
111 KUndoStack *m_commandStack;
112 QDomDocument generateSceneList();
113 ClipManager *m_clipManager;
114 MltVideoProfile m_profile;
116 /** tells whether current doc has been changed since last save event */
118 /** Project folder, used to store project files (titles, effects,...) */
119 KUrl m_projectFolder;
120 double m_documentLoadingStep;
121 double m_documentLoadingProgress;
122 void convertDocument(double version);
125 void slotCreateTextClip(QString group, int groupId);
128 void addProjectClip(DocClipBase *);
129 void addProjectFolder(const QString, int, bool, bool edit = false);
130 void signalDeleteProjectClip(int);
131 void updateClipDisplay(int);
132 void deletTimelineClip(int);
133 void progressInfo(const QString &, int);
134 /** emited when the document state has been modified (= needs saving or not) */
135 void docModified(bool);
136 void refreshClipThumbnail(int);