]> git.sesse.net Git - kdenlive/blobdiff - src/effectstack/effectstackview2.h
First steps for the incredible filter region
[kdenlive] / src / effectstack / effectstackview2.h
index 7d41c0e132a531fbb55af5ea7d22e915dd50a333..1c4b5e680e83df2c72c572281ccdb474cf90fe14 100644 (file)
@@ -2,8 +2,8 @@
                           effecstackview2.h  -  description
                              -------------------
     begin                : Feb 15 2008
-    copyright            : (C) 2008 by Marco Gittler
-    email                : g.marco@freenet.de
+    copyright            : (C) 2008 by Marco Gittler (g.marco@freenet.de)
+    copyright            : (C) 2012 by Jean-Baptiste Mardelle (jb@kdenlive.org) 
  ***************************************************************************/
 
 /***************************************************************************
@@ -27,6 +27,7 @@
 #include "ui_effectstack2_ui.h"
 #include "effectstackedit.h"
 #include "collapsibleeffect.h"
+#include "collapsiblegroup.h"
 
 class EffectsList;
 class ClipItem;
@@ -45,10 +46,6 @@ public:
     /** @brief Raises @param dock if a clip is loaded. */
     void raiseWindow(QWidget* dock);
 
-    /** @brief Sets the add effect button's menu to @param menu. */
-    void setMenu(QMenu *menu);
-
-
     /** @brief return the index of the track displayed in effect stack
      ** @param ok set to true if we are looking at a track's effects, otherwise false. */
     int isTrackMode(bool *ok) const;
@@ -61,35 +58,65 @@ public:
 
     /** @brief Tells the effect editor to update its timecode format. */
     void updateTimecodeFormat();
-
+    
+    /** @brief Used to trigger drag effects. */
+    virtual bool eventFilter( QObject * o, QEvent * e );
+    
+    CollapsibleEffect *getEffectByIndex(int ix);
+    
+    /** @brief Delete currently selected effect. */
+    void deleteCurrentEffect();
+    
+    /** @brief Palette was changed, update style. */
+    void updatePalette();
+
+protected:
+    virtual void mouseMoveEvent(QMouseEvent * event);
+    virtual void mouseReleaseEvent(QMouseEvent * event);
+    virtual void resizeEvent ( QResizeEvent * event );
+  
 private:
     Ui::EffectStack2_UI m_ui;
     ClipItem* m_clipref;
     QList <CollapsibleEffect*> m_effects;
     EffectsList m_currentEffectList;
+    
+    /** @brief Contains infos about effect like is it a track effect, which monitor displays it,... */
     EffectMetaInfo m_effectMetaInfo;
-    QWidget *m_view;
+    
+    /** @brief The last mouse click position, used to detect drag events. */
+    QPoint m_clickPoint;
 
     /** @brief The track index of currently edited track. */
     int m_trackindex;
 
     /** If in track mode: Info of the edited track to be able to access its duration. */
     TrackInfo m_trackInfo;
-
-    /** @brief Sets the list of effects according to the clip's effect list.
-    * @param ix Number of the effect to preselect */
-    void setupListView(int ix);
+    
+    /** @brief The effect currently being dragged, NULL if no drag happening. */
+    CollapsibleEffect *m_draggedEffect;
+    
+    /** @brief The effect currently being dragged, NULL if no drag happening. */
+    CollapsibleGroup *m_draggedGroup;
+    
+    /** @brief The current number of groups. */
+    int m_groupIndex;
+
+    /** @brief Sets the list of effects according to the clip's effect list. */
+    void setupListView();
+    
+    /** @brief Build the drag info and start it. */
+    void startDrag();
 
 public slots:
     /** @brief Sets the clip whose effect list should be managed.
-    * @param c Clip whose effect list should be managed
-    * @param ix Effect to preselect */
-    void slotClipItemSelected(ClipItem* c, int ix);
+    * @param c Clip whose effect list should be managed */
+    void slotClipItemSelected(ClipItem* c);
 
     void slotTrackItemSelected(int ix, const TrackInfo info);
-
-    /** @brief Removes the selected effect. */
-    void slotItemDel();
+   
+    /** @brief Check if the mouse wheel events should be used for scrolling the widget view. */
+    void slotCheckWheelEventFilter();
 
 private slots:
 
@@ -108,24 +135,63 @@ private slots:
     /** @brief Move an effect in the stack.
      * @param index The effect index in the stack
      * @param up true if we want to move effect up, false for down */
-    void slotMoveEffect(int index, bool up);
+    void slotMoveEffectUp(int index, bool up);
 
     /** @brief Delete an effect in the stack. */
-    void slotDeleteEffect(const QDomElement effect, int index);
+    void slotDeleteEffect(const QDomElement effect);
+    
+    /** @brief Delete all effect in a group. */
+    void slotDeleteGroup(QDomDocument doc);
 
     /** @brief Pass position changes of the timeline cursor to the effects to keep their local timelines in sync. */
     void slotRenderPos(int pos);
 
     /** @brief Called whenever an effect is enabled / disabled by user. */
-    void slotUpdateEffectState(bool disable, int index);
+    void slotUpdateEffectState(bool disable, int index, bool updateMainStatus);
 
     void slotSetCurrentEffect(int ix);
-
+    
+    /** @brief Triggers a filter job on this clip. */
+    void slotStartFilterJob(const QString&filterName, const QString&filterParams, const QString&finalFilterName, const QString&consumer, const QString&consumerParams, const QString&properties);
+    
+    /** @brief Reset an effect to its default values. */
+    void slotResetEffect(int ix);
+    
+    /** @brief Create a group containing effect with ix index. */
+    void slotCreateGroup(int ix);
+    
+    /** @brief Create a region effect with ix index. */
+    void slotCreateRegion(int ix, KUrl url);
+    
+    /** @brief Move an effect into a group.
+      ** @param ix the index of effect to move in stack layout
+      ** @param group the effect on which the effect was dropped
+      ** @param lastEffectIndex the last effect index in the group, effect will be inserted after that index
+      */
+    void slotMoveEffect(int currentIndex, int newIndex, int groupIndex, QString groupName = QString());
+    
+    /** @brief Remove effects from a group */
+    void slotUnGroup(CollapsibleGroup* group);
+    
+    /** @brief Add en effect to selected clip */
+    void slotAddEffect(QDomElement effect);
+    
+    /** @brief Enable / disable all effects for the clip */
+    void slotCheckAll(int state);
+    
+    /** @brief Update check all button status */
+    void slotUpdateCheckAllButton();
+    
+    /** @brief Display additionnal effect info */
+    void slotShowComments();
+    
+    /** @brief An effect group was renamed, update effects info */
+    void slotRenameGroup(CollapsibleGroup *group);
 
 signals:
     void removeEffect(ClipItem*, int, QDomElement);
     /**  Parameters for an effect changed, update the filter in playlist */
-    void updateEffect(ClipItem*, int, QDomElement, QDomElement, int);
+    void updateEffect(ClipItem*, int, QDomElement, QDomElement, int,bool);
     /** An effect in stack was moved, we need to regenerate
         all effects for this clip in the playlist */
     void refreshEffectStack(ClipItem *);
@@ -141,6 +207,8 @@ signals:
     void updateClipRegion(ClipItem*, int, QString);
     void displayMessage(const QString&, int);
     void showComments(bool show);
+    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);
+    void addEffect(ClipItem*,QDomElement);
 };
 
 #endif