]> git.sesse.net Git - kdenlive/blob - src/effectstackedit.h
3697e2140fa20a1ebcddf73758029e7f31673259
[kdenlive] / src / effectstackedit.h
1 /***************************************************************************
2                           effecstackedit.h  -  description
3                              -------------------
4     begin                : Feb 15 2008
5     copyright            : (C) 2008 by Marco Gittler
6     email                : g.marco@freenet.de
7  ***************************************************************************/
8
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17
18 #ifndef EFFECTSTACKEDIT_H
19 #define EFFECTSTACKEDIT_H
20
21 #include "definitions.h"
22 #include "timecode.h"
23 #include "keyframeedit.h"
24 #include "effectstack/collapsibleeffect.h"
25
26 #include <QWidget>
27 #include <QDomElement>
28 #include <QVBoxLayout>
29 #include <QList>
30 #include <QMap>
31 #include <QScrollArea>
32
33 class QFrame;
34 class Monitor;
35 class GeometryWidget;
36
37 class EffectStackEdit : public QScrollArea
38 {
39     Q_OBJECT
40 public:
41     EffectStackEdit(Monitor *monitor, QWidget *parent = 0);
42     ~EffectStackEdit();
43     void updateProjectFormat(MltVideoProfile profile, Timecode t);
44     static QMap<QString, QImage> iconCache;
45     /** @brief Sets attribute @param name to @param value.
46     *
47     * Used to disable the effect, by setting disabled="1" */
48     void updateParameter(const QString &name, const QString &value);
49     void setFrameSize(QPoint p);
50     /** @brief Tells the parameters to update their timecode format according to KdenliveSettings. */
51     void updateTimecodeFormat();
52     /** @brief Returns true if this effect wants to keep track of current position in clip. */
53     bool effectNeedsSyncPosition() const;
54     Monitor *monitor();
55     /** @brief Install event filter so that scrolling with mouse wheel does not change parameter value. */
56     virtual bool eventFilter( QObject * o, QEvent * e );
57
58 private:
59     /** @brief Deletes all parameter widgets. */
60     void clearAllItems();
61     /** @brief Updates parameter @param name according to new value of dependency.
62     * @param name Name of the parameter which will be updated
63     * @param type Type of the parameter which will be updated
64     * @param value Value of the dependency parameter */
65     void meetDependency(const QString& name, QString type, QString value);
66
67     QVBoxLayout *m_vbox;
68     QList<QWidget*> m_uiItems;
69     QMap<QString, QWidget*> m_valueItems;
70     int m_in;
71     int m_out;
72     KeyframeEdit *m_keyframeEditor;
73     Monitor *m_monitor;
74     GeometryWidget *m_geometryWidget;
75     EffectMetaInfo m_metaInfo;
76     QWidget *m_baseWidget;
77     ParameterContainer *m_paramWidget;
78
79 public slots:
80     /** @brief Called when an effect is selected, builds the UIĀ for this effect. */
81     void transferParamDesc(const QDomElement &d, ItemInfo info, bool isEffect = true);
82
83     /** @brief Called whenever(?) some parameter is changed in the gui.
84      *
85      * Transfers all Dynamic gui parameter settings into m_params(??) */
86     void collectAllParameters();
87
88     /** @brief Pass position changes of the timeline cursor to the effects to keep their local timelines in sync. */
89     void slotSyncEffectsPos(int pos);
90
91 signals:
92     void parameterChanged(const QDomElement, const QDomElement, int);
93     void seekTimeline(int);
94     void displayMessage(const QString&, int);
95     void checkMonitorPosition(int);
96     void syncEffectsPos(int pos);
97     void showComments(bool show);
98     void effectStateChanged(bool enabled);
99     /** @brief Start an MLT filter job on this clip. */
100     void startFilterJob(const QString &filterName, const QString &filterParams, const QString &finalFilterName, const QString &consumer, const QString &consumerParams, const QString &properties);
101 };
102
103 #endif