kdenlivedoc.h 3.94 KB
Newer Older
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
1
/***************************************************************************
2
 *   Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org)        *
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
3 4 5 6 7 8
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
9 10 11 12 13 14 15 16 17
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
18 19
 ***************************************************************************/

20

Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
21 22 23 24 25 26 27 28
#ifndef KDENLIVEDOC_H
#define KDENLIVEDOC_H

#include <qdom.h>
#include <qstring.h>
#include <qmap.h>
#include <QList>
#include <QObject>
29
#include <QUndoGroup>
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
30

31
#include <KUndoStack>
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
32 33 34
#include <kurl.h>

#include "gentime.h"
35
#include "timecode.h"
36
#include "renderer.h"
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
37
#include "clipmanager.h"
38
#include "definitions.h"
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
39

40 41
class KdenliveDoc: public QObject {
Q_OBJECT public:
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
42

43
    KdenliveDoc(const KUrl &url, MltVideoProfile profile, QUndoGroup *undoGroup, QWidget *parent = 0);
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
44 45
    ~KdenliveDoc();
    QDomNodeList producersList();
46 47 48 49
    double fps() const;
    int width() const;
    int height() const;
    KUrl url() const;
50
    void backupMltPlaylist();
51 52
    Timecode timecode() const;
    QDomDocument toXml() const;
53
    void setRenderer(Render *render);
54
    KUndoStack *commandStack();
55
    QString producerName(int id);
56 57
    void setProducerDuration(int id, int duration);
    int getProducerDuration(int id);
58
    Render *renderer();
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
59 60 61 62 63 64 65
    ClipManager *clipManager();
    void addClip(const QDomElement &elem, const int clipId);
    void slotAddClipFile(const KUrl url, const QString group);
    void slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group);
    void deleteClip(const uint clipId);
    int getFramePos(QString duration);
    DocClipBase *getBaseClip(int clipId);
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
66
    void updateClip(int id);
67
    void deleteProjectClip(const uint clipId);
68 69
    /** Inform application of the audio thumbnails generation progress */
    void setThumbsProgress(KUrl url, int progress);
70 71
    QString profilePath() const;
    QString description() const;
72 73
    /** Returns the document format: PAL or NTSC */
    QString getDocumentStandard();
74 75 76
    void setUrl(KUrl url);
    QDomElement documentInfoXml();
    void setProfilePath(QString path);
77 78
    /** Set to true if document needs saving, false otherwise */
    void setModified(bool mod);
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
79

80
private:
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
81 82 83
    KUrl m_url;
    QDomDocument m_document;
    QString m_projectName;
84 85 86 87
    double m_fps;
    int m_width;
    int m_height;
    Timecode m_timecode;
88
    Render *m_render;
89
    KUndoStack *m_commandStack;
90
    QDomDocument generateSceneList();
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
91
    ClipManager *m_clipManager;
92
    MltVideoProfile m_profile;
93
    QString m_scenelist;
94 95
    /** tells whether current doc has been changed since last save event */
    bool m_modified;
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
96

97 98 99
public slots:

signals:
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
100
    void addProjectClip(DocClipBase *);
101
    void signalDeleteProjectClip(int);
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
102
    void updateClipDisplay(int);
103
    void deletTimelineClip(int);
104
    void thumbsProgress(KUrl, int);
105 106
    /** emited when the document state has been modified (= needs saving or not) */
    void docModified(bool);
Jean-Baptiste Mardelle's avatar
Jean-Baptiste Mardelle committed
107 108 109
};

#endif