]> git.sesse.net Git - kdenlive/blobdiff - src/effectstackedit.cpp
First work on rotoscoping GUI
[kdenlive] / src / effectstackedit.cpp
index 176052b48f18ab315e2a0e66ba45b837397c9849..892dd8511a3c6fd7e8fba8e69879049839c801a4 100644 (file)
@@ -35,6 +35,7 @@
 #include "doubleparameterwidget.h"
 #include "cornerswidget.h"
 #include "beziercurve/beziersplinewidget.h"
+#include "rotoscoping/rotowidget.h"
 
 #include <KDebug>
 #include <KLocale>
@@ -242,7 +243,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in
             m_vbox->addWidget(doubleparam);
             m_valueItems[paramName] = doubleparam;
             connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(collectAllParameters()));
-            connect(this, SIGNAL(showComments()), doubleparam, SLOT(slotShowComment()));
+            connect(this, SIGNAL(showComments(bool)), doubleparam, SLOT(slotShowComment(bool)));
         } else if (type == "list") {
             Listval *lsval = new Listval;
             lsval->setupUi(toFillin);
@@ -267,16 +268,24 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in
             }
             if (!value.isEmpty()) lsval->list->setCurrentIndex(listitems.indexOf(value));
             lsval->name->setText(paramName);
+            lsval->labelComment->setText(comment);
+            lsval->widgetComment->setHidden(true);
             m_valueItems[paramName] = lsval;
             connect(lsval->list, SIGNAL(currentIndexChanged(int)) , this, SLOT(collectAllParameters()));
+            if (!comment.isEmpty())
+                connect(this, SIGNAL(showComments(bool)), lsval->widgetComment, SLOT(setVisible(bool)));
             m_uiItems.append(lsval);
         } else if (type == "bool") {
             Boolval *bval = new Boolval;
             bval->setupUi(toFillin);
             bval->checkBox->setCheckState(value == "0" ? Qt::Unchecked : Qt::Checked);
             bval->name->setText(paramName);
+            bval->labelComment->setText(comment);
+            bval->widgetComment->setHidden(true);
             m_valueItems[paramName] = bval;
             connect(bval->checkBox, SIGNAL(stateChanged(int)) , this, SLOT(collectAllParameters()));
+            if (!comment.isEmpty())
+                connect(this, SIGNAL(showComments(bool)), bval->widgetComment, SLOT(setVisible(bool)));
             m_uiItems.append(bval);
         } else if (type == "complex") {
             ComplexParameter *pl = new ComplexParameter;
@@ -322,6 +331,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in
                     corners->slotShowScene(!disable);
                     connect(corners, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
                     connect(this, SIGNAL(effectStateChanged(bool)), corners, SLOT(slotShowScene(bool)));
+                    connect(this, SIGNAL(syncEffectsPos(int)), corners, SLOT(slotSyncPosition(int)));
                     geo = static_cast<KeyframeEdit *>(corners);
                 } else {
                     geo = new KeyframeEdit(pa, m_in, m_in + m_out, m_timecode, e.attribute("active_keyframe", "-1").toInt());
@@ -331,7 +341,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in
                 m_keyframeEditor = geo;
                 connect(geo, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
                 connect(geo, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
-                connect(this, SIGNAL(showComments()), geo, SIGNAL(showComments()));
+                connect(this, SIGNAL(showComments(bool)), geo, SIGNAL(showComments(bool)));
             } else {
                 // we already have a keyframe editor, so just add another column for the new param
                 m_keyframeEditor->addParameter(pa);
@@ -398,6 +408,15 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in
             QString depends = pa.attribute("depends");
             if (!depends.isEmpty())
                 meetDependency(paramName, type, EffectsList::parameter(e, depends));
+        } else if (type == "roto-spline") {
+            RotoWidget *roto = new RotoWidget(value, m_monitor, m_in, m_out, this);
+            roto->slotShowScene(!disable);
+            connect(roto, SIGNAL(valueChanged()), this, SLOT(collectAllParameters()));
+            connect(roto, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
+            connect(this, SIGNAL(syncEffectsPos(int)), roto, SLOT(slotSyncPosition(int)));
+            connect(this, SIGNAL(effectStateChanged(bool)), roto, SLOT(slotShowScene(bool)));
+            m_vbox->addWidget(roto);
+            m_valueItems[paramName] = roto;
         } else if (type == "wipe") {
             Wipeval *wpval = new Wipeval;
             wpval->setupUi(toFillin);
@@ -663,6 +682,9 @@ void EffectStackEdit::collectAllParameters()
             QString depends = pa.attributes().namedItem("depends").nodeValue();
             if (!depends.isEmpty())
                 meetDependency(paramName, type, EffectsList::parameter(newparam, depends));
+        } else if (type == "roto-spline") {
+            RotoWidget *widget = static_cast<RotoWidget *>(m_valueItems.value(paramName));
+            setValue = widget->getSpline();
         } else if (type == "wipe") {
             Wipeval *wp = (Wipeval*)m_valueItems.value(paramName);
             wipeInfo info;