//m_hover(false),
m_speed(speed),
m_strobe(strobe),
- m_framePixelWidth(0)
+ m_framePixelWidth(0),
+ m_limitedKeyFrames(false)
{
setZValue(2);
setRect(0, 0, (info.endPos - info.startPos).frames(fps) - 0.02, (double) itemHeight());
continue;
// Check if this effect has a variable parameter
- if (e.attribute("default").startsWith('%')) {
+ if (e.attribute("default").contains('%')) {
double evaluatedValue = ProfilesDialog::getStringEval(projectScene()->profile(), e.attribute("default"));
e.setAttribute("default", evaluatedValue);
if (e.hasAttribute("value") && e.attribute("value").startsWith('%')) {
QDomElement e = params.item(i).toElement();
if (!e.isNull() && (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe") && e.attribute("intimeline") == "1") {
m_keyframes.clear();
+ m_limitedKeyFrames = e.attribute("type") == "keyframe";
m_visibleParam = i;
double max = e.attribute("max").toDouble();
double min = e.attribute("min").toDouble();
painter->setPen(QPen(Qt::lightGray));
// draw effect or transition keyframes
- if (mapped.width() > 20) drawKeyFrames(painter, exposed);
+ if (mapped.width() > 20) drawKeyFrames(painter, m_limitedKeyFrames);
//painter->setMatrixEnabled(true);
}
} else {
double fact;
- if (e.attribute("factor").startsWith('%')) {
+ if (e.attribute("factor").contains('%')) {
fact = ProfilesDialog::getStringEval(projectScene()->profile(), e.attribute("factor"));
} else fact = e.attribute("factor", "1").toDouble();
parameters.addParam(e.attribute("name"), QString::number(e.attribute("value").toDouble() / fact));
setSelectedEffect(m_selectedEffect);
return;
}
+ m_limitedKeyFrames = e.attribute("type") == "keyframe";
const QStringList keyframes = e.attribute("keyframes").split(';', QString::SkipEmptyParts);
foreach(const QString &str, keyframes) {
int pos = str.section(':', 0, 0).toInt();
update();
}*/
-QList <int> ClipItem::updatePanZoom(int width, int height, int cut)
-{
- QList <int> effectPositions;
- for (int i = 0; i < m_effectList.count(); i++) {
- QDomElement effect = m_effectList.at(i);
- QDomNodeList params = effect.elementsByTagName("parameter");
- for (int j = 0; j < params.count(); j++) {
- QDomElement e = params.item(j).toElement();
- if (e.isNull())
- continue;
- if (e.attribute("type") == "geometry" && !e.hasAttribute("fixed")) {
- effectPositions << i;
-// updateGeometryKeyframes(effect, j, width, height, cut);
- }
- }
- }
-
- return effectPositions;
-}
-
Mlt::Producer *ClipItem::getProducer(int track, bool trackSpecific)
{
if (isAudioOnly())
void ClipItem::updateGeometryKeyframes(QDomElement effect, int paramIndex, int width, int height, ItemInfo oldInfo)
{
- QDomElement param = effect.elementsByTagName("parameter").item(paramIndex).toElement();
-
- Mlt::Geometry geometry(param.attribute("value").toUtf8().data(), oldInfo.cropDuration.frames(m_fps), width, height);
+ QDomElement param = effect.elementsByTagName("parameter").item(paramIndex).toElement();
+ int offset = oldInfo.cropStart.frames(m_fps);
+ QString data = param.attribute("value");
+ if (offset > 0) {
+ QStringList kfrs = data.split(';');
+ data.clear();
+ foreach (QString keyframe, kfrs) {
+ if (keyframe.contains('=')) {
+ int pos = keyframe.section('=', 0, 0).toInt();
+ pos += offset;
+ data.append(QString::number(pos) + "=" + keyframe.section('=', 1) + ";");
+ }
+ else data.append(keyframe + ";");
+ }
+ }
+ Mlt::Geometry geometry(data.toUtf8().data(), oldInfo.cropDuration.frames(m_fps), width, height);
param.setAttribute("value", geometry.serialise(cropStart().frames(m_fps), (cropStart() + cropDuration()).frames(m_fps) - 1));
}