]> git.sesse.net Git - kdenlive/commitdiff
Fix issues with double values in effects drag widget, now the new LADSPA effects...
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 16 May 2011 19:31:36 +0000 (19:31 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 16 May 2011 19:31:36 +0000 (19:31 +0000)
svn path=/trunk/kdenlive/; revision=5592

src/doubleparameterwidget.cpp
src/doubleparameterwidget.h
src/dragvalue.h
src/effectstackedit.cpp
src/keyframeedit.cpp
src/keyframeedit.h
src/renderer.cpp

index 342fe5f791b066ca3e3380f83e74c9a297ba8bd7..be8cbb590d8e19661687c93c6de655067e3f5d0a 100644 (file)
@@ -54,7 +54,7 @@ DoubleParameterWidget::DoubleParameterWidget(const QString &name, double value,
         layout->addWidget(m_commentLabel, 1, 0, 1, -1);
     }
     m_dragVal->setValue(value);
-    connect(m_dragVal, SIGNAL(valueChanged(int, bool)), this, SLOT(slotSetValue(int, bool)));
+    connect(m_dragVal, SIGNAL(valueChanged(double, bool)), this, SLOT(slotSetValue(double, bool)));
     connect(m_dragVal, SIGNAL(inTimeline(int)), this, SIGNAL(setInTimeline(int)));
 }
 
@@ -68,21 +68,22 @@ void DoubleParameterWidget::setSpinSize(int width)
     m_dragVal->setSpinSize(width);
 }
 
-void DoubleParameterWidget::setValue(int value)
+void DoubleParameterWidget::setValue(double value)
 {
     m_dragVal->blockSignals(true);
     m_dragVal->setValue(value);
     m_dragVal->blockSignals(false);
 }
 
-void DoubleParameterWidget::slotSetValue(int value, bool final)
+void DoubleParameterWidget::slotSetValue(double value, bool final)
 {
+    kDebug()<<"VALUE CHANGED: "<<value;
     if (final) {
         emit valueChanged(value);
     }
 }
 
-int DoubleParameterWidget::getValue()
+double DoubleParameterWidget::getValue()
 {
     return m_dragVal->value();
 }
index 52bad2101c8c47d9bdc266f143de892c02a8bfbb..a3262ae1998b8526e4f79a255974de83e73a6fda 100644 (file)
@@ -53,7 +53,7 @@ public:
     DoubleParameterWidget(const QString &name, double value, double min, double max, double defaultValue, const QString &comment, int id, const QString suffix = QString(), int decimals = 0, QWidget* parent = 0);
 
     /** @brief Gets the parameter's value. */
-    int getValue();
+    double getValue();
     /** @brief Set the inTimeline property to paint widget with other colors. */
     void setInTimelineProperty(bool intimeline);
     /** @brief Returns minimum size for QSpinBox, used to set all spinboxes to the same width. */
@@ -62,7 +62,7 @@ public:
 
 public slots:
     /** @brief Sets the value to @param value. */
-    void setValue(int value);
+    void setValue(double value);
 
     /** @brief Sets value to m_default. */
     void slotReset();
@@ -71,7 +71,7 @@ private slots:
     /** @brief Shows/Hides the comment label. */
     void slotShowComment(bool show);
 
-    void slotSetValue(int value, bool final);
+    void slotSetValue(double value, bool final);
 
 private:
     QLabel *m_name;
@@ -81,7 +81,7 @@ private:
     QLabel *m_commentLabel;
     
 signals:
-    void valueChanged(int);
+    void valueChanged(double);
     /** @brief User wants to see this parameter in timeline. */
     void setInTimeline(int);
 };
index 5033f50b3c499d7d35cbccb0a200422601360f63..b28e038b65b938688e511e2899efc9362ee0eeca 100644 (file)
@@ -124,7 +124,6 @@ public slots:
     void slotReset();
 
 signals:
-    void valueChanged(int value, bool final = true);
     void valueChanged(double value, bool final = true);
     void inTimeline(int);
 
index ad4df484dca03fa0cf5e70f9cb5164e1941ce38e..6a9ab4dd3267d0db61e65b608874962887ff568a 100644 (file)
@@ -274,7 +274,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, ItemInfo info, bool
                     pa.attribute("default").toDouble(), comment, -1, pa.attribute("suffix"), pa.attribute("decimals").toInt(), this);
             m_vbox->addWidget(doubleparam);
             m_valueItems[paramName] = doubleparam;
