1 /***************************************************************************
2 effecstackview2.h - description
5 copyright : (C) 2008 by Marco Gittler
6 email : g.marco@freenet.de
7 ***************************************************************************/
9 /***************************************************************************
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. *
16 ***************************************************************************/
19 * @class EffectStackView2
20 * @brief View part of the EffectStack
21 * @author Marco Gittler
24 #ifndef EFFECTSTACKVIEW2_H
25 #define EFFECTSTACKVIEW2_H
27 #include "ui_effectstack2_ui.h"
28 #include "effectstackedit.h"
29 #include "collapsibleeffect.h"
33 class MltVideoProfile;
37 class EffectStackView2 : public QWidget
42 EffectStackView2(Monitor *monitor, QWidget *parent = 0);
43 virtual ~EffectStackView2();
45 /** @brief Raises @param dock if a clip is loaded. */
46 void raiseWindow(QWidget* dock);
48 /** @brief Sets the add effect button's menu to @param menu. */
49 void setMenu(QMenu *menu);
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;
56 /** @brief Clears the list of effects and updates the buttons accordingly. */
59 /** @brief Passes updates on @param profile and @param t on to the effect editor. */
60 void updateProjectFormat(MltVideoProfile profile, Timecode t);
62 /** @brief Tells the effect editor to update its timecode format. */
63 void updateTimecodeFormat();
65 /** @brief Used to trigger drag effects. */
66 virtual bool eventFilter( QObject * o, QEvent * e );
68 CollapsibleEffect *getEffectByIndex(int ix);
71 virtual void mouseMoveEvent(QMouseEvent * event);
72 virtual void mouseReleaseEvent(QMouseEvent * event);
75 Ui::EffectStack2_UI m_ui;
77 QList <CollapsibleEffect*> m_effects;
78 EffectsList m_currentEffectList;
80 /** @brief Contains infos about effect like is it a track effect, which monitor displays it,... */
81 EffectMetaInfo m_effectMetaInfo;
83 /** @brief The last mouse click position, used to detect drag events. */
86 /** @brief The track index of currently edited track. */
89 /** If in track mode: Info of the edited track to be able to access its duration. */
90 TrackInfo m_trackInfo;
92 /** @brief The effect currently being dragged, NULL if no drag happening. */
93 CollapsibleEffect *m_draggedEffect;
95 /** @brief The current number of groups. */
98 /** @brief Sets the list of effects according to the clip's effect list.
99 * @param ix Number of the effect to preselect */
100 void setupListView(int ix);
102 /** @brief Build the drag info and start it. */
106 /** @brief Sets the clip whose effect list should be managed.
107 * @param c Clip whose effect list should be managed
108 * @param ix Effect to preselect */
109 void slotClipItemSelected(ClipItem* c, int ix);
111 void slotTrackItemSelected(int ix, const TrackInfo info);
113 /** @brief Removes the selected effect. */
118 /** @brief Emits seekTimeline with position = clipstart + @param pos. */
119 void slotSeekTimeline(int pos);
122 /* @brief Define the region filter for current effect.
123 void slotRegionChanged();*/
125 /** @brief Checks whether the monitor scene has to be displayed. */
126 void slotCheckMonitorPosition(int renderPos);
128 void slotUpdateEffectParams(const QDomElement old, const QDomElement e, int ix);
130 /** @brief Move an effect in the stack.
131 * @param index The effect index in the stack
132 * @param up true if we want to move effect up, false for down */
133 void slotMoveEffectUp(int index, bool up);
135 /** @brief Delete an effect in the stack. */
136 void slotDeleteEffect(const QDomElement effect);
138 /** @brief Pass position changes of the timeline cursor to the effects to keep their local timelines in sync. */
139 void slotRenderPos(int pos);
141 /** @brief Called whenever an effect is enabled / disabled by user. */
142 void slotUpdateEffectState(bool disable, int index);
144 void slotSetCurrentEffect(int ix);
146 /** @brief Triggers a filter job on this clip. */
147 void slotStartFilterJob(const QString&filterName, const QString&filterParams, const QString&finalFilterName, const QString&consumer, const QString&consumerParams, const QString&properties);
149 /** @brief Reset an effect to its default values. */
150 void slotResetEffect(int ix);
152 /** @brief Create a group containing effect with ix index. */
153 void slotCreateGroup(int ix);
155 /** @brief Move an effect into a group.
156 ** @param ix the index of effect to move in stack layout
157 ** @param group the effect on which the effect was dropped
158 ** @param lastEffectIndex the last effect index in the group, effect will be inserted after that index
160 void slotMoveEffect(int currentIndex, int newIndex, CollapsibleEffect* target);
162 /** @brief Remove effects from a group */
163 void slotUnGroup(CollapsibleEffect* group);
165 void slotAddEffect(QDomElement effect);
168 void removeEffect(ClipItem*, int, QDomElement);
169 /** Parameters for an effect changed, update the filter in playlist */
170 void updateEffect(ClipItem*, int, QDomElement, QDomElement, int);
171 /** An effect in stack was moved, we need to regenerate
172 all effects for this clip in the playlist */
173 void refreshEffectStack(ClipItem *);
174 /** Enable or disable an effect */
175 void changeEffectState(ClipItem*, int, int, bool);
176 /** An effect in stack was moved */
177 void changeEffectPosition(ClipItem*, int, int, int);
178 /** an effect was saved, reload list */
179 void reloadEffects();
180 /** An effect with position parameter was changed, seek */
181 void seekTimeline(int);
182 /** The region effect for current effect was changed */
183 void updateClipRegion(ClipItem*, int, QString);
184 void displayMessage(const QString&, int);
185 void showComments(bool show);
186 void startFilterJob(ItemInfo info, const QString &clipId, const QString &filterName, const QString &filterParams, const QString&finalFilterName, const QString &consumer, const QString &consumerParams, const QString &properties);
187 void addEffect(ClipItem*,QDomElement);