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)
36 : QStyledItemDelegate(parent)
38 m_height = parent->fontMetrics().height() * 1.2;
41 QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const {
42 return QSize(QStyledItemDelegate::sizeHint(option, index).width(), m_height);
48 class ClipProperties : public QDialog
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);
63 void slotFillMarkersList(DocClipBase *clip);
64 void slotUpdateAnalysisData(DocClipBase *clip);
67 void parseFolder(bool reloadThumb = true);
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();
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();
89 Ui::ClipProperties_UI m_view;
90 QMap <QString, QString> m_old_props;
94 /** used to count images in slideshow clip */
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);
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);