]> git.sesse.net Git - kdenlive/blob - src/effectstackview.h
Progress on track effects
[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     Monitor *m_monitor;
61     ClipItem* m_clipref;
62     QMap<QString, EffectsList*> m_effectLists;
63     EffectsList m_currentEffectList;
64     EffectStackEdit* m_effectedit;
65
66     /** @brief Effectstackview can show the effects of a clip or the effects of a track.
67      * true if showing track effects. */
68     bool m_trackMode;
69
70     /** @brief The track index of currently edited track. */
71     int m_trackindex;
72
73     /** @brief Sets the list of effects according to the clip's effect list.
74     * @param ix Number of the effect to preselect */
75     void setupListView(int ix);
76
77 public slots:
78     /** @brief Sets the clip whose effect list should be managed.
79     * @param c Clip whose effect list should be managed
80     * @param ix Effect to preselect */
81     void slotClipItemSelected(ClipItem* c, int ix);
82
83     void slotTrackItemSelected(int ix, EffectsList list);
84
85     /** @brief Emits updateClipEffect.
86     * @param old Old effect information
87     * @param e New effect information
88     *
89     * Connected to a parameter change in the editor */
90     void slotUpdateEffectParams(const QDomElement old, const QDomElement e);
91
92     /** @brief Removes the selected effect. */
93     void slotItemDel();
94
95 private slots:
96     /** @brief Updates buttons and the editor according to selected effect.
97     * @param update (optional) Set the clip's selected effect (display keyframes in timeline) */
98     void slotItemSelectionChanged(bool update = true);
99
100     /** @brief Moves the selected effect upwards. */
101     void slotItemUp();
102
103     /** @brief Moves the selected effect downwards. */
104     void slotItemDown();
105
106     /** @brief Resets the selected effect to its default values. */
107     void slotResetEffect();
108
109     /** @brief Updates effect @param item if it was enabled or disabled. */
110     void slotItemChanged(QListWidgetItem *item);
111
112     /** @brief Saves the selected effect's values to a custom effect.
113     *
114     * TODO: save all effects into one custom effect */
115     void slotSaveEffect();
116
117     /** @brief Emits seekTimeline with position = clipstart + @param pos. */
118     void slotSeekTimeline(int pos);
119
120     /** @brief Makes the check all checkbox represent the check state of the effects. */
121     void slotUpdateCheckAllButton();
122
123     /** @brief Sets the check state of all effects according to @param state. */
124     void slotCheckAll(int state);
125
126     /** @brief Define the region filter for current effect. */
127     void slotRegionChanged();
128
129     /** @brief Checks whether the monitor scene has to be displayed. */
130     void slotCheckMonitorPosition(int renderPos);
131
132     /** @brief Pass position changes of the timeline cursor to the effects to keep their local timelines in sync. */
133     void slotRenderPos(int pos);
134
135 signals:
136     void removeEffect(ClipItem*, int, QDomElement);
137     /**  Parameters for an effect changed, update the filter in playlist */
138     void updateEffect(ClipItem*, int, QDomElement, QDomElement, int);
139     /** An effect in stack was moved, we need to regenerate
140         all effects for this clip in the playlist */
141     void refreshEffectStack(ClipItem *);
142     /** Enable or disable an effect */
143     void changeEffectState(ClipItem*, int, int, bool);
144     /** An effect in stack was moved */
145     void changeEffectPosition(ClipItem*, int, int, int);
146     /** an effect was saved, reload list */
147     void reloadEffects();
148     /** An effect with position parameter was changed, seek */
149     void seekTimeline(int);
150     /** The region effect for current effect was changed */
151     void updateClipRegion(ClipItem*, int, QString);
152     void displayMessage(const QString&, int);
153 };
154
155 #endif