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"
42 class KdenliveDoc: public QObject {
45 KdenliveDoc(const KUrl &url, const KUrl &projectFolder, MltVideoProfile profile, QUndoGroup *undoGroup, QWidget *parent = 0);
47 QDomNodeList producersList();
52 void backupMltPlaylist();
53 Timecode timecode() const;
54 QDomDocument toXml() const;
55 void setRenderer(Render *render);
56 KUndoStack *commandStack();
57 QString producerName(int id);
58 void setProducerDuration(int id, int duration);
59 int getProducerDuration(int id);
61 ClipManager *clipManager();
62 void addClip(const QDomElement &elem, const int clipId);
63 void addFolder(const QString foldername, int clipId, bool edit);
64 void deleteFolder(const QString foldername, int clipId);
65 void slotAddClipFile(const KUrl url, const QString group, const int groupId = -1);
66 void slotAddTextClipFile(const QString path, const QString group, const int groupId = -1);
67 void editTextClip(QString path, int id);
68 void slotAddFolder(const QString folderName);
69 void slotDeleteFolder(const QString folderName, const int id);
70 void slotEditFolder(const QString folderName, const QString oldfolderName, int clipId);
71 void slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group, const int groupId = -1);
72 void slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, bool loop, const QString group, const int groupId = -1);
73 void deleteClip(const uint clipId);
74 int getFramePos(QString duration);
75 DocClipBase *getBaseClip(int clipId);
76 void updateClip(int id);
77 void deleteProjectClip(QList <int> ids);
78 void deleteProjectFolder(QMap <QString, int> map);
79 /** Inform application of the audio thumbnails generation progress */
80 void setThumbsProgress(KUrl url, int progress);
81 QString profilePath() const;
82 QString description() const;
83 /** Returns the document format: PAL or NTSC */
84 QString getDocumentStandard();
85 void setUrl(KUrl url);
86 QDomElement documentInfoXml();
87 void setProfilePath(QString path);
88 /** Set to true if document needs saving, false otherwise */
89 void setModified(bool mod);
91 /** does the document need saving */
92 bool isModified() const;
93 /** Returns project folder, used to store project files (titles, effects,...) */
94 KUrl projectFolder() const;
98 QDomDocument m_document;
99 QString m_projectName;
105 KUndoStack *m_commandStack;
106 QDomDocument generateSceneList();
107 ClipManager *m_clipManager;
108 MltVideoProfile m_profile;
110 /** tells whether current doc has been changed since last save event */
112 /** Project folder, used to store project files (titles, effects,...) */
113 KUrl m_projectFolder;
116 void slotCreateTextClip(QString group, int groupId);
119 void addProjectClip(DocClipBase *);
120 void addProjectFolder(const QString, int, bool, bool edit = false);
121 void signalDeleteProjectClip(int);
122 void updateClipDisplay(int);
123 void deletTimelineClip(int);
124 void thumbsProgress(KUrl, int);
125 /** emited when the document state has been modified (= needs saving or not) */
126 void docModified(bool);
127 void refreshClipThumbnail(int);