X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fkeyframeedit.cpp;h=7e6801e11a70821e1039b3bea9d9858d88376d82;hb=459897cce1528ca378985269e6ea70f21d49422b;hp=f502b69c07d873e10ea204b75f45a0ef2a0373af;hpb=7c7ab29f851cbc41b3738744eb12061e43976f84;p=kdenlive diff --git a/src/keyframeedit.cpp b/src/keyframeedit.cpp index f502b69c..7e6801e1 100644 --- a/src/keyframeedit.cpp +++ b/src/keyframeedit.cpp @@ -116,9 +116,9 @@ void KeyframeEdit::addParameter(QDomElement e, int activeKeyframe) keyframe_list->setHorizontalHeaderItem(columnId, new QTableWidgetItem(paramName)); DoubleParameterWidget *doubleparam = new DoubleParameterWidget(paramName, 0, - m_params.at(columnId).attribute("min").toInt(), m_params.at(columnId).attribute("max").toInt(), - m_params.at(columnId).attribute("default").toInt(), comment, columnId, m_params.at(columnId).attribute("suffix"), this); - connect(doubleparam, SIGNAL(valueChanged(int)), this, SLOT(slotAdjustKeyframeValue(int))); + 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(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); @@ -192,15 +192,15 @@ void KeyframeEdit::slotAddKeyframe() newrow++; } else if (row == 0) { if (pos1 == m_min) { - result = m_max - 1; + result = m_max; newrow++; } else { result = m_min; } } else { - if (pos1 < m_max - 1) { + if (pos1 < m_max) { // last keyframe selected and it is not at end of clip -> add keyframe at the end - result = m_max - 1; + result = m_max; newrow++; } else { int pos2 = getPos(row - 1); @@ -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,18 +362,18 @@ void KeyframeEdit::slotAdjustKeyframePos(int value) emit seekToPos(value - m_min); } -void KeyframeEdit::slotAdjustKeyframeValue(int value) +void KeyframeEdit::slotAdjustKeyframeValue(double value) { - Q_UNUSED(value); + Q_UNUSED(value) QTableWidgetItem *item = keyframe_list->currentItem(); for (int col = 0; col < keyframe_list->columnCount(); col++) { 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());