1 /***************************************************************************
2 * Copyright (C) 2008 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 ***************************************************************************/
23 /**ClipManager manages the list of clips in a document
24 *@author Jean-Baptiste Mardelle
36 #include "definitions.h"
41 class AbstractGroupItem;
48 class ClipManager: public QObject
52 ClipManager(KdenliveDoc *doc);
53 virtual ~ ClipManager();
54 void addClip(DocClipBase *clip);
55 DocClipBase *getClipAt(int pos);
56 void deleteClip(const QString &clipId);
57 void slotAddClipFile(const KUrl url, const QString group, const QString &groupId);
58 void slotAddClipList(const KUrl::List urls, const QString group, const QString &groupId);
59 void slotAddTextClipFile(const QString titleName, const QString imagePath, const QString xml, const QString group, const QString &groupId);
60 void slotAddTextTemplateClip(QString titleName, const QString imagePath, const KUrl path, const QString group, const QString &groupId);
61 void slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group, const QString &groupId);
62 void slotAddSlideshowClipFile(const QString name, const QString path, int count, const QString duration, const bool loop, const bool fade, const QString &luma_duration, const QString &luma_file, const int softness, const QString group, const QString &groupId);
63 DocClipBase *getClipById(QString clipId);
64 DocClipBase *getClipByResource(QString resource);
65 void slotDeleteClip(const QString & clipId);
66 void setThumbsProgress(const QString &message, int progress);
67 void checkAudioThumbs();
68 QList <DocClipBase*> documentClipList() const;
69 QMap <QString, QString> documentFolderList() const;
71 int getFreeFolderId();
72 int lastClipId() const;
73 void startAudioThumbsGeneration();
74 void endAudioThumbsGeneration(const QString &requestedId);
75 void askForAudioThumb(const QString &id);
76 QString projectFolder() const;
77 void resetProducersList(QList <Mlt::Producer *> prods);
78 void addFolder(const QString&, const QString&);
79 void deleteFolder(const QString&);
81 AbstractGroupItem *createGroup();
82 void removeGroup(AbstractGroupItem *group);
83 QDomElement groupsXml() const;
86 void updatePreviewSettings();
88 private: // Private attributes
89 /** the list of clips in the document */
90 QList <DocClipBase*> m_clipList;
91 /** the list of groups in the document */
92 QList <AbstractGroupItem *> m_groupsList;
93 QMap <QString, QString> m_folderList;
94 QList <QString> m_audioThumbsQueue;
95 /** the document undo stack*/
98 int m_folderIdCounter;
99 bool m_audioThumbsEnabled;
100 QString m_generatingAudioId;