X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fkdenlivedoc.h;h=463e4cda78af699bdd5c0642ee2d995d2bde7446;hb=2117079e79767c3d63f7f116a47681b2180aacd3;hp=f49610edaba0830c18224916064c6d3d036b97c8;hpb=db101991c540c6d73fed14f934598e300016f6c4;p=kdenlive diff --git a/src/kdenlivedoc.h b/src/kdenlivedoc.h index f49610ed..463e4cda 100644 --- a/src/kdenlivedoc.h +++ b/src/kdenlivedoc.h @@ -1,20 +1,23 @@ /*************************************************************************** - krender.h - description - ------------------- - begin : Fri Nov 22 2002 - copyright : (C) 2002 by Jason Wood - email : jasonwood@blueyonder.co.uk -***************************************************************************/ - -/*************************************************************************** + * Copyright (C) 2007 by Jean-Baptiste Mardelle (jb@kdenlive.org) * * * * 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. * * * + * 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 * ***************************************************************************/ + #ifndef KDENLIVEDOC_H #define KDENLIVEDOC_H @@ -23,37 +26,112 @@ #include #include #include +#include +#include #include #include "gentime.h" #include "timecode.h" +#include "definitions.h" + +class Render; +class ClipManager; +class DocClipBase; +class MainWindow; -class KdenliveDoc:public QObject { - Q_OBJECT public: +class KdenliveDoc: public QObject { +Q_OBJECT public: - KdenliveDoc(KUrl url, double fps, int width, int height, QWidget *parent = 0); + KdenliveDoc(const KUrl &url, const KUrl &projectFolder, MltVideoProfile profile, QUndoGroup *undoGroup, MainWindow *parent = 0); ~KdenliveDoc(); - QString documentName(); QDomNodeList producersList(); - double fps(); - int width(); - int height(); - void setProducers(QDomElement doc); - Timecode timecode(); - QDomDocument toXml(); - - private: + double fps() const; + int width() const; + int height() const; + KUrl url() const; + void backupMltPlaylist(); + Timecode timecode() const; + QDomDocument toXml() const; + void setRenderer(Render *render); + KUndoStack *commandStack(); + QString producerName(int id); + void setProducerDuration(int id, int duration); + int getProducerDuration(int id); + Render *renderer(); + ClipManager *clipManager(); + void addClip(const QDomElement &elem, const int clipId); + void addFolder(const QString foldername, int clipId, bool edit); + void deleteFolder(const QString foldername, int clipId); + void slotAddClipFile(const KUrl url, const QString group, const int groupId = -1); + void slotAddTextClipFile(const QString path, const QString group, const int groupId = -1); + void editTextClip(QString path, int id); + void slotAddFolder(const QString folderName); + void slotDeleteFolder(const QString folderName, const int id); + void slotEditFolder(const QString folderName, const QString oldfolderName, int clipId); + void slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group, const int groupId = -1); + void slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, bool loop, const QString group, const int groupId = -1); + void deleteClip(const uint clipId); + int getFramePos(QString duration); + DocClipBase *getBaseClip(int clipId); + void updateClip(int id); + void deleteProjectClip(QList ids); + void deleteProjectFolder(QMap map); + /** Inform application of the audio thumbnails generation progress */ + void setThumbsProgress(const QString &message, int progress); + QString profilePath() const; + QString description() const; + /** Returns the document format: PAL or NTSC */ + QString getDocumentStandard(); + void setUrl(KUrl url); + QDomElement documentInfoXml(QDomElement timelineInfo); + void setProfilePath(QString path); + /** Set to true if document needs saving, false otherwise */ + void setModified(bool mod); + int getFreeClipId(); + /** does the document need saving */ + bool isModified() const; + /** Returns project folder, used to store project files (titles, effects,...) */ + KUrl projectFolder() const; + /** Used to inform main app of the current document loading progress */ + void loadingProgressed(); +private: KUrl m_url; QDomDocument m_document; QString m_projectName; double m_fps; + /** Cursor position at document opening */ + int m_startPos; int m_width; int m_height; Timecode m_timecode; + Render *m_render; + KUndoStack *m_commandStack; + QDomDocument generateSceneList(); + ClipManager *m_clipManager; + MltVideoProfile m_profile; + QString m_scenelist; + /** tells whether current doc has been changed since last save event */ + bool m_modified; + /** Project folder, used to store project files (titles, effects,...) */ + KUrl m_projectFolder; + double m_documentLoadingStep; + double m_documentLoadingProgress; + void convertDocument(double version); + +public slots: + void slotCreateTextClip(QString group, int groupId); - public slots: - +signals: + void addProjectClip(DocClipBase *); + void addProjectFolder(const QString, int, bool, bool edit = false); + void signalDeleteProjectClip(int); + void updateClipDisplay(int); + void deletTimelineClip(int); + void progressInfo(const QString &, int); + /** emited when the document state has been modified (= needs saving or not) */ + void docModified(bool); + void refreshClipThumbnail(int); }; #endif