]> git.sesse.net Git - kdenlive/blob - src/effectstackview.h
68311d9346876f6b652453c7e3bcbd05f55bffb7
[kdenlive] / src / effectstackview.h
1 /***************************************************************************
2                           effecstackview.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 /**
19  * @class EffectStackView
20  * @brief View part of the EffectStack
21  * @author Marco Gittler
22  */
23
24 #ifndef EFFECTSTACKVIEW_H
25 #define EFFECTSTACKVIEW_H
26
27 #include "ui_effectstack_ui.h"
28 #include "effectstackedit.h"
29
30 class EffectsList;
31 class ClipItem;
32 class MltVideoProfile;
33
34 class EffectStackView : public QWidget
35 {
36     Q_OBJECT
37
38 public:
39     EffectStackView(QWidget *parent = 0);
40     virtual ~EffectStackView();
41
42     /** @brief Raises @param dock if a clip is loaded. */
43     void raiseWindow(QWidget* dock);
44
45     /** @brief Clears the list of effects and updates the buttons accordingly. */
46     void clear();
47
48     /** @brief Sets the add effect button's menu to @param menu. */
49     void setMenu(QMenu *menu);
50
51     /** @brief Passes updates on @param profile and @param t on to the effect editor. */
52     void updateProjectFormat(MltVideoProfile profile, Timecode t);
53
54     /** @brief Tells the effect editor to update its timecode format. */
55     void updateTimecodeFormat();
56
57 private:
58     Ui::EffectStack_UI m_ui;
59     ClipItem* m_clipref;
60     QMap<QString, EffectsList*> m_effectLists;
61     EffectStackEdit* m_effectedit;
62
63     /** @brief Sets the list of effects according to the clip's effect list.
64     * @param ix Number of the effect to preselect */
65     void setupListView(int ix);
66
67 public slots:
68     /** @brief Sets the clip whose effect list should be managed.
69     * @param c Clip whose effect list should be managed
70     * @param ix Effect to preselect */
71     void slotClipItemSelected(ClipItem* c, int ix);
72
73     /** @brief Emits updateClipEffect.
74     * @param old Old effect information
75     * @param e New effect information
76     *
77     * Connected to a parameter change in the editor */
78     void slotUpdateEffectParams(const QDomElement old, const QDomElement e);
79
80     /** @brief Removes the selected effect. */
81     void slotItemDel();
82
83 private slots:
84     /** @brief Updates buttons and the editor according to selected effect.
85     * @param update (optional) Set the clip's selected effect (display keyframes in timeline) */
86     void slotItemSelectionChanged(bool update = true);
87
88     /** @brief Moves the selected effect upwards. */
89     void slotItemUp();
90
91     /** @brief Moves the selected effect downwards. */
92     void slotItemDown();
93
94     /** @brief Resets the selected effect to its default values. */
95     void slotResetEffect();
96
97     /** @brief Updates effect @param item if it was enabled or disabled. */
98     void slotItemChanged(QListWidgetItem *item);
99
100     /** @brief Saves the selected effect's values to a custom effect.
101     *
102     * TODO: save all effects into one custom effect */
103     void slotSaveEffect();
104
105     /** @brief Emits seekTimeline with position = clipstart + @param pos. */
106     void slotSeekTimeline(int pos);
107
108     /** @brief Makes the check all checkbox represent the check state of the effects. */
109     void slotUpdateCheckAllButton();
110
111     /** @brief Sets the check state of all effects according to @param state. */
112     void slotCheckAll(int state);
113
114     /** @brief Define the region filter for current effect. */
115     void slotRegionChanged();
116
117 signals:
118     void removeEffect(ClipItem*, QDomElement);
119     /**  Parameters for an effect changed, update the filter in playlist */
120     void updateClipEffect(ClipItem*, QDomElement, QDomElement, int);
121     /** An effect in stack was moved, we need to regenerate
122         all effects for this clip in the playlist */
123     void refreshEffectStack(ClipItem *);
124     /** Enable or disable an effect */
125     void changeEffectState(ClipItem*, int, bool);
126     /** An effect in stack was moved */
127     void changeEffectPosition(ClipItem*, int, int);
128     /** an effect was saved, reload list */
129     void reloadEffects();
130     /** An effect with position parameter was changed, seek */
131     void seekTimeline(int);
132     /** The region effect for current effect was changed */
133     void updateClipRegion(ClipItem*, int, QString);
134     void displayMessage(const QString&, int);
135 };
136
137 #endif