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