]> git.sesse.net Git - kdenlive/blob - src/effectstackedit.h
Use RGB plane as Curve Widget background:
[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
25 #include <QWidget>
26 #include <QDomElement>
27 #include <QVBoxLayout>
28 #include <QList>
29 #include <QMap>
30 #include <QScrollArea>
31
32 enum WIPE_DIRECTON { UP = 0, DOWN = 1, LEFT = 2, RIGHT = 3, CENTER = 4 };
33
34 struct wipeInfo {
35     WIPE_DIRECTON start;
36     WIPE_DIRECTON end;
37     int startTransparency;
38     int endTransparency;
39 };
40
41 class QFrame;
42 class Monitor;
43
44 class EffectStackEdit : public QScrollArea
45 {
46     Q_OBJECT
47 public:
48     EffectStackEdit(Monitor *monitor, QWidget *parent = 0);
49     ~EffectStackEdit();
50     void updateProjectFormat(MltVideoProfile profile, Timecode t);
51     static QMap<QString, QImage> iconCache;
52     void updateParameter(const QString &name, const QString &value);
53     void setFrameSize(QPoint p);
54     void updateTimecodeFormat();
55
56 private:
57     void clearAllItems();
58     void createSliderItem(const QString& name, int val , int min, int max, const QString);
59     wipeInfo getWipeInfo(QString value);
60     QString getWipeString(wipeInfo info);
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     QWidget *m_baseWidget;
70     QDomElement m_params;
71     QMap<QString, QWidget*> m_valueItems;
72     MltVideoProfile m_profile;
73     Timecode m_timecode;
74     int m_in;
75     int m_out;
76     QPoint m_frameSize;
77     KeyframeEdit *m_keyframeEditor;
78     Monitor *m_monitor;
79
80 public slots:
81     /** \brief Called when an effect is selected, builds the UIĀ for this effect */
82     void transferParamDesc(const QDomElement d, int pos, int in, int out, bool isEffect = true);
83     void slotSliderMoved(int);
84     /** \brief Called whenever(?) some parameter is changed in the gui.
85      *
86      * Transfers all Dynamic gui parameter settings into m_params(??) */
87     void collectAllParameters();
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);
93     void seekTimeline(int);
94     void displayMessage(const QString&, int);
95     void checkMonitorPosition(int);
96     void syncEffectsPos(int pos);
97 };
98
99 #endif