]> git.sesse.net Git - kdenlive/blob - src/effectstackedit.h
Fix various effects related crashes (don't store effects in QList, but use QDomDocume...
[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
24
25 #include <QWidget>
26 #include <QDomElement>
27 #include <QVBoxLayout>
28 #include <QList>
29 #include <QMap>
30
31 enum WIPE_DIRECTON { UP = 0, DOWN = 1, LEFT = 2, RIGHT = 3, CENTER = 4 };
32
33 struct wipeInfo {
34     WIPE_DIRECTON start;
35     WIPE_DIRECTON end;
36     int startTransparency;
37     int endTransparency;
38 };
39
40 class QFrame;
41
42 class EffectStackEdit : public QObject
43 {
44     Q_OBJECT
45 public:
46     EffectStackEdit(QWidget *parent);
47     ~EffectStackEdit();
48     void updateProjectFormat(MltVideoProfile profile, Timecode t);
49     static QMap<QString, QImage> iconCache;
50     void updateParameter(const QString &name, const QString &value);
51     void setFrameSize(QPoint p);
52
53 private:
54     void clearAllItems();
55     QVBoxLayout *m_vbox;
56     QList<QWidget*> m_uiItems;
57     QWidget *m_baseWidget;
58     QDomElement m_params;
59     QMap<QString, QWidget*> m_valueItems;
60     void createSliderItem(const QString& name, int val , int min, int max, const QString);
61     wipeInfo getWipeInfo(QString value);
62     QString getWipeString(wipeInfo info);
63     MltVideoProfile m_profile;
64     Timecode m_timecode;
65     int m_in;
66     int m_out;
67     QPoint m_frameSize;
68
69 public slots:
70     void transferParamDesc(const QDomElement, int , int);
71     void slotSliderMoved(int);
72     /** \brief Called whenever(?) some parameter is changed in the gui.
73      *
74      * Transfers all Dynamic gui parameter settings into m_params(??) */
75     void collectAllParameters();
76
77 private slots:
78     void slotSeekToPos(int);
79
80 signals:
81     void parameterChanged(const QDomElement, const QDomElement);
82     void seekTimeline(int);
83 };
84
85 #endif