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 ***************************************************************************/
21 #ifndef CLIPPROPERTIES_H
22 #define CLIPPROPERTIES_H
24 #include "definitions.h"
26 #include "docclipbase.h"
27 #include "ui_clipproperties_ui.h"
29 #include <QStyledItemDelegate>
31 class PropertiesViewDelegate : public QStyledItemDelegate
35 PropertiesViewDelegate(QWidget *parent) : QStyledItemDelegate(parent) {
36 m_height = parent->fontMetrics().height() * 1.2;
39 QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const {
40 return QSize(QStyledItemDelegate::sizeHint(option, index).width(), m_height);
46 class ClipProperties : public QDialog
51 ClipProperties(DocClipBase *clip, const Timecode &tc, double fps, QWidget * parent = 0);
52 ClipProperties(const QList<DocClipBase *> &cliplist, const Timecode &tc, const QMap<QString, QString> &commonproperties, QWidget * parent);
53 virtual ~ClipProperties();
54 QMap <QString, QString> properties();
55 const QString &clipId() const;
56 bool needsTimelineRefresh() const;
57 bool needsTimelineReload() const;
58 void disableClipId(const QString &id);
61 void slotFillMarkersList(DocClipBase *clip);
62 void slotUpdateAnalysisData(DocClipBase *clip);
65 void parseFolder(bool reloadThumb = true);
67 void slotEditMarker();
68 void slotDeleteMarker();
69 void slotCheckMaxLength();
70 void slotEnableLuma(int state);
71 void slotEnableLumaFile(int state);
72 void slotUpdateDurationFormat(int ix);
73 void slotApplyProperties();
75 void slotDeleteProxy();
76 void slotOpenUrl(const QString &url);
77 void slotSaveMarkers();
78 void slotLoadMarkers();
79 void slotDeleteAnalysis();
80 void slotGotThumbnail(const QString &id, const QImage &img);
81 void slotSaveAnalysis();
82 void slotLoadAnalysis();
83 void slotReloadVideoProperties();
84 void slotReloadVideoThumb();
87 Ui::ClipProperties_UI m_view;
88 QMap <QString, QString> m_old_props;
92 /** used to count images in slideshow clip */
94 /** some visual properties changed, reload thumbnails */
95 bool m_clipNeedsRefresh;
96 /** clip resource changed, reload it */
97 bool m_clipNeedsReLoad;
98 /** Frame with proxy info / delete button */
99 QFrame* m_proxyContainer;
100 void loadVideoProperties(const QMap<QString, QString> &props);
103 void addMarkers(const QString &, QList <CommentedTime>);
104 void deleteProxy(const QString&);
105 void applyNewClipProperties(const QString&, const QMap <QString, QString> &, const QMap <QString, QString> &, bool, bool);
106 void saveMarkers(const QString &id);
107 void loadMarkers(const QString &id);
108 void editAnalysis(const QString &id, const QString &name, const QString &value);
109 void requestThumb(const QString &id, const QList <int>& frames);