GeometryWidget *geometry = new GeometryWidget(m_monitor, m_timecode, pos, isEffect, this);
// connect this before setupParam to make sure the monitor scene shows up at startup
connect(geometry, SIGNAL(checkMonitorPosition(int)), this, SIGNAL(checkMonitorPosition(int)));
+ connect(geometry, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
if (minFrame == maxFrame)
geometry->setupParam(pa, m_in, m_out);
else
geometry->setupParam(pa, minFrame, maxFrame);
m_vbox->addWidget(geometry);
m_valueItems[paramName+"geometry"] = geometry;
- connect(geometry, SIGNAL(parameterChanged()), this, SLOT(collectAllParameters()));
connect(geometry, SIGNAL(seekToPos(int)), this, SIGNAL(seekTimeline(int)));
connect(this, SIGNAL(syncEffectsPos(int)), geometry, SLOT(slotSyncPosition(int)));
} else {
m_geometry = new Mlt::Geometry(tmp, maxframe - minframe, m_monitor->render->renderWidth(), m_monitor->render->renderHeight());
delete[] tmp;
+ // remove keyframes out of range
+ Mlt::GeometryItem invalidItem;
+ bool foundInvalidItem = false;
+ while (!m_geometry->next_key(&invalidItem, maxframe - minframe)) {
+ foundInvalidItem = true;
+ m_geometry->remove(invalidItem.frame());
+ }
+
if (elem.attribute("fixed") == "1") {
// Keyframes are disabled
m_ui.widgetTimeWrapper->setHidden(true);
slotPositionChanged(0, false);
slotCheckMonitorPosition(m_monitor->render->seekFramePosition());
+
+ // update if we had to remove a keyframe which got out of range
+ if (foundInvalidItem)
+ QTimer::singleShot(300, this, SIGNAL(parameterChanged()));
}
void GeometryWidget::slotSyncPosition(int relTimelinePos)
void GeometryWidget::slotPositionChanged(int pos, bool seek)
{
- if (pos == -1)
+ if (pos == -1) {
pos = m_timePos->getValue();
-
- m_timePos->setValue(pos);
- m_timeline->blockSignals(true);
- m_timeline->setValue(pos);
- m_timeline->blockSignals(false);
+ m_timeline->blockSignals(true);
+ m_timeline->setValue(pos);
+ m_timeline->blockSignals(false);
+ } else {
+ m_timePos->setValue(pos);
+ }
Mlt::GeometryItem item;
if (m_geometry->fetch(&item, pos) || item.key() == false) {