if (m_info.cropStart > m_maxDuration) {
m_info.cropStart = GenTime();
m_info.cropDuration = qMin(m_info.cropDuration, m_maxDuration);
- updateRectGeometry();
} else {
m_info.cropDuration = m_maxDuration;
- updateRectGeometry();
}
+ updateRectGeometry();
}
}
}
QDomElement ClipItem::xml() const
{
- QDomElement xml = m_clip->toXML();
- if (m_speed != 1.0) xml.setAttribute("speed", m_speed);
- if (m_strobe > 1) xml.setAttribute("strobe", m_strobe);
- if (m_audioOnly) xml.setAttribute("audio_only", 1);
- else if (m_videoOnly) xml.setAttribute("video_only", 1);
- return xml;
+ itemXml();
}
QDomElement ClipItem::itemXml() const
painter->drawLine(l2);
}
if (painter->matrix().m11() == FRAME_SIZE) {
- int offset = (m_info.startPos + m_info.cropStart).frames(m_fps);
- doGetIntraThumbs(painter, mapped.topLeft(), m_info.cropStart.frames(m_fps), (int) mapToScene(exposed.left(), 0).x() - offset, (int) mapToScene(exposed.right(), 0).x() - offset);
+ int offset = (m_info.startPos - m_info.cropStart).frames(m_fps);
+ int left = qMax((int) m_info.startPos.frames(m_fps) + 1, (int) mapToScene(exposed.left(), 0).x());
+ int right = qMin((int)(m_info.startPos + m_info.cropDuration).frames(m_fps) - 1, (int) mapToScene(exposed.right(), 0).x());
+ doGetIntraThumbs(painter, mapped.topLeft(), m_info.cropStart.frames(m_fps), left - offset, right - offset);
}
painter->setPen(Qt::black);
}
GenTime pos;
for (int i = 0; i < markers.size(); i++) {
-
pos = GenTime((int)(markers.at(i).frames(m_fps) / qAbs(m_speed) + 0.5), m_fps) - cropStart();
if (pos > GenTime()) {
if (pos > cropDuration()) break;
pos = str.section(':', 0, 0).toInt();
val = str.section(':', 1, 1).toDouble();
if (pos == previous) {
+ // first or last keyframe
kfr[current] = val;
modified = true;
} else {
if ((fromStart && pos >= current) || (!fromStart && pos <= current)) {
+ // only keyframes in range
kfr[pos] = val;
modified = true;
}
void ClipItem::setSpeed(const double speed, const int strobe)
{
m_speed = speed;
- if (m_speed <= 0 && m_speed > -1)
- m_speed = 1.0;
+ if (m_speed <= 0 && m_speed > -1)
+ m_speed = 1.0;
m_strobe = strobe;
if (m_speed == 1.0) m_clipName = baseClip()->name();
else m_clipName = baseClip()->name() + " - " + QString::number(speed * 100, 'f', 0) + '%';