]> git.sesse.net Git - kdenlive/blob - src/clipproperties.h
Fix indent
[kdenlive] / src / clipproperties.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
21 #ifndef CLIPPROPERTIES_H
22 #define CLIPPROPERTIES_H
23
24 #include "definitions.h"
25 #include "timecode.h"
26 #include "docclipbase.h"
27 #include "ui_clipproperties_ui.h"
28
29 #include <QStyledItemDelegate>
30
31 class PropertiesViewDelegate : public QStyledItemDelegate
32 {
33     Q_OBJECT
34 public:
35     PropertiesViewDelegate(QWidget *parent)
36         : QStyledItemDelegate(parent)
37     {
38         m_height = parent->fontMetrics().height() * 1.2;
39     }
40 protected:
41     QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const {
42         return QSize(QStyledItemDelegate::sizeHint(option, index).width(), m_height);
43     }
44 private:
45     int m_height;
46 };
47
48 class ClipProperties : public QDialog
49 {
50     Q_OBJECT
51
52 public:
53     ClipProperties(DocClipBase *clip, const Timecode &tc, double fps, QWidget * parent = 0);
54     ClipProperties(const QList<DocClipBase *> &cliplist, const Timecode &tc, const QMap<QString, QString> &commonproperties, QWidget * parent);
55     virtual ~ClipProperties();
56     QMap <QString, QString> properties();
57     const QString &clipId() const;
58     bool needsTimelineRefresh() const;
59     bool needsTimelineReload() const;
60     void disableClipId(const QString &id);
61
62 public slots:
63     void slotFillMarkersList(DocClipBase *clip);
64     void slotUpdateAnalysisData(DocClipBase *clip);
65     
66 private slots:
67     void parseFolder(bool reloadThumb = true);
68     void slotAddMarker();
69     void slotEditMarker();
70     void slotDeleteMarker();
71     void slotCheckMaxLength();
72     void slotEnableLuma(int state);
73     void slotEnableLumaFile(int state);
74     void slotUpdateDurationFormat(int ix);
75     void slotApplyProperties();
76     void slotModified();
77     void slotDeleteProxy();
78     void slotOpenUrl(const QString &url);
79     void slotSaveMarkers();
80     void slotLoadMarkers();
81     void slotDeleteAnalysis();
82     void slotGotThumbnail(const QString &id, const QImage &img);
83     void slotSaveAnalysis();
84     void slotLoadAnalysis();
85     void slotReloadVideoProperties();
86     void slotReloadVideoThumb();
87
88 private:
89     Ui::ClipProperties_UI m_view;
90     QMap <QString, QString> m_old_props;
91     DocClipBase *m_clip;
92     Timecode m_tc;
93     double m_fps;
94     /** used to count images in slideshow clip */
95     int m_count;
96     /** some visual properties changed, reload thumbnails */
97     bool m_clipNeedsRefresh;
98     /** clip resource changed, reload it */
99     bool m_clipNeedsReLoad;
100     /** Frame with proxy info / delete button */
101     QFrame* m_proxyContainer;
102     void loadVideoProperties(const QMap<QString, QString> &props);
103
104 signals:
105     void addMarkers(const QString &, const QList <CommentedTime>&);
106     void deleteProxy(const QString&);
107     void applyNewClipProperties(const QString&, const QMap <QString, QString> &, const QMap <QString, QString> &, bool, bool);
108     void saveMarkers(const QString &id);
109     void loadMarkers(const QString &id);
110     void editAnalysis(const QString &id, const QString &name, const QString &value);
111     void requestThumb(const QString &id, const QList <int>& frames);
112 };
113
114
115 #endif
116