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