]> git.sesse.net Git - kdenlive/blob - src/projectlist.h
95cd4d6c2303c15625ee0339e965373f53c9bfda
[kdenlive] / src / projectlist.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 PRJECTLIST_H
22 #define PRJECTLIST_H
23
24 #include <QDomNodeList>
25 #include <QToolBar>
26 #include <QTreeWidget>
27
28 #include <KUndoStack>
29 #include <KTreeWidgetSearchLine>
30
31 #include "docclipbase.h"
32 #include "kdenlivedoc.h"
33 #include "renderer.h"
34 #include "timecode.h"
35
36 class ProjectItem;
37
38 class ProjectList : public QWidget
39 {
40   Q_OBJECT
41   
42   public:
43     ProjectList(QWidget *parent=0);
44
45     QDomElement producersList();
46     void setRenderer(Render *projectRender);
47
48     void addClip(const QStringList &name, const QDomElement &elem, const int clipId, const KUrl &url = KUrl(), int parentId = -1);
49     void deleteClip(const int clipId);
50
51   public slots:
52     void setDocument(KdenliveDoc *doc);
53     void addProducer(QDomElement producer, int parentId = -1);
54     void slotReplyGetImage(int clipId, int pos, const QPixmap &pix, int w, int h);
55     void slotReplyGetFileProperties(int clipId, const QMap < QString, QString > &properties, const QMap < QString, QString > &metadata);
56
57
58   private:
59     QTreeWidget *listView;
60     KTreeWidgetSearchLine *searchView;
61     Render *m_render;
62     Timecode m_timecode;
63     double m_fps;
64     QToolBar *m_toolbar;
65     KUndoStack *m_commandStack;
66     int m_clipIdCounter;
67     void selectItemById(const int clipId);
68     ProjectItem *getItemById(int id);
69
70   private slots:
71     void slotAddClip();
72     void slotRemoveClip();
73     void slotEditClip();
74     void slotClipSelected();
75     void slotAddColorClip();
76
77   signals:
78     void clipSelected(const QDomElement &);
79     void getFileProperties(const QDomElement&, int);
80 };
81
82 #endif