]> git.sesse.net Git - kdenlive/blobdiff - src/effectstackedit.cpp
Fix compilation on Qt 4.5:
[kdenlive] / src / effectstackedit.cpp
index a6252d7598815b9e85efc19f5740af176ba0bc5f..0ba3aa1d1ead54fcbd6d17d549e06be646e6c2ed 100644 (file)
 #include "ui_boolval_ui.h"
 #include "ui_colorval_ui.h"
 #include "ui_wipeval_ui.h"
+#include "ui_urlval_ui.h"
 #include "complexparameter.h"
 #include "geometryval.h"
 #include "positionedit.h"
+#include "projectlist.h"
 #include "effectslist.h"
 #include "kdenlivesettings.h"
 #include "profilesdialog.h"
@@ -32,6 +34,7 @@
 
 #include <KDebug>
 #include <KLocale>
+#include <KFileDialog>
 
 #include <QVBoxLayout>
 #include <QSlider>
@@ -61,6 +64,9 @@ class Wipeval: public QWidget, public Ui::Wipeval_UI
 {
 };
 
+class Urlval: public QWidget, public Ui::Urlval_UI
+{
+};
 
 QMap<QString, QImage> EffectStackEdit::iconCache;
 
@@ -123,6 +129,11 @@ void EffectStackEdit::updateTimecodeFormat()
             geom->updateTimecodeFormat();
             break;
         }
+        if (type == "position") {
+            PositionEdit *posi = ((PositionEdit*)m_valueItems[paramName+"position"]);
+            posi->updateTimecodeFormat();
+            break;
+        }
     }
 }
 
@@ -137,7 +148,7 @@ void EffectStackEdit::updateParameter(const QString &name, const QString &value)
     m_params.setAttribute(name, value);
 }
 
-void EffectStackEdit::transferParamDesc(const QDomElement d, int in, int out)
+void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, int out)
 {
     clearAllItems();
     if (m_keyframeEditor) delete m_keyframeEditor;
@@ -246,12 +257,13 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int in, int out)
             m_valueItems[paramName+"complex"] = pl;
             connect(pl, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
         } else if (type == "geometry") {
-            Geometryval *geo = new Geometryval(m_profile, m_timecode, m_frameSize, m_in);
-            geo->setupParam(pa, minFrame, maxFrame);
+            Geometryval *geo = new Geometryval(m_profile, m_timecode, m_frameSize, pos);
+            if (minFrame == maxFrame) geo->setupParam(pa, m_in, m_out);
+            else geo->setupParam(pa, minFrame, maxFrame);
             m_vbox->addWidget(geo);
             m_valueItems[paramName+"geometry"] = geo;
             connect(geo, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
-            connect(geo, SIGNAL(seekToPos(int)), this, SLOT(slotSeekToPos(int)));
+            connect(geo, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
         } else if (type == "keyframe" || type == "simplekeyframe") {
             // keyframe editor widget
             kDebug() << "min: " << m_in << ", MAX: " << m_out;
@@ -261,7 +273,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int in, int out)
                 m_valueItems[paramName+"keyframe"] = geo;
                 m_keyframeEditor = geo;
                 connect(geo, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
-                connect(geo, SIGNAL(seekToPos(int)), this, SLOT(slotSeekToPos(int)));
+                connect(geo, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
             } else {
                 // we already have a keyframe editor, so just add another column for the new param
                 m_keyframeEditor->addParameter(pa);
@@ -370,6 +382,16 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int in, int out)
             connect(wpval->end_transp, SIGNAL(valueChanged(int)), this, SLOT(collectAllParameters()));
             //wpval->title->setTitle(na.toElement().text());
             m_uiItems.append(wpval);
+        } else if (type == "url") {
+            Urlval *cval = new Urlval;
+            cval->setupUi(toFillin);
+            cval->label->setText(paramName);
+            cval->urlwidget->fileDialog()->setFilter(ProjectList::getExtensions());
+            m_valueItems[paramName] = cval;
+            cval->urlwidget->setUrl(KUrl(value));
+            connect(cval->urlwidget, SIGNAL(returnPressed()) , this, SLOT(collectAllParameters()));
+            connect(cval->urlwidget, SIGNAL(urlSelected(const KUrl&)) , this, SLOT(collectAllParameters()));
+            m_uiItems.append(cval);
         } else {
             delete toFillin;
             toFillin = NULL;
@@ -382,11 +404,6 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int in, int out)
     m_vbox->addStretch();
 }
 
-void EffectStackEdit::slotSeekToPos(int pos)
-{
-    emit seekTimeline(pos);
-}
-
 wipeInfo EffectStackEdit::getWipeInfo(QString value)
 {
     wipeInfo info;
@@ -558,6 +575,9 @@ void EffectStackEdit::collectAllParameters()
             QString val = m_keyframeEditor->getValue(realName);
             kDebug() << "SET VALUE: " << val;
             namenode.item(i).toElement().setAttribute("keyframes", val);
+        } else if (type == "url") {
+            KUrlRequester *req = ((Urlval*)m_valueItems.value(paramName))->urlwidget;
+            setValue = req->url().path();
         }
         if (!setValue.isNull()) {
             pa.attributes().namedItem("value").setNodeValue(setValue);