Commit 3ffea885 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix crash and keyframe corruption on cli pwith multiple keyframable params

parent f7a96a96
......@@ -99,7 +99,6 @@ KeyframeWidget::KeyframeWidget(std::shared_ptr<AssetParameterModel> model, QMode
Monitor *monitor = pCore->getMonitor(m_model->monitorId);
connect(monitor, &Monitor::seekPosition, this, &KeyframeWidget::monitorSeek, Qt::UniqueConnection);
connect(monitor, &Monitor::seekToKeyframe, this, &KeyframeWidget::slotSeekToKeyframe, Qt::UniqueConnection);
m_time = new TimecodeDisplay(pCore->timecode(), this);
m_time->setRange(0, duration - 1);
......@@ -287,7 +286,7 @@ void KeyframeWidget::slotAtKeyframe(bool atKeyframe, bool singleKeyframe)
m_buttonAddDelete->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
m_buttonAddDelete->setToolTip(i18n("Add keyframe"));
}
pCore->getMonitor(m_model->monitorId)->setEffectKeyframe(atKeyframe || singleKeyframe);
emit updateEffectKeyframe(atKeyframe || singleKeyframe);
m_selectType->setEnabled(atKeyframe || singleKeyframe);
for (const auto &w : m_parameters) {
w.second->setEnabled(atKeyframe || singleKeyframe);
......@@ -406,12 +405,12 @@ void KeyframeWidget::addParameter(const QPersistentModelIndex &index)
void KeyframeWidget::slotInitMonitor(bool active)
{
connectMonitor(active);
Monitor *monitor = pCore->getMonitor(m_model->monitorId);
if (m_keyframeview) {
m_keyframeview->initKeyframePos();
connect(monitor, &Monitor::updateScene, m_keyframeview, &KeyframeView::slotModelChanged, Qt::UniqueConnection);
}
connectMonitor(active);
}
void KeyframeWidget::connectMonitor(bool active)
......@@ -426,10 +425,14 @@ void KeyframeWidget::connectMonitor(bool active)
connect(monitor, &Monitor::seekToNextKeyframe, m_keyframeview, &KeyframeView::slotGoToNext, Qt::UniqueConnection);
connect(monitor, &Monitor::seekToPreviousKeyframe, m_keyframeview, &KeyframeView::slotGoToPrev, Qt::UniqueConnection);
connect(monitor, &Monitor::addRemoveKeyframe, m_keyframeview, &KeyframeView::slotAddRemove, Qt::UniqueConnection);
connect(this, &KeyframeWidget::updateEffectKeyframe, monitor, &Monitor::setEffectKeyframe, Qt::DirectConnection);
connect(monitor, &Monitor::seekToKeyframe, this, &KeyframeWidget::slotSeekToKeyframe, Qt::UniqueConnection);
} else {
disconnect(monitor, &Monitor::seekToNextKeyframe, m_keyframeview, &KeyframeView::slotGoToNext);
disconnect(monitor, &Monitor::seekToPreviousKeyframe, m_keyframeview, &KeyframeView::slotGoToPrev);
disconnect(monitor, &Monitor::addRemoveKeyframe, m_keyframeview, &KeyframeView::slotAddRemove);
disconnect(this, &KeyframeWidget::updateEffectKeyframe, monitor, &Monitor::setEffectKeyframe);
disconnect(monitor, &Monitor::seekToKeyframe, this, &KeyframeWidget::slotSeekToKeyframe);
}
for (const auto &w : m_parameters) {
auto type = m_model->data(w.first, AssetParameterModel::TypeRole).value<ParamType>();
......
......@@ -104,6 +104,7 @@ private:
signals:
void addIndex(QPersistentModelIndex ix);
void setKeyframes(const QString &);
void updateEffectKeyframe(bool);
};
#endif
......@@ -48,6 +48,9 @@ Item {
onWidthChanged: {
clipMonitorRuler.updateRuler()
}
onIskeyframeChanged: {
console.log('KEYFRAME CHANGED: ', iskeyframe,'\n\n.............................')
}
FontMetrics {
id: fontMetrics
......@@ -233,6 +236,7 @@ Item {
}
onDoubleClicked: {
console.log('ADDREMOVE ON DBL')
controller.addRemoveKeyframe()
}
onReleased: {
......@@ -281,6 +285,7 @@ Item {
}
onPressed: {
if (root.iskeyframe == false && controller.autoKeyframe) {
console.log('ADDREMOVE THAND PRESSED')
controller.addRemoveKeyframe();
}
oldMouseX = mouseX
......@@ -362,6 +367,7 @@ Item {
}
onPressed: {
if (root.iskeyframe == false && controller.autoKeyframe) {
console.log('ADDREMOVE TRAND PRESSED')
controller.addRemoveKeyframe();
}
oldMouseX = mouseX
......@@ -432,6 +438,7 @@ Item {
}
onPressed: {
if (root.iskeyframe == false && controller.autoKeyframe) {
console.log('ADDREMOVE BLAND PRESSED')
controller.addRemoveKeyframe();
}
oldMouseX = mouseX
......@@ -502,6 +509,7 @@ Item {
}
onPressed: {
if (root.iskeyframe == false && controller.autoKeyframe) {
console.log('ADDREMOVE BRHAND PRESSED')
controller.addRemoveKeyframe();
}
oldMouseX = mouseX
......@@ -569,6 +577,7 @@ Item {
onExited: { framerect.hoverColor = '#ffffff'}
onPressed: {
if (root.iskeyframe == false && controller.autoKeyframe) {
console.log('ADDREMOVE CENTER PRESSED')
controller.addRemoveKeyframe();
}
oldMouseX = mouseX
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment