]> git.sesse.net Git - kdenlive/blob - src/effectstack/effectstackview2.h
New effectstack with collapsible effects, preparing for effect masks and groups
[kdenlive] / src / effectstack / effectstackview2.h
1 /***************************************************************************
2                           effecstackview2.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 EffectStackView2
20  * @brief View part of the EffectStack
21  * @author Marco Gittler
22  */
23
24 #ifndef EFFECTSTACKVIEW2_H
25 #define EFFECTSTACKVIEW2_H
26
27 #include "ui_effectstack2_ui.h"
28 #include "effectstackedit.h"
29 #include "collapsibleeffect.h"
30
31 class EffectsList;
32 class ClipItem;
33 class MltVideoProfile;
34 class Monitor;
35
36
37 class EffectStackView2 : public QWidget
38 {
39     Q_OBJECT
40
41 public:
42     EffectStackView2(Monitor *monitor, QWidget *parent = 0);
43     virtual ~EffectStackView2();
44
45     /** @brief Raises @param dock if a clip is loaded. */
46     void raiseWindow(QWidget* dock);
47
48     /** @brief Sets the add effect button's menu to @param menu. */
49     void setMenu(QMenu *menu);
50
51
52     /** @brief return the index of the track displayed in effect stack
53      ** @param ok set to true if we are looking at a track's effects, otherwise false. */
54     int isTrackMode(bool *ok) const;
55
56     /** @brief Clears the list of effects and updates the buttons accordingly. */
57     void clear();
58
59     /** @brief Passes updates on @param profile and @param t on to the effect editor. */
60     void updateProjectFormat(MltVideoProfile profile, Timecode t);
61
62     /** @brief Tells the effect editor to update its timecode format. */
63     void updateTimecodeFormat();
64
65 private:
66     Ui::EffectStack2_UI m_ui;
67     ClipItem* m_clipref;
68     QList <CollapsibleEffect*> m_effects;
69     EffectsList m_currentEffectList;
70     EffectMetaInfo m_effectMetaInfo;
71     QWidget *m_view;
72
73     /** @brief The track index of currently edited track. */
74     int m_trackindex;
75
76     /** If in track mode: Info of the edited track to be able to access its duration. */
77     TrackInfo m_trackInfo;
78
79     /** @brief Sets the list of effects according to the clip's effect list.
80     * @param ix Number of the effect to preselect */
81     void setupListView(int ix);
82
83 public slots:
84     /** @brief Sets the clip whose effect list should be managed.
85     * @param c Clip whose effect list should be managed
86     * @param ix Effect to preselect */
87     void slotClipItemSelected(ClipItem* c, int ix);
88
89     void slotTrackItemSelected(int ix, const TrackInfo info);
90
91     /** @brief Removes the selected effect. */
92     void slotItemDel();
93
94 private slots:
95
96     /** @brief Emits seekTimeline with position = clipstart + @param pos. */
97     void slotSeekTimeline(int pos);
98
99
100     /* @brief Define the region filter for current effect.
101     void slotRegionChanged();*/
102
103     /** @brief Checks whether the monitor scene has to be displayed. */
104     void slotCheckMonitorPosition(int renderPos);
105
106     void slotUpdateEffectParams(const QDomElement old, const QDomElement e, int ix);
107
108     /** @brief Move an effect in the stack.
109      * @param index The effect index in the stack
110      * @param up true if we want to move effect up, false for down */
111     void slotMoveEffect(int index, bool up);
112
113     /** @brief Delete an effect in the stack. */
114     void slotDeleteEffect(const QDomElement effect, int index);
115
116     /** @brief Pass position changes of the timeline cursor to the effects to keep their local timelines in sync. */
117     void slotRenderPos(int pos);
118
119     /** @brief Called whenever an effect is enabled / disabled by user. */
120     void slotUpdateEffectState(bool disable, int index);
121
122     void slotSetCurrentEffect(int ix);
123
124
125 signals:
126     void removeEffect(ClipItem*, int, QDomElement);
127     /**  Parameters for an effect changed, update the filter in playlist */
128     void updateEffect(ClipItem*, int, 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, int, bool);
134     /** An effect in stack was moved */
135     void changeEffectPosition(ClipItem*, int, 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     void showComments(bool show);
144 };
145
146 #endif