]> git.sesse.net Git - kdenlive/blobdiff - src/effectstack/collapsibleeffect.h
collapsible effects cleanup
[kdenlive] / src / effectstack / collapsibleeffect.h
index 536adc9308426eef17e731671dce15c97093c0ef..b6766d7fb0536fae99cb955f16d748d4ddd0a093 100644 (file)
@@ -21,9 +21,6 @@
 #ifndef COLLAPSIBLEEFFECT_H
 #define COLLAPSIBLEEFFECT_H
 
-
-#include "ui_collapsiblewidget_ui.h"
-
 #include "abstractcollapsiblewidget.h"
 #include "timecode.h"
 #include "keyframeedit.h"
@@ -32,6 +29,8 @@
 #include <QToolButton>
 
 class QFrame;
+class QLabel;
+
 class Monitor;
 class GeometryWidget;
 
@@ -73,6 +72,7 @@ public:
     ~ParameterContainer();
     void updateTimecodeFormat();
     void updateProjectFormat(MltVideoProfile profile, Timecode t);
+    void updateParameter(const QString &key, const QString &value);
 
 private slots:
     void slotCollectAllParameters();
@@ -116,7 +116,7 @@ signals:
  * @author Jean-Baptiste Mardelle
  */
 
-class CollapsibleEffect : public AbstractCollapsibleWidget, public Ui::CollapsibleWidget_UI
+class CollapsibleEffect : public AbstractCollapsibleWidget
 {
     Q_OBJECT
 
@@ -124,9 +124,12 @@ public:
     CollapsibleEffect(QDomElement effect, QDomElement original_effect, ItemInfo info, EffectMetaInfo *metaInfo, bool lastEffect, QWidget * parent = 0);
     ~CollapsibleEffect();
     static QMap<QString, QImage> iconCache;
+    QLabel *title;
+       
     void setupWidget(ItemInfo info, EffectMetaInfo *metaInfo);
     void updateTimecodeFormat();
     void setActive(bool activate);
+    /** @brief Install event filter so that scrolling with mouse wheel does not change parameter value. */
     virtual bool eventFilter( QObject * o, QEvent * e );
     /** @brief Update effect GUI to reflect parameted changes. */
     void updateWidget(ItemInfo info, QDomElement effect, EffectMetaInfo *metaInfo);
@@ -142,13 +145,15 @@ public:
     bool isActive() const;
     /** @brief Should the wheel event be sent to parent widget for scrolling. */
     bool filterWheelEvent;
-    
     /** @brief Return the stylesheet required for effect parameters. */
-    static const QString getStyleSheet(QPalette p);
+    static const QString getStyleSheet();
+    /** @brief Parent group was collapsed, update. */
+    void groupStateChanged(bool collapsed);
 
 public slots:
     void slotSyncEffectsPos(int pos);
-    void slotEnable(bool enable);
+    void slotEnable(bool enable, bool updateMainStatus = true);
+    void slotResetEffect();
 
 private slots:
     void slotSwitch();
@@ -157,9 +162,11 @@ private slots:
     void slotEffectUp();
     void slotEffectDown();
     void slotSaveEffect();
-    void slotResetEffect();
     void slotCreateGroup();
+    void slotCreateRegion();
     void slotUnGroup();
+    /** @brief A sub effect parameter was changed */
+    void slotUpdateRegionEffectParams(const QDomElement /*old*/, const QDomElement /*e*/, int /*ix*/);
 
 private:
     ParameterContainer *m_paramWidget;
@@ -173,10 +180,14 @@ private:
     QMenu *m_menu;
     QPoint m_clickPoint;
     EffectInfo m_info;
+    /** @brief True if this is a region effect, which behaves in a special way, like a group. */
+    bool m_regionEffect;
+    /** @brief Check if collapsed state changed and inform MLT. */
+    void updateCollapsedState();
     
 protected:
     virtual void mouseDoubleClickEvent ( QMouseEvent * event );
-    virtual void mousePressEvent ( QMouseEvent * event );
+    virtual void mouseReleaseEvent( QMouseEvent *event );
     virtual void dragEnterEvent(QDragEnterEvent *event);
     virtual void dragLeaveEvent(QDragLeaveEvent *event);
     virtual void dropEvent(QDropEvent *event);
@@ -184,23 +195,20 @@ protected:
 signals:
     void parameterChanged(const QDomElement, const QDomElement, int);
     void syncEffectsPos(int);
-    void effectStateChanged(bool, int ix = -1);
+    void effectStateChanged(bool, int ix = -1, bool updateMainStatus = true);
     void deleteEffect(const QDomElement);
-    void changeEffectPosition(int, bool);
     void activateEffect(int);
     void checkMonitorPosition(int);
     void seekTimeline(int);
     /** @brief Start an MLT filter job on this clip. */
     void startFilterJob(QString filterName, QString filterParams, QString finalFilterName, QString consumer, QString consumerParams, QString properties);
-    /** @brief An effect was saved, trigger effect list reload. */
-    void reloadEffects();
     /** @brief An effect was reset, trigger param reload. */
     void resetEffect(int ix);
     /** @brief Ask for creation of a group. */
     void createGroup(int ix);
-    void moveEffect(int current_pos, int new_pos, int groupIndex, QString groupName);
     void unGroup(CollapsibleEffect *);
-    void addEffect(QDomElement e);
+    void createRegion(int, KUrl);
+    void deleteGroup(QDomDocument);
 };