}
#endif
+
/*
* MLT playlist direct manipulation.
*/
int ct = 0;
Mlt::Filter *filter = sourceService.filter(ct);
while (filter) {
- if (filter->get("kdenlive_ix") != 0) {
+ if (filter->get_int("kdenlive_ix") != 0) {
filtersList.append(filter);
}
ct++;
int ct = 0;
Mlt::Filter *filter = sourceService.filter(ct);
while (filter) {
- if (filter->get("kdenlive_ix") != 0) {
+ if (filter->get_int("kdenlive_ix") != 0) {
sourceService.detach(*filter);
destService.attach(*filter);
} else ct++;
bool Render::mltRemoveTrackEffect(int track, QString index, bool updateIndex)
{
- kDebug() << "REMOVE TK EFF: " << track << ", IX: " << index;
Mlt::Service service(m_mltProducer->parent().get_service());
bool success = false;
Mlt::Tractor tractor(service);
int ct = 0;
Mlt::Filter *filter = clipService.filter(ct);
while (filter) {
- if ((index == "-1" && strcmp(filter->get("kdenlive_id"), "")) || filter->get("kdenlive_ix") == index) {
+ if ((index == "-1" && strcmp(filter->get("kdenlive_id"), "")) || QString(filter->get("kdenlive_ix")) == index) {
if (clipService.detach(*filter) == 0) success = true;
} else if (updateIndex) {
// Adjust the other effects index
- if (QString(filter->get("kdenlive_ix")).toInt() > index.toInt()) filter->set("kdenlive_ix", QString(filter->get("kdenlive_ix")).toInt() - 1);
+ if (filter->get_int("kdenlive_ix") > index.toInt()) filter->set("kdenlive_ix", filter->get_int("kdenlive_ix") - 1);
ct++;
} else ct++;
filter = clipService.filter(ct);
int ct = 0;
Mlt::Filter *filter = clipService.filter(ct);
while (filter) {
- if ((index == "-1" && strcmp(filter->get("kdenlive_id"), "")) || filter->get("kdenlive_ix") == index) {// && filter->get("kdenlive_id") == id) {
+ if ((index == "-1" && strcmp(filter->get("kdenlive_id"), "")) || QString(filter->get("kdenlive_ix")) == index) {// && filter->get("kdenlive_id") == id) {
if (clipService.detach(*filter) == 0) success = true;
//kDebug()<<"Deleted filter id:"<<filter->get("kdenlive_id")<<", ix:"<<filter->get("kdenlive_ix")<<", SERVICE:"<<filter->get("mlt_service");
} else if (updateIndex) {
// Adjust the other effects index
- if (QString(filter->get("kdenlive_ix")).toInt() > index.toInt()) filter->set("kdenlive_ix", QString(filter->get("kdenlive_ix")).toInt() - 1);
+ if (filter->get_int("kdenlive_ix") > index.toInt()) filter->set("kdenlive_ix", filter->get_int("kdenlive_ix") - 1);
ct++;
} else ct++;
filter = clipService.filter(ct);
int ct = 0;
Mlt::Filter *filter = service.filter(ct);
while (filter) {
- if (QString(filter->get("kdenlive_ix")).toInt() == filter_ix) {
+ if (filter->get_int("kdenlive_ix") == filter_ix) {
// A filter at that position already existed, so we will increase all indexes later
updateIndex = true;
break;
ct = 0;
filter = service.filter(ct);
while (filter) {
- if (QString(filter->get("kdenlive_ix")).toInt() >= filter_ix) {
- if (updateIndex) filter->set("kdenlive_ix", QString(filter->get("kdenlive_ix")).toInt() + 1);
+ if (filter->get_int("kdenlive_ix") >= filter_ix) {
+ if (updateIndex) filter->set("kdenlive_ix", filter->get_int("kdenlive_ix") + 1);
}
ct++;
filter = service.filter(ct);
ct = 0;
filter = service.filter(ct);
while (filter) {
- if (QString(filter->get("kdenlive_ix")).toInt() >= filter_ix) {
+ if (filter->get_int("kdenlive_ix") >= filter_ix) {
filtersList.append(filter);
service.detach(*filter);
} else ct++;
for (int i = 0; i < filtersList.count(); i++) {
Mlt::Filter *filter = filtersList.at(i);
if (updateIndex)
- filter->set("kdenlive_ix", QString(filter->get("kdenlive_ix")).toInt() + 1);
+ filter->set("kdenlive_ix", filter->get_int("kdenlive_ix") + 1);
service.attach(*filter);
}
m_isBlocked = false;
bool Render::mltEditTrackEffect(int track, EffectsParameterList params)
{
- kDebug() << "EDIT TK, FILTER: " << track;
Mlt::Service service(m_mltProducer->parent().get_service());
Mlt::Tractor tractor(service);
Mlt::Producer trackProducer(tractor.track(track));
Mlt::Filter *filter = clipService.filter(ct);
while (filter) {
- if (filter->get("kdenlive_ix") == index) {
+ if (QString(filter->get("kdenlive_ix")) == index) {
break;
}
ct++;
if (!params.paramValue("keyframes").isEmpty() || /*it.key().startsWith("#") || */tag.startsWith("ladspa") || tag == "sox" || tag == "autotrack_rectangle" || params.hasParam("region")) {
// This is a keyframe effect, to edit it, we remove it and re-add it.
- mltRemoveEffect(track, position, index, false);
- bool success = mltAddEffect(track, position, params);
+ bool success = mltRemoveEffect(track, position, index, false);
+ if (!success) kDebug() << "// ERROR Removing effect : " << index;
+ success = mltAddTrackEffect(track, params);
+ if (!success) kDebug() << "// ERROR Adding effect : " << index;
return success;
}
if (position < GenTime()) {
Mlt::Filter *filter = clipService.filter(ct);
while (filter) {
- if (filter->get("kdenlive_ix") == index) {
+ if (QString(filter->get("kdenlive_ix")) == index) {
break;
}
ct++;
int ct = 0;
Mlt::Filter *filter = clipService.filter(ct);
while (filter) {
- int pos = QString(filter->get("kdenlive_ix")).toInt();
+ int pos = filter->get_int("kdenlive_ix");
if (pos == oldPos) {
filter->set("kdenlive_ix", newPos);
} else ct++;
bool found = false;
if (newPos > oldPos) {
while (filter) {
- if (!found && QString(filter->get("kdenlive_ix")).toInt() == oldPos) {
+ if (!found && filter->get_int("kdenlive_ix") == oldPos) {
filter->set("kdenlive_ix", newPos);
filtersList.append(filter);
clipService.detach(*filter);
filter = clipService.filter(ct);
- while (filter && QString(filter->get("kdenlive_ix")).toInt() <= newPos) {
- filter->set("kdenlive_ix", QString(filter->get("kdenlive_ix")).toInt() - 1);
+ while (filter && filter->get_int("kdenlive_ix") <= newPos) {
+ filter->set("kdenlive_ix", filter->get_int("kdenlive_ix") - 1);
ct++;
filter = clipService.filter(ct);
}
found = true;
}
- if (filter && QString(filter->get("kdenlive_ix")).toInt() > newPos) {
+ if (filter && filter->get_int("kdenlive_ix") > newPos) {
filtersList.append(filter);
clipService.detach(*filter);
} else ct++;
}
} else {
while (filter) {
- if (QString(filter->get("kdenlive_ix")).toInt() == oldPos) {
+ if (filter->get_int("kdenlive_ix") == oldPos) {
filter->set("kdenlive_ix", newPos);
filtersList.append(filter);
clipService.detach(*filter);
ct = 0;
filter = clipService.filter(ct);
while (filter) {
- int pos = QString(filter->get("kdenlive_ix")).toInt();
+ int pos = filter->get_int("kdenlive_ix");
if (pos >= newPos) {
if (pos < oldPos) filter->set("kdenlive_ix", pos + 1);
filtersList.append(filter);
bool found = false;
if (newPos > oldPos) {
while (filter) {
- if (!found && QString(filter->get("kdenlive_ix")).toInt() == oldPos) {
+ if (!found && filter->get_int("kdenlive_ix") == oldPos) {
filter->set("kdenlive_ix", newPos);
filtersList.append(filter);
clipService.detach(*filter);
filter = clipService.filter(ct);
- while (filter && QString(filter->get("kdenlive_ix")).toInt() <= newPos) {
- filter->set("kdenlive_ix", QString(filter->get("kdenlive_ix")).toInt() - 1);
+ while (filter && filter->get_int("kdenlive_ix") <= newPos) {
+ filter->set("kdenlive_ix", filter->get_int("kdenlive_ix") - 1);
ct++;
filter = clipService.filter(ct);
}
found = true;
}
- if (filter && QString(filter->get("kdenlive_ix")).toInt() > newPos) {
+ if (filter && filter->get_int("kdenlive_ix") > newPos) {
filtersList.append(filter);
clipService.detach(*filter);
} else ct++;
}
} else {
while (filter) {
- if (QString(filter->get("kdenlive_ix")).toInt() == oldPos) {
+ if (filter->get_int("kdenlive_ix") == oldPos) {
filter->set("kdenlive_ix", newPos);
filtersList.append(filter);
clipService.detach(*filter);
ct = 0;
filter = clipService.filter(ct);
while (filter) {
- int pos = QString(filter->get("kdenlive_ix")).toInt();
+ int pos = filter->get_int("kdenlive_ix");
if (pos >= newPos) {
if (pos < oldPos) filter->set("kdenlive_ix", pos + 1);
filtersList.append(filter);