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.5;
38 virtual QSize sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const {
39 return QSize(10, m_height);
45 class ClipProperties : public QDialog
50 ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidget * parent = 0);
51 ClipProperties(QList <DocClipBase *>cliplist, 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);
62 void slotEditMarker();
63 void slotDeleteMarker();
64 void slotFillMarkersList();
65 void slotCheckMaxLength();
66 void slotEnableLuma(int state);
67 void slotEnableLumaFile(int state);
68 void slotUpdateDurationFormat(int ix);
69 void slotApplyProperties();
71 void slotDeleteProxy();
72 void slotOpenUrl(const QString &url);
75 Ui::ClipProperties_UI m_view;
76 QMap <QString, QString> m_old_props;
80 /** used to count images in slideshow clip */
82 /** some visual properties changed, reload thumbnails */
83 bool m_clipNeedsRefresh;
84 /** clip resource changed, reload it */
85 bool m_clipNeedsReLoad;
86 /** Frame with proxy info / delete button */
87 QFrame* m_proxyContainer;
90 void addMarker(const QString &, GenTime, QString);
91 void deleteProxy(const QString);
92 void applyNewClipProperties(const QString, QMap <QString, QString> , QMap <QString, QString> , bool, bool);