self->setSpline(QString(data));
}
-RotoWidget::RotoWidget(QString data, Monitor *monitor, ItemInfo info, Timecode t, QWidget* parent) :
+RotoWidget::RotoWidget(const QString &data, Monitor *monitor, const ItemInfo &info, const Timecode &t, QWidget* parent) :
QWidget(parent),
m_monitor(monitor),
m_showScene(true),
l->addWidget(m_keyframeWidget);
MonitorEditWidget *edit = monitor->getEffectEdit();
- edit->showVisibilityButton(true);
m_scene = edit->getScene();
+ m_scene->cleanup();
m_item = new SplineItem(QList <BPoint>(), NULL, m_scene);
connect(m_item, SIGNAL(changed(bool)), this, SLOT(slotUpdateData(bool)));
- connect(edit, SIGNAL(showEdit(bool)), this, SLOT(slotShowScene(bool)));
- connect(m_monitor, SIGNAL(renderPosition(int)), this, SLOT(slotCheckMonitorPosition(int)));
connect(m_keyframeWidget, SIGNAL(positionChanged(int)), this, SLOT(slotPositionChanged(int)));
connect(m_keyframeWidget, SIGNAL(keyframeAdded(int)), this, SLOT(slotAddKeyframe(int)));
connect(m_keyframeWidget, SIGNAL(keyframeRemoved(int)), this, SLOT(slotRemoveKeyframe(int)));
setSpline(data, false);
setupTrackingListen(info);
+ m_scene->centerView();
}
RotoWidget::~RotoWidget()
if (m_monitor) {
MonitorEditWidget *edit = m_monitor->getEffectEdit();
- edit->showVisibilityButton(false);
edit->removeCustomControls();
- m_monitor->slotEffectScene(false);
+ m_monitor->slotShowEffectScene(false);
}
}
-void RotoWidget::slotCheckMonitorPosition(int renderPos)
-{
- if (m_showScene)
- emit checkMonitorPosition(renderPos);
-}
-
void RotoWidget::slotSyncPosition(int relTimelinePos)
{
relTimelinePos = qBound(0, relTimelinePos, m_out);
slotPositionChanged(relTimelinePos, false);
}
-void RotoWidget::slotShowScene(bool show)
-{
- m_showScene = show;
- if (!m_showScene)
- m_monitor->slotEffectScene(false);
- else
- slotCheckMonitorPosition(m_monitor->render->seekFramePosition());
-}
-
void RotoWidget::slotUpdateData(int pos, bool editing)
{
Q_UNUSED(editing)
map[QString::number((pos < 0 ? m_keyframeWidget->getPosition() : pos) + m_in).rightJustified(log10((double)m_out) + 1, '0')] = QVariant(vlist);
m_data = QVariant(map);
} else {
+ // timeline update is only required if the first keyframe did not exist yet
+ bool update = m_data.isNull();
m_data = QVariant(vlist);
+ if (update) {
+ keyframeTimelineFullUpdate();
+ }
}
emit valueChanged();
m_data = QVariant(map);*/
} else {
// static (only one keyframe)
- m_keyframeWidget->setKeyframes(QList <int>() << 0);
+ // make sure the first keyframe was already created
+ if (m_data.isValid()) {
+ m_keyframeWidget->setKeyframes(QList <int>() << 0);
+ }
}
}
-void RotoWidget::setupTrackingListen(ItemInfo info)
+void RotoWidget::setupTrackingListen(const ItemInfo &info)
{
if (info.startPos < GenTime()) {
// TODO: track effects
delete clip;
}
-void RotoWidget::setSpline(QString spline, bool notify)
+void RotoWidget::setSpline(const QString &spline, bool notify)
{
QJson::Parser parser;
bool ok;