| 355 | } |
| 356 | |
| 357 | QDomElement EffectStackModel::rowToXml(int row, QDomDocument &document) |
| 358 | { |
| 359 | QDomElement container = document.createElement(QStringLiteral("effects")); |
| 360 | if (row < 0 || row >= rootItem->childCount()) { |
| 361 | return container; |
| 362 | } |
| 363 | int currentIn = pCore->getItemIn(m_ownerId); |
| 364 | container.setAttribute(QStringLiteral("parentIn"), currentIn); |
| 365 | std::shared_ptr<EffectItemModel> sourceEffect = std::static_pointer_cast<EffectItemModel>(rootItem->child(row)); |
| 366 | QDomElement sub = document.createElement(QStringLiteral("effect")); |
| 367 | sub.setAttribute(QStringLiteral("id"), sourceEffect->getAssetId()); |
| 368 | int filterIn = sourceEffect->filter().get_int("in"); |
| 369 | int filterOut = sourceEffect->filter().get_int("out"); |
| 370 | if (filterOut > filterIn) { |
| 371 | sub.setAttribute(QStringLiteral("in"), filterIn); |
| 372 | sub.setAttribute(QStringLiteral("out"), filterOut); |
| 373 | } |
| 374 | QStringList passProps{QStringLiteral("disable"), QStringLiteral("kdenlive:collapsed"), QStringLiteral("kdenlive:builtin")}; |
| 375 | for (const QString ¶m : passProps) { |
| 376 | int paramVal = sourceEffect->filter().get_int(param.toUtf8().constData()); |
| 377 | if (paramVal > 0) { |
| 378 | Xml::setXmlProperty(sub, param, QString::number(paramVal)); |
| 379 | } |
| 380 | } |
| 381 | QVector<QPair<QString, QVariant>> params = sourceEffect->getAllParameters(); |
| 382 | for (const auto ¶m : std::as_const(params)) { |
| 383 | Xml::setXmlProperty(sub, param.first, param.second.toString()); |
| 384 | } |
| 385 | container.appendChild(sub); |
| 386 | return container; |
| 387 | } |
| 388 | |
| 389 | bool EffectStackModel::fromMltXml(const QDomElement &effectsXml) |
| 390 | { |
no test coverage detected