]> git.sesse.net Git - kdenlive/blobdiff - src/effectstackedit.cpp
*Allow users to choose between SDL and OpenGL for monitor display
[kdenlive] / src / effectstackedit.cpp
index 5b87920d7570c8b3fd45487f2468aa0eb21c3a7c..24bf49160accf6f9b03f57a4df4e0909a7b85051 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
-                          effecstackview.cpp  -  description
+                          effecstackedit.cpp  -  description
                              -------------------
     begin                : Feb 15 2008
     copyright            : (C) 2008 by Marco Gittler
@@ -145,10 +145,7 @@ void EffectStackEdit::meetDependency(const QString& name, QString type, QString
         KisCurveWidget *curve = (KisCurveWidget*)m_valueItems[name];
         if (curve) {
             int color = value.toInt();
-            if (color < 3)
-                curve->setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(curve->size(), (ColorTools::ColorsRGB)color)));
-            else
-                curve->setPixmap(QPixmap());
+            curve->setPixmap(QPixmap::fromImage(ColorTools::rgbCurvePlane(curve->size(), (ColorTools::ColorsRGB)color, 0.8)));
         }
     }
 }
@@ -218,7 +215,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in
                 max = pa.attribute("max").toInt();
 
             DoubleParameterWidget *doubleparam = new DoubleParameterWidget(paramName, (int)(value.toDouble() + 0.5), min, max,
-                                                                           pa.attribute("default").toInt(), pa.attribute("suffix"), this);
+                    pa.attribute("default").toInt(), pa.attribute("suffix"), this);
             m_vbox->addWidget(doubleparam);
             m_valueItems[paramName] = doubleparam;
             connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(collectAllParameters()));
@@ -263,14 +260,15 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in
         } else if (type == "geometry") {
             if (KdenliveSettings::on_monitor_effects()) {
                 GeometryWidget *geometry = new GeometryWidget(m_monitor, m_timecode, pos, isEffect, this);
+                // connect this before setupParam to make sure the monitor scene shows up at startup
+                connect(geometry, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
+                connect(geometry, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
                 if (minFrame == maxFrame)
                     geometry->setupParam(pa, m_in, m_out);
                 else
                     geometry->setupParam(pa, minFrame, maxFrame);
                 m_vbox->addWidget(geometry);
                 m_valueItems[paramName+"geometry"] = geometry;
-                connect(geometry, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
-                connect(geometry, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
                 connect(geometry, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
                 connect(this, SIGNAL(syncEffectsPos(int)), geometry, SLOT(slotSyncPosition(int)));
             } else {
@@ -314,9 +312,9 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in
                 pos = pos - m_in;
             } else if (d.attribute("id") == "fadeout" || d.attribute("id") == "fade_to_black") {
                 // fadeout position starts from clip end
-                pos = m_out - (pos - m_in);
+                pos = m_out - pos;
             }
-            PositionEdit *posedit = new PositionEdit(paramName, pos, 1, m_out, m_timecode);
+            PositionEdit *posedit = new PositionEdit(paramName, pos, 0, m_out - m_in, m_timecode);
             m_vbox->addWidget(posedit);
             m_valueItems[paramName+"position"] = posedit;
             connect(posedit, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
@@ -582,8 +580,8 @@ void EffectStackEdit::collectAllParameters()
                     pos = m_out;
                     pedit->setPosition(pos);
                 }*/
-                EffectsList::setParameter(newparam, "in", QString::number(m_out + m_in - pos));
-                EffectsList::setParameter(newparam, "out", QString::number(m_out + m_in));
+                EffectsList::setParameter(newparam, "in", QString::number(m_out - pos));
+                EffectsList::setParameter(newparam, "out", QString::number(m_out));
                 setValue.clear();
             }
         } else if (type == "curve") {
@@ -641,7 +639,7 @@ void EffectStackEdit::collectAllParameters()
         } else if ((type == "simplekeyframe" || type == "keyframe") && m_keyframeEditor) {
             QString realName = i18n(na.toElement().text().toUtf8().data());
             QString val = m_keyframeEditor->getValue(realName);
-            kDebug() << "SET VALUE: " << val;
+            //kDebug() << "SET VALUE: " << val;
             namenode.item(i).toElement().setAttribute("keyframes", val);
         } else if (type == "url") {
             KUrlRequester *req = ((Urlval*)m_valueItems.value(paramName))->urlwidget;