-            connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(collectAllParameters()));
+            connect(doubleparam, SIGNAL(valueChanged(double)), this, SLOT(collectAllParameters()));
             connect(this, SIGNAL(showComments(bool)), doubleparam, SLOT(slotShowComment(bool)));
         } else if (type == "list") {
             Listval *lsval = new Listval;
index 8ecbbd120c688d9bed2efae9d223679fccebd52a..7e6801e11a70821e1039b3bea9d9858d88376d82 100644 (file)
@@ -118,7 +118,7 @@ void KeyframeEdit::addParameter(QDomElement e, int activeKeyframe)
     DoubleParameterWidget *doubleparam = new DoubleParameterWidget(paramName, 0,
             m_params.at(columnId).attribute("min").toDouble(), m_params.at(columnId).attribute("max").toDouble(),
             m_params.at(columnId).attribute("default").toDouble(), comment, columnId, m_params.at(columnId).attribute("suffix"), m_params.at(columnId).attribute("decimals").toInt(), this);
-    connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustKeyframeValue(int)));
+    connect(doubleparam, SIGNAL(valueChanged(double)), this, SLOT(slotAdjustKeyframeValue(double)));
     connect(this, SIGNAL(showComments(bool)), doubleparam, SLOT(slotShowComment(bool)));
     connect(doubleparam, SIGNAL(setInTimeline(int)), this, SLOT(slotUpdateVisibleParameter(int)));
     m_slidersLayout->addWidget(doubleparam, columnId, 0);
@@ -343,7 +343,7 @@ void KeyframeEdit::slotAdjustKeyframeInfo(bool seek)
             continue;
         doubleparam->blockSignals(true);
         if (keyframe_list->item(item->row(), col)) {
-            doubleparam->setValue(keyframe_list->item(item->row(), col)->text().toInt());
+            doubleparam->setValue(keyframe_list->item(item->row(), col)->text().toDouble());
         } else {
             kDebug() << "Null pointer exception caught: http://www.kdenlive.org/mantis/view.php?id=1771";
         }
@@ -362,7 +362,7 @@ void KeyframeEdit::slotAdjustKeyframePos(int value)
         emit seekToPos(value - m_min);
 }
 
-void KeyframeEdit::slotAdjustKeyframeValue(int value)
+void KeyframeEdit::slotAdjustKeyframeValue(double value)
 {
     Q_UNUSED(value)
 
@@ -371,9 +371,9 @@ void KeyframeEdit::slotAdjustKeyframeValue(int value)
         DoubleParameterWidget *doubleparam = static_cast <DoubleParameterWidget*>(m_slidersLayout->itemAtPosition(col, 0)->widget());
         if (!doubleparam)
             continue;
-        int val = doubleparam->getValue();
+        double val = doubleparam->getValue();
         QTableWidgetItem *nitem = keyframe_list->item(item->row(), col);
-        if (nitem && nitem->text().toInt() != val)
+        if (nitem && nitem->text().toDouble() != val)
             nitem->setText(QString::number(val));
     }
     //keyframe_list->item(item->row() - 1, item->column());
index 9c8716a2188cd6ef1f0d37323000af89713031ec..210192e48a8c653b125bbd7548d8c5ff843d5c23 100644 (file)
@@ -121,7 +121,7 @@ private slots:
     void slotAddKeyframe();
     void slotGenerateParams(int row, int column);
     void slotAdjustKeyframePos(int value);
-    void slotAdjustKeyframeValue(int value);
+    void slotAdjustKeyframeValue(double value);
     /** @brief Turns the seek to keyframe position setting on/off.
     * @param seek true = seeking on */
     void slotSetSeeking(bool seek);
index 7331d4526126385b538f2fffba713da2a3b00b69..e9f2dc6ea897a8781da4f26915a6be4532e5be81 100644 (file)
@@ -2479,7 +2479,6 @@ bool Render::mltAddEffect(Mlt::Service service, EffectsParameterList params, int
     // create filter
     QString tag =  params.paramValue("tag");
     kDebug() << " / / INSERTING EFFECT: " << tag << ", REGI: " << region;
-    if (tag.startsWith("ladspa")) tag = "ladspa";
     char *filterTag = qstrdup(tag.toUtf8().constData());
     char *filterId = qstrdup(params.paramValue("id").toUtf8().constData());
     QHash<QString, QString>::Iterator it;