1 /***************************************************************************
2 effecstackview.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 EffectStackView
20 * @brief View part of the EffectStack
21 * @author Marco Gittler
24 #ifndef EFFECTSTACKVIEW_H
25 #define EFFECTSTACKVIEW_H
27 #include "ui_effectstack_ui.h"
28 #include "effectstackedit.h"
32 class MltVideoProfile;
35 class EffectStackView : public QWidget
40 EffectStackView(Monitor *monitor, QWidget *parent = 0);
41 virtual ~EffectStackView();
43 /** @brief Raises @param dock if a clip is loaded. */
44 void raiseWindow(QWidget* dock);
46 /** @brief Clears the list of effects and updates the buttons accordingly. */
49 /** @brief Sets the add effect button's menu to @param menu. */
50 void setMenu(QMenu *menu);
52 /** @brief Passes updates on @param profile and @param t on to the effect editor. */
53 void updateProjectFormat(MltVideoProfile profile, Timecode t);
55 /** @brief Tells the effect editor to update its timecode format. */
56 void updateTimecodeFormat();
58 /** @brief return the index of the track displayed in effect stack
59 ** @param ok set to true if we are looking at a track's effects, otherwise false. */
60 int isTrackMode(bool *ok) const;
63 Ui::EffectStack_UI m_ui;
66 QMap<QString, EffectsList*> m_effectLists;
67 EffectsList m_currentEffectList;
68 EffectStackEdit* m_effectedit;
70 /** @brief Effectstackview can show the effects of a clip or the effects of a track.
71 * true if showing track effects. */
74 /** @brief The track index of currently edited track. */
77 /** @brief Sets the list of effects according to the clip's effect list.
78 * @param ix Number of the effect to preselect */
79 void setupListView(int ix);
82 /** @brief Sets the clip whose effect list should be managed.
83 * @param c Clip whose effect list should be managed
84 * @param ix Effect to preselect */
85 void slotClipItemSelected(ClipItem* c, int ix);
87 void slotTrackItemSelected(int ix, const TrackInfo info);
89 /** @brief Emits updateClipEffect.
90 * @param old Old effect information
91 * @param e New effect information
93 * Connected to a parameter change in the editor */
94 void slotUpdateEffectParams(const QDomElement old, const QDomElement e);
96 /** @brief Removes the selected effect. */
100 /** @brief Updates buttons and the editor according to selected effect.
101 * @param update (optional) Set the clip's selected effect (display keyframes in timeline) */
102 void slotItemSelectionChanged(bool update = true);
104 /** @brief Moves the selected effect upwards. */
107 /** @brief Moves the selected effect downwards. */
110 /** @brief Resets the selected effect to its default values. */
111 void slotResetEffect();
113 /** @brief Updates effect @param item if it was enabled or disabled. */
114 void slotItemChanged(QListWidgetItem *item);
116 /** @brief Saves the selected effect's values to a custom effect.
118 * TODO: save all effects into one custom effect */
119 void slotSaveEffect();
121 /** @brief Emits seekTimeline with position = clipstart + @param pos. */
122 void slotSeekTimeline(int pos);
124 /** @brief Makes the check all checkbox represent the check state of the effects. */
125 void slotUpdateCheckAllButton();
127 /** @brief Sets the check state of all effects according to @param state. */
128 void slotCheckAll(int state);
130 /* @brief Define the region filter for current effect.
131 void slotRegionChanged();*/
133 /** @brief Checks whether the monitor scene has to be displayed. */
134 void slotCheckMonitorPosition(int renderPos);
136 /** @brief Pass position changes of the timeline cursor to the effects to keep their local timelines in sync. */
137 void slotRenderPos(int pos);
140 void removeEffect(ClipItem*, int, QDomElement);
141 /** Parameters for an effect changed, update the filter in playlist */
142 void updateEffect(ClipItem*, int, QDomElement, QDomElement, int);
143 /** An effect in stack was moved, we need to regenerate
144 all effects for this clip in the playlist */
145 void refreshEffectStack(ClipItem *);
146 /** Enable or disable an effect */
147 void changeEffectState(ClipItem*, int, int, bool);
148 /** An effect in stack was moved */
149 void changeEffectPosition(ClipItem*, int, int, int);
150 /** an effect was saved, reload list */
151 void reloadEffects();
152 /** An effect with position parameter was changed, seek */
153 void seekTimeline(int);
154 /** The region effect for current effect was changed */
155 void updateClipRegion(ClipItem*, int, QString);
156 void displayMessage(const QString&, int);