]> git.sesse.net Git - kdenlive/blob - src/kdenlivedoc.h
Implement clipmanager
[kdenlive] / src / kdenlivedoc.h
1 /***************************************************************************
2  *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
3  *                                                                         *
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.                                   *
8  *                                                                         *
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.                          *
13  *                                                                         *
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  ***************************************************************************/
19
20
21 #ifndef KDENLIVEDOC_H
22 #define KDENLIVEDOC_H
23
24 #include <qdom.h>
25 #include <qstring.h>
26 #include <qmap.h>
27 #include <QList>
28 #include <QObject>
29
30 #include <KUndoStack>
31 #include <kurl.h>
32
33 #include "gentime.h"
34 #include "timecode.h"
35 #include "renderer.h"
36 #include "clipmanager.h"
37
38 class KdenliveDoc:public QObject {
39   Q_OBJECT public:
40
41     KdenliveDoc(const KUrl &url, double fps, int width, int height, QWidget *parent = 0);
42     ~KdenliveDoc();
43     QString documentName();
44     QDomNodeList producersList();
45     double fps();
46     int width();
47     int height();
48     KUrl url();
49     void setProducers(QDomElement doc);
50     Timecode timecode();
51     QDomDocument toXml();
52     void setRenderer(Render *render);
53     KUndoStack *commandStack();
54     QString producerName(int id);
55     void setProducerDuration(int id, int duration);
56     int getProducerDuration(int id);
57     Render *renderer();
58     ClipManager *clipManager();
59     void addClip(const QDomElement &elem, const int clipId);
60     void slotAddClipFile(const KUrl url, const QString group);
61     void slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group);
62     void deleteClip(const uint clipId);
63     int getFramePos(QString duration);
64     DocClipBase *getBaseClip(int clipId);
65
66   private:
67     KUrl m_url;
68     QDomDocument m_document;
69     QString m_projectName;
70     double m_fps;
71     int m_width;
72     int m_height;
73     Timecode m_timecode;
74     Render *m_render;
75     KUndoStack *m_commandStack;
76     QDomDocument generateSceneList();
77     ClipManager *m_clipManager;
78
79   public slots:
80     
81   signals:
82     void addProjectClip(DocClipBase *);
83 };
84
85 #endif