#include <QGraphicsRectItem>
#include <QMenu>
#include <QInputDialog>
+#include <QTimer>
-Geometryval::Geometryval(const MltVideoProfile profile, Timecode t, QPoint frame_size, int startPoint, QWidget* parent) :
+Geometryval::Geometryval(const MltVideoProfile &profile, const Timecode &t, const QPoint &frame_size, int startPoint, QWidget* parent) :
QWidget(parent),
m_profile(profile),
m_paramRect(NULL),
m_sceneview->setScene(m_scene);
m_dar = (m_profile.height * m_profile.display_aspect_num / (double) m_profile.display_aspect_den) / (double) m_profile.width;
- m_realWidth = (int)(profile.height * profile.display_aspect_num / (double) profile.display_aspect_den);
+ m_realWidth = (int)(profile.height * profile.display_aspect_num / (double) profile.display_aspect_den + 0.5);
QGraphicsRectItem *frameBorder = new QGraphicsRectItem(QRectF(0, 0, m_realWidth, profile.height));
frameBorder->setZValue(-1100);
frameBorder->setBrush(QColor(255, 255, 0, 30));
if (pos == -1) {
pos = m_timePos.getValue();
}
- kDebug() << "// POS CHANGED: " << pos << ", SEK: " << seek;
if (seek && KdenliveSettings::transitionfollowcursor()) emit seekToPos(pos + m_startPoint);
m_timePos.setValue(pos);
//spinPos->setValue(pos);
label_opacity->setHidden(true);
spinTransp->setHidden(true);
}
- char *tmp = (char *) qstrdup(val.toUtf8().data());
- if (m_geom) m_geom->parse(tmp, maxFrame - minFrame, m_profile.width, m_profile.height);
- else m_geom = new Mlt::Geometry(tmp, maxFrame - minFrame, m_profile.width, m_profile.height);
- delete[] tmp;
+ if (m_geom)
+ m_geom->parse(val.toUtf8().data(), maxFrame - minFrame, m_profile.width, m_profile.height);
+ else
+ m_geom = new Mlt::Geometry(val.toUtf8().data(), maxFrame - minFrame, m_profile.width, m_profile.height);
//kDebug() << " / / UPDATING TRANSITION VALUE: " << m_geom->serialise();
//read param her and set rect
slotUpdateGeometry();
if (!m_fixedMode) {
m_timePos.setRange(0, maxFrame - minFrame - 1);
- connect(&m_timePos, SIGNAL(editingFinished()), this , SLOT(slotPositionChanged()));
+ connect(&m_timePos, SIGNAL(timeCodeEditingFinished()), this , SLOT(slotPositionChanged()));
}
connect(spinTransp, SIGNAL(valueChanged(int)), this , SLOT(slotTransparencyChanged(int)));
}
+void Geometryval::slotSyncPosition(int relTimelinePos)
+{
+ if (m_timePos.maximum() > 0 && KdenliveSettings::transitionfollowcursor()) {
+ relTimelinePos = qMax(0, relTimelinePos);
+ relTimelinePos = qMin(relTimelinePos, m_timePos.maximum());
+ if (relTimelinePos != m_timePos.getValue())
+ slotPositionChanged(relTimelinePos, false);
+ }
+}
+
void Geometryval::updateTransitionPath()
{
if (m_fixedMode) return;
}
}
-void Geometryval::setFrameSize(QPoint p)
+void Geometryval::setFrameSize(const QPoint &p)
{
m_frameSize = p;
}
{
slotPositionChanged(pos);
slotUpdateTransitionProperties();
+ QTimer::singleShot(100, this, SIGNAL(parameterChanged()));
}
void Geometryval::slotSwitchOptions()
}
+void Geometryval::slotUpdateRange(int inPoint, int outPoint)
+{
+ m_helper->setKeyGeometry(m_geom, outPoint - inPoint - 1);
+ m_helper->update();
+ m_timePos.setRange(0, outPoint - inPoint - 1);
+}
+#include "geometryval.moc"