Fix effect compare in clip monitor not working for some clips (color, title)

parent 5eedc0dd
......@@ -27,6 +27,7 @@
#include "mltcontroller/bincontroller.h"
#include "kdenlivesettings.h"
#include "timeline/abstractclipitem.h"
#include "timeline/clip.h"
#include "dialogs/profilesdialog.h"
#include "doc/kthumb.h"
......@@ -1372,13 +1373,18 @@ void Monitor::slotSwitchCompare(bool enable)
warningMessage(i18n("The cairoblend transition is required for that feature, please install frei0r and restart Kdenlive"));
return;
}
Mlt::Producer original = m_controller->originalProducer();
Mlt::Producer *original = m_controller->masterProducer();
Mlt::Tractor trac(*profile());
Mlt::Producer clone(*profile(), original.get("resource"));
trac.set_track(original, 0);
trac.set_track(clone, 1);
clone.attach(*m_splitEffect);
Clip clp(*original);
Mlt::Producer *clone = clp.clone();
Clip clp2(*clone);
clp2.deleteEffects();
trac.set_track(*original, 0);
trac.set_track(*clone, 1);
clone->attach(*m_splitEffect);
trac.plant_transition(t, 0, 1);
delete clone;
delete original;
m_splitProducer = new Mlt::Producer(trac.get_producer());
render->setProducer(m_splitProducer, pos, isActive());
m_glMonitor->setSource(QUrl::fromLocalFile(QStandardPaths::locate(QStandardPaths::DataLocation, QStringLiteral("kdenlivemonitorsplit.qml"))));
......
......@@ -94,6 +94,24 @@ void Clip::replaceEffects(Mlt::Service& service)
addEffects(service);
}
void Clip::deleteEffects()
{
// remove effects
int ct = 0;
Mlt::Filter *filter = m_producer.filter(ct);
while (filter) {
QString ix = filter->get("kdenlive_ix");
if (!ix.isEmpty()) {
if (m_producer.detach(*filter) == 0) {
delete filter;
}
else ct++;
}
else ct++;
filter = m_producer.filter(ct);
}
}
QByteArray Clip::xml()
{
......
......@@ -40,6 +40,7 @@ public:
Clip& operator=(Clip& other);
QByteArray xml();
Mlt::Producer *clone();
void deleteEffects();
void addEffects(Mlt::Service& service);
void replaceEffects(Mlt::Service& service);
void delEffect(int index);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment