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;
34 class EffectStackView : public QWidget
39 EffectStackView(QWidget *parent = 0);
40 virtual ~EffectStackView();
42 /** @brief Raises @param dock if a clip is loaded. */
43 void raiseWindow(QWidget* dock);
45 /** @brief Clears the list of effects and updates the buttons accordingly. */
48 /** @brief Sets the add effect button's menu to @param menu. */
49 void setMenu(QMenu *menu);
51 /** @brief Passes updates on @param profile and @param t on to the effect editor. */
52 void updateProjectFormat(MltVideoProfile profile, Timecode t);
54 /** @brief Tells the effect editor to update its timecode format. */
55 void updateTimecodeFormat();
58 Ui::EffectStack_UI m_ui;
60 QMap<QString, EffectsList*> m_effectLists;
61 EffectStackEdit* m_effectedit;
63 /** @brief Sets the list of effects according to the clip's effect list.
64 * @param ix Number of the effect to preselect */
65 void setupListView(int ix);
68 /** @brief Sets the clip whose effect list should be managed.
69 * @param c Clip whose effect list should be managed
70 * @param ix Effect to preselect */
71 void slotClipItemSelected(ClipItem* c, int ix);
73 /** @brief Emits updateClipEffect.
74 * @param old Old effect information
75 * @param e New effect information
77 * Connected to a parameter change in the editor */
78 void slotUpdateEffectParams(const QDomElement old, const QDomElement e);
80 /** @brief Removes the selected effect. */
84 /** @brief Updates buttons and the editor according to selected effect.
85 * @param update (optional) Set the clip's selected effect (display keyframes in timeline) */
86 void slotItemSelectionChanged(bool update = true);
88 /** @brief Moves the selected effect upwards. */
91 /** @brief Moves the selected effect downwards. */
94 /** @brief Resets the selected effect to its default values. */
95 void slotResetEffect();
97 /** @brief Updates effect @param item if it was enabled or disabled. */
98 void slotItemChanged(QListWidgetItem *item);
100 /** @brief Saves the selected effect's values to a custom effect.
102 * TODO: save all effects into one custom effect */
103 void slotSaveEffect();
105 /** @brief Emits seekTimeline with position = clipstart + @param pos. */
106 void slotSeekTimeline(int pos);
108 /** @brief Makes the check all checkbox represent the check state of the effects. */
109 void slotUpdateCheckAllButton();
111 /** @brief Sets the check state of all effects according to @param state. */
112 void slotCheckAll(int state);
114 /** @brief Define the region filter for current effect. */
115 void slotRegionChanged();
118 void removeEffect(ClipItem*, QDomElement);
119 /** Parameters for an effect changed, update the filter in playlist */
120 void updateClipEffect(ClipItem*, QDomElement, QDomElement, int);
121 /** An effect in stack was moved, we need to regenerate
122 all effects for this clip in the playlist */
123 void refreshEffectStack(ClipItem *);
124 /** Enable or disable an effect */
125 void changeEffectState(ClipItem*, int, bool);
126 /** An effect in stack was moved */
127 void changeEffectPosition(ClipItem*, int, int);
128 /** an effect was saved, reload list */
129 void reloadEffects();
130 /** An effect with position parameter was changed, seek */
131 void seekTimeline(int);
132 /** The region effect for current effect was changed */
133 void updateClipRegion(ClipItem*, int, QString);