if (e.attribute("type") == "keyframe" || e.attribute("type") == "simplekeyframe") {
if (e.attribute("keyframes").isEmpty()) {
// Effect has a keyframe type parameter, we need to set the values
- e.setAttribute("keyframes", QString::number((int) cropStart().frames(m_fps)) + ':' + e.attribute("default"));
+ e.setAttribute("keyframes", QString::number((int) cropStart().frames(m_fps)) + '=' + e.attribute("default"));
}
else if (offset != 0) {
// adjust keyframes to this clip
// Simple keyframes
const QStringList list = keyframes.split(QLatin1Char(';'), QString::SkipEmptyParts);
foreach(const QString &keyframe, list) {
- const int pos = keyframe.section(':', 0, 0).toInt() - offset;
- const QString newKey = QString::number(pos) + ":" + keyframe.section(':', 1);
+ const int pos = keyframe.section('=', 0, 0).toInt() - offset;
+ const QString newKey = QString::number(pos) + "=" + keyframe.section('=', 1);
result.append(newKey);
}
return result.join(";");
// go through all keyframes for one param
foreach(const QString &str, keyframes) {
- int pos = str.section(':', 0, 0).toInt();
- double val = locale.toDouble(str.section(':', 1, 1));
+ int pos = str.section('=', 0, 0).toInt();
+ double val = locale.toDouble(str.section('=', 1, 1));
if (pos - start < 0) {
// a keyframe is defined before the start of the clip
cutKeyFrame = true;
int diff = pos - lastPos;
double ratio = (double)(start - lastPos) / diff;
int newValue = lastValue + (val - lastValue) * ratio;
- newKeyFrames.append(QString::number(start) + ':' + QString::number(newValue));
+ newKeyFrames.append(QString::number(start) + '=' + QString::number(newValue));
modified = true;
}
cutKeyFrame = false;
if (diff != 0) {
double ratio = (double)(end - lastPos) / diff;
int newValue = lastValue + (val - lastValue) * ratio;
- newKeyFrames.append(QString::number(end) + ':' + QString::number(newValue));
+ newKeyFrames.append(QString::number(end) + '=' + QString::number(newValue));
modified = true;
}
break;
} else {
- newKeyFrames.append(QString::number(pos) + ':' + QString::number(val));
+ newKeyFrames.append(QString::number(pos) + '=' + QString::number(val));
}
}
lastPos = pos;
// parse keyframes
const QStringList keyframes = e.attribute("keyframes").split(';', QString::SkipEmptyParts);
foreach(const QString &str, keyframes) {
- int pos = str.section(':', 0, 0).toInt();
- double val = locale.toDouble(str.section(':', 1, 1));
+ int pos = str.section('=', 0, 0).toInt();
+ double val = locale.toDouble(str.section('=', 1, 1));
m_keyframes[pos] = val;
}
if (m_keyframes.find(m_editedKeyframe) == m_keyframes.end()) m_editedKeyframe = -1;
// parse keyframes
const QStringList keyframes = e.attribute("keyframes").split(';', QString::SkipEmptyParts);
foreach(const QString &str, keyframes) {
- int pos = str.section(':', 0, 0).toInt();
- double val = locale.toDouble(str.section(':', 1, 1));
+ int pos = str.section('=', 0, 0).toInt();
+ double val = locale.toDouble(str.section('=', 1, 1));
m_keyframes[pos] = val;
}
if (m_keyframes.find(m_editedKeyframe) == m_keyframes.end())
if (m_keyframes.count() > 0) {
QMap<int, int>::const_iterator i = m_keyframes.constBegin();
while (i != m_keyframes.constEnd()) {
- keyframes.append(QString::number(i.key()) + ':' + QString::number(i.value()) + ';');
+ keyframes.append(QString::number(i.key()) + '=' + QString::number(i.value()) + ';');
++i;
}
}
double offset = e.attribute("offset", "0").toDouble();
if (factor != 1 || offset != 0) {
for (int j = 0; j < values.count(); j++) {
- QString pos = values.at(j).section(':', 0, 0);
- double val = (locale.toDouble(values.at(j).section(':', 1, 1)) - offset) / factor;
+ QString pos = values.at(j).section('=', 0, 0);
+ double val = (locale.toDouble(values.at(j).section('=', 1, 1)) - offset) / factor;
values[j] = pos + '=' + locale.toString(val);
}
}
QStringList newkfr;
bool added = false;
foreach(const QString &str, keyframes) {
- int kpos = str.section(':', 0, 0).toInt();
- double newval = locale.toDouble(str.section(':', 1, 1));
+ int kpos = str.section('=', 0, 0).toInt();
+ double newval = locale.toDouble(str.section('=', 1, 1));
if (kpos < pos) {
newkfr.append(str);
} else if (!added) {
if (i == m_visibleParam)
- newkfr.append(QString::number(pos) + ':' + QString::number(val));
+ newkfr.append(QString::number(pos) + '=' + QString::number(val));
else
- newkfr.append(QString::number(pos) + ':' + locale.toString(newval));
+ newkfr.append(QString::number(pos) + '=' + locale.toString(newval));
if (kpos > pos) newkfr.append(str);
added = true;
} else newkfr.append(str);
}
if (!added) {
if (i == m_visibleParam)
- newkfr.append(QString::number(pos) + ':' + QString::number(val));
+ newkfr.append(QString::number(pos) + '=' + QString::number(val));
else
- newkfr.append(QString::number(pos) + ':' + e.attribute("default"));
+ newkfr.append(QString::number(pos) + '=' + e.attribute("default"));
}
e.setAttribute("keyframes", newkfr.join(";"));
}
const QStringList keyframes = kfr.split(';', QString::SkipEmptyParts);
QStringList newkfr;
foreach(const QString &str, keyframes) {
- if (str.section(':', 0, 0).toInt() != oldpos) {
+ if (str.section('=', 0, 0).toInt() != oldpos) {
newkfr.append(str);
} else if (newpos != -1) {
newpos = qMax(newpos, start);
newpos = qMin(newpos, end);
if (i == m_visibleParam)
- newkfr.append(QString::number(newpos) + ':' + locale.toString(value));
+ newkfr.append(QString::number(newpos) + '=' + locale.toString(value));
else
- newkfr.append(QString::number(newpos) + ':' + str.section(':', 1, 1));
+ newkfr.append(QString::number(newpos) + '=' + str.section('=', 1, 1));
}
}
e.setAttribute("keyframes", newkfr.join(";"));
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();
- double val = locale.toDouble(str.section(':', 1, 1));
+ int pos = str.section('=', 0, 0).toInt();
+ double val = locale.toDouble(str.section('=', 1, 1));
m_keyframes[pos] = val;
}
if (!m_keyframes.contains(m_selectedKeyframe)) m_selectedKeyframe = -1;
const QStringList data = parameter.attribute("keyframes").split(';', QString::SkipEmptyParts);
QMap <int, double> keyframes;
foreach (QString keyframe, data) {
- int keyframepos = keyframe.section(':', 0, 0).toInt();
+ int keyframepos = keyframe.section('=', 0, 0).toInt();
// if keyframe was at clip start, update it
if (keyframepos == oldin) {
keyframepos = in;
keyFrameUpdated = true;
}
- keyframes[keyframepos] = locale.toDouble(keyframe.section(':', 1, 1));
+ keyframes[keyframepos] = locale.toDouble(keyframe.section('=', 1, 1));
}
QString newkfr;
QMap<int, double>::const_iterator k = keyframes.constBegin();
while (k != keyframes.constEnd()) {
- newkfr.append(QString::number(k.key()) + ':' + QString::number(qRound(k.value())) + ';');
+ newkfr.append(QString::number(k.key()) + '=' + QString::number(qRound(k.value())) + ';');
++k;
}
parameter.setAttribute("keyframes", newkfr);
QStringList keys = e.attribute("keyframes").split(';', QString::SkipEmptyParts);
QStringList newKeyFrames;
foreach(const QString &str, keys) {
- int pos = str.section(':', 0, 0).toInt();
- double val = str.section(':', 1, 1).toDouble();
+ int pos = str.section('=', 0, 0).toInt();
+ double val = str.section('=', 1, 1).toDouble();
pos += diff;
if (pos > max) {
- newKeyFrames.append(QString::number(max) + ':' + locale.toString(val));
+ newKeyFrames.append(QString::number(max) + '=' + locale.toString(val));
break;
- } else newKeyFrames.append(QString::number(pos) + ':' + locale.toString(val));
+ } else newKeyFrames.append(QString::number(pos) + '=' + locale.toString(val));
}
//kDebug()<<"ORIGIN: "<<keys<<", FIXED: "<<newKeyFrames;
e.setAttribute("keyframes", newKeyFrames.join(";"));
double factor = e.attribute("factor", "1").toDouble();
double offset = e.attribute("offset", "0").toDouble();
for (int j = 0; j < values.count(); j++) {
- QString pos = values.at(j).section(':', 0, 0);
- double val = (values.at(j).section(':', 1, 1).toDouble() - offset) / factor;
+ QString pos = values.at(j).section('=', 0, 0);
+ double val = (values.at(j).section('=', 1, 1).toDouble() - offset) / factor;
values[j] = pos + '=' + locale.toString(val);
}
// kDebug() << "/ / / /SENDING KEYFR:" << values;
if (ui.import_position->isChecked()) {
if (ui.import_size->isChecked()) {
foreach(QString key, keyframeList) {
- if (key.count(':') > 1) result.append(key.section(':', 0, 1));
+ if (key.count('=') > 1) result.append(key.section('=', 0, 1));
else result.append(key);
result.append(';');
}
}
else {
foreach(QString key, keyframeList) {
- result.append(key.section(':', 0, 0));
+ result.append(key.section('=', 0, 0));
result.append(';');
}
}
}
else if (ui.import_size->isChecked()) {
foreach(QString key, keyframeList) {
- result.append(key.section(':', 1, 1));
+ result.append(key.section('=', 1, 1));
result.append(';');
}
}
QStringList frames = e.attribute("keyframes").split(';', QString::SkipEmptyParts);
for (int i = 0; i < frames.count(); ++i) {
- int frame = frames.at(i).section(':', 0, 0).toInt();
+ int frame = frames.at(i).section('=', 0, 0).toInt();
bool found = false;
int j;
for (j = 0; j < keyframe_list->rowCount(); j++) {
int currentPos = getPos(j);
if (frame == currentPos) {
- keyframe_list->setItem(j, columnId, new QTableWidgetItem(frames.at(i).section(':', 1, 1)));
+ keyframe_list->setItem(j, columnId, new QTableWidgetItem(frames.at(i).section('=', 1, 1)));
found = true;
break;
} else if (currentPos > frame) {
if (!found) {
keyframe_list->insertRow(j);
keyframe_list->setVerticalHeaderItem(j, new QTableWidgetItem(getPosString(frame)));
- keyframe_list->setItem(j, columnId, new QTableWidgetItem(frames.at(i).section(':', 1, 1)));
+ keyframe_list->setItem(j, columnId, new QTableWidgetItem(frames.at(i).section('=', 1, 1)));
keyframe_list->resizeRowToContents(j);
}
if ((activeKeyframe > -1) && (activeKeyframe == frame)) {
QString keyframes;
for (int i = 0; i < keyframe_list->rowCount(); ++i) {
if (keyframe_list->item(i, col))
- keyframes.append(QString::number(getPos(i)) + ':' + keyframe_list->item(i, col)->text() + ';');
+ keyframes.append(QString::number(getPos(i)) + '=' + keyframe_list->item(i, col)->text() + ';');
}
m_params[col].setAttribute("keyframes", keyframes);
}
QString keyframes;
for (int i = 0; i < keyframe_list->rowCount(); ++i) {
if (keyframe_list->item(i, column))
- keyframes.append(QString::number(getPos(i)) + ':' + keyframe_list->item(i, column)->text() + ';');
+ keyframes.append(QString::number(getPos(i)) + '=' + keyframe_list->item(i, column)->text() + ';');
}
m_params[column].setAttribute("keyframes", keyframes);
emit parameterChanged();
QString keyframes;
for (int i = 0; i < keyframe_list->rowCount(); ++i) {
if (keyframe_list->item(i, col))
- keyframes.append(QString::number(getPos(i)) + ':' + keyframe_list->item(i, col)->text() + ';');
+ keyframes.append(QString::number(getPos(i)) + '=' + keyframe_list->item(i, col)->text() + ';');
}
m_params[col].setAttribute("keyframes", keyframes);
}
Mlt::Filter *filter = new Mlt::Filter(*m_mltProfile, qstrdup(tag.toUtf8().constData()));
if (filter && filter->is_valid()) {
filter->set("kdenlive_id", qstrdup(params.paramValue("id").toUtf8().constData()));
- int x1 = keyFrames.at(0).section(':', 0, 0).toInt();
- double y1 = keyFrames.at(0).section(':', 1, 1).toDouble();
+ int x1 = keyFrames.at(0).section('=', 0, 0).toInt();
+ double y1 = keyFrames.at(0).section('=', 1, 1).toDouble();
for (int j = 0; j < params.count(); j++) {
filter->set(params.at(j).name().toUtf8().constData(), params.at(j).value().toUtf8().constData());
}
Mlt::Filter *filter = new Mlt::Filter(*m_mltProfile, qstrdup(tag.toUtf8().constData()));
if (filter && filter->is_valid()) {
filter->set("kdenlive_id", qstrdup(params.paramValue("id").toUtf8().constData()));
- int x1 = keyFrames.at(i).section(':', 0, 0).toInt() + offset;
- double y1 = keyFrames.at(i).section(':', 1, 1).toDouble();
- int x2 = keyFrames.at(i + 1).section(':', 0, 0).toInt();
- double y2 = keyFrames.at(i + 1).section(':', 1, 1).toDouble();
+ int x1 = keyFrames.at(i).section('=', 0, 0).toInt() + offset;
+ double y1 = keyFrames.at(i).section('=', 1, 1).toDouble();
+ int x2 = keyFrames.at(i + 1).section('=', 0, 0).toInt();
+ double y2 = keyFrames.at(i + 1).section('=', 1, 1).toDouble();
if (x2 == -1) x2 = duration;
for (int j = 0; j < params.count(); j++) {