From: Jean-Baptiste Mardelle Date: Mon, 16 May 2011 19:31:36 +0000 (+0000) Subject: Fix issues with double values in effects drag widget, now the new LADSPA effects... X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=36e64bf3662dfdb7c4ded42bd2b218f707ffa4ac;p=kdenlive Fix issues with double values in effects drag widget, now the new LADSPA effects work svn path=/trunk/kdenlive/; revision=5592 --- diff --git a/src/doubleparameterwidget.cpp b/src/doubleparameterwidget.cpp index 342fe5f7..be8cbb59 100644 --- a/src/doubleparameterwidget.cpp +++ b/src/doubleparameterwidget.cpp @@ -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(); } diff --git a/src/doubleparameterwidget.h b/src/doubleparameterwidget.h index 52bad210..a3262ae1 100644 --- a/src/doubleparameterwidget.h +++ b/src/doubleparameterwidget.h @@ -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); }; diff --git a/src/dragvalue.h b/src/dragvalue.h index 5033f50b..b28e038b 100644 --- a/src/dragvalue.h +++ b/src/dragvalue.h @@ -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); diff --git a/src/effectstackedit.cpp b/src/effectstackedit.cpp index ad4df484..6a9ab4dd 100644 --- a/src/effectstackedit.cpp +++ b/src/effectstackedit.cpp @@ -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; diff --git a/src/keyframeedit.cpp b/src/keyframeedit.cpp index 8ecbbd12..7e6801e1 100644 --- a/src/keyframeedit.cpp +++ b/src/keyframeedit.cpp @@ -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 (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()); diff --git a/src/keyframeedit.h b/src/keyframeedit.h index 9c8716a2..210192e4 100644 --- a/src/keyframeedit.h +++ b/src/keyframeedit.h @@ -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); diff --git a/src/renderer.cpp b/src/renderer.cpp index 7331d452..e9f2dc6e 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -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::Iterator it;