X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fkeyframeedit.cpp;h=0d4bc1d3fe71f272b257974b2ad4925d8a09d010;hb=b6e074e4f5371c4994b233e7a9f07931a7a08a53;hp=8ecbbd120c688d9bed2efae9d223679fccebd52a;hpb=4359bf84c589b4cdd98c4591b1571fd8366cb112;p=kdenlive diff --git a/src/keyframeedit.cpp b/src/keyframeedit.cpp index 8ecbbd12..0d4bc1d3 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); @@ -126,7 +126,7 @@ void KeyframeEdit::addParameter(QDomElement e, int activeKeyframe) doubleparam->setInTimelineProperty(true); } - QStringList frames = e.attribute("keyframes").split(";", QString::SkipEmptyParts); + QStringList frames = e.attribute("keyframes").split(';', QString::SkipEmptyParts); for (int i = 0; i < frames.count(); i++) { int frame = frames.at(i).section(':', 0, 0).toInt(); bool found = false; @@ -242,6 +242,7 @@ void KeyframeEdit::slotGenerateParams(int row, int column) for (int col = 0; col < keyframe_list->horizontalHeader()->count(); col++) { item = keyframe_list->item(row, col); + if (!item) continue; int v = item->text().toInt(); if (v >= m_params.at(col).attribute("max").toInt()) item->setText(m_params.at(col).attribute("max")); @@ -343,7 +344,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 +363,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 +372,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()); @@ -462,7 +463,7 @@ void KeyframeEdit::checkVisibleParam() if (m_params.count() == 0) return; - foreach(QDomElement elem, m_params) { + foreach(const QDomElement &elem, m_params) { if (elem.attribute("intimeline") == "1") return; } @@ -470,4 +471,10 @@ void KeyframeEdit::checkVisibleParam() slotUpdateVisibleParameter(0); } +void KeyframeEdit::slotUpdateRange(int inPoint, int outPoint) +{ + m_min = inPoint; + m_max = outPoint; +} + #include "keyframeedit.moc"