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();
66 Ui::EffectStack2_UI m_ui;
68 QList <CollapsibleEffect*> m_effects;
69 EffectsList m_currentEffectList;
70 EffectMetaInfo m_effectMetaInfo;
72 /** @brief The track index of currently edited track. */
75 /** If in track mode: Info of the edited track to be able to access its duration. */
76 TrackInfo m_trackInfo;
78 /** @brief Sets the list of effects according to the clip's effect list.
79 * @param ix Number of the effect to preselect */
80 void setupListView(int ix);
82 void clearLayout(QLayout *layout);
85 /** @brief Sets the clip whose effect list should be managed.
86 * @param c Clip whose effect list should be managed
87 * @param ix Effect to preselect */
88 void slotClipItemSelected(ClipItem* c, int ix);
90 void slotTrackItemSelected(int ix, const TrackInfo info);
92 /** @brief Removes the selected effect. */
97 /** @brief Emits seekTimeline with position = clipstart + @param pos. */
98 void slotSeekTimeline(int pos);
101 /* @brief Define the region filter for current effect.
102 void slotRegionChanged();*/
104 /** @brief Checks whether the monitor scene has to be displayed. */
105 void slotCheckMonitorPosition(int renderPos);
107 void slotUpdateEffectParams(const QDomElement old, const QDomElement e, int ix);
109 /** @brief Move an effect in the stack.
110 * @param index The effect index in the stack
111 * @param up true if we want to move effect up, false for down */
112 void slotMoveEffect(int index, bool up);
114 /** @brief Delete an effect in the stack. */
115 void slotDeleteEffect(const QDomElement effect, int index);
117 /** @brief Pass position changes of the timeline cursor to the effects to keep their local timelines in sync. */
118 void slotRenderPos(int pos);
120 /** @brief Called whenever an effect is enabled / disabled by user. */
121 void slotUpdateEffectState(bool disable, int index);
123 void slotSetCurrentEffect(int ix);
125 /** @brief Triggers a filter job on this clip. */
126 void slotStartFilterJob(const QString&filterName, const QString&filterParams, const QString&finalFilterName, const QString&consumer, const QString&consumerParams, const QString&properties);
130 void removeEffect(ClipItem*, int, QDomElement);
131 /** Parameters for an effect changed, update the filter in playlist */
132 void updateEffect(ClipItem*, int, QDomElement, QDomElement, int);
133 /** An effect in stack was moved, we need to regenerate
134 all effects for this clip in the playlist */
135 void refreshEffectStack(ClipItem *);
136 /** Enable or disable an effect */
137 void changeEffectState(ClipItem*, int, int, bool);
138 /** An effect in stack was moved */
139 void changeEffectPosition(ClipItem*, int, int, int);
140 /** an effect was saved, reload list */
141 void reloadEffects();
142 /** An effect with position parameter was changed, seek */
143 void seekTimeline(int);
144 /** The region effect for current effect was changed */
145 void updateClipRegion(ClipItem*, int, QString);
146 void displayMessage(const QString&, int);
147 void showComments(bool show);
148 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);