]> git.sesse.net Git - kdenlive/blob - src/clipmanager.h
Reindent the codebase using 'linux' bracket placement.
[kdenlive] / src / clipmanager.h
1 /***************************************************************************
2  *   Copyright (C) 2008 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 #ifndef CLIPMANAGER_H
21 #define CLIPMANAGER_H
22
23 /**ClipManager manages the list of clips in a document
24   *@author Jean-Baptiste Mardelle
25   */
26
27 #include <qdom.h>
28 #include <QPixmap>
29 #include <QObject>
30
31 #include <KUrl>
32 #include <KUndoStack>
33 #include <klocale.h>
34
35 #include "gentime.h"
36 #include "definitions.h"
37
38
39 class KdenliveDoc;
40 class DocClipBase;
41 class AbstractGroupItem;
42
43 namespace Mlt
44 {
45 class Producer;
46 };
47
48 class ClipManager: public QObject
49 {
50 Q_OBJECT public:
51
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 slotAddColorClipFile(const QString name, const QString color, QString duration, const QString group, const QString &groupId);
61     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);
62     DocClipBase *getClipById(QString clipId);
63     DocClipBase *getClipByResource(QString resource);
64     void slotDeleteClip(const QString & clipId);
65     void setThumbsProgress(const QString &message, int progress);
66     void checkAudioThumbs();
67     QList <DocClipBase*> documentClipList() const;
68     QMap <QString, QString> documentFolderList() const;
69     int getFreeClipId();
70     int getFreeFolderId();
71     int lastClipId() const;
72     void startAudioThumbsGeneration();
73     void endAudioThumbsGeneration(const QString &requestedId);
74     void askForAudioThumb(const QString &id);
75     QString projectFolder() const;
76     void resetProducersList(QList <Mlt::Producer *> prods);
77     void addFolder(const QString&, const QString&);
78     void deleteFolder(const QString&);
79     void clear();
80     AbstractGroupItem *createGroup();
81     void removeGroup(AbstractGroupItem *group);
82     QDomElement groupsXml() const;
83
84 public slots:
85     void updatePreviewSettings();
86
87 private:   // Private attributes
88     /** the list of clips in the document */
89     QList <DocClipBase*> m_clipList;
90     /** the list of groups in the document */
91     QList <AbstractGroupItem *> m_groupsList;
92     QMap <QString, QString> m_folderList;
93     QList <QString> m_audioThumbsQueue;
94     /** the document undo stack*/
95     KdenliveDoc *m_doc;
96     int m_clipIdCounter;
97     int m_folderIdCounter;
98     bool m_audioThumbsEnabled;
99     QString m_generatingAudioId;
100
101 };
102
103 #endif