if (m_mltConsumer && !m_mltConsumer->is_stopped()) {
kDebug() << "///////////// RENDER STOPPED: " << m_name;
m_isBlocked = true;
- m_mltConsumer->set("refresh", 0);
+ //m_mltConsumer->set("refresh", 0);
m_mltConsumer->stop();
// delete m_mltConsumer;
// m_mltConsumer = NULL;
if (!m_mltProducer || !m_mltConsumer)
return;
m_isBlocked = false;
+ if (!m_isZoneMode) m_originalOut = m_mltProducer->get_playtime() - 1;
m_mltProducer->set("out", stopTime.frames(m_fps));
m_mltProducer->seek((int)(startTime.frames(m_fps)));
m_mltProducer->set_speed(1.0);
}
void Render::resetZoneMode() {
- m_mltProducer->set("out", m_mltProducer->get_length() - 1);
+ if (!m_isZoneMode && !m_isLoopMode) return;
+ m_mltProducer->set("out", m_originalOut);
//m_mltProducer->set("eof", "pause");
m_isZoneMode = false;
m_isLoopMode = false;
return newLength;
}
-bool Render::mltRemoveEffect(int track, GenTime position, QString index, bool doRefresh) {
-
+bool Render::mltRemoveEffect(int track, GenTime position, QString index, bool updateIndex, bool doRefresh) {
+ kDebug() << "// TRYing to remove effect at: " << index;
Mlt::Service service(m_mltProducer->parent().get_service());
bool success = false;
Mlt::Tractor tractor(service);
if ((index == "-1" && filter->get("kdenlive_id") != "") || filter->get("kdenlive_ix") == index) {// && filter->get("kdenlive_id") == id) {
if (clipService.detach(*filter) == 0) success = true;
kDebug() << " / / / DLEETED EFFECT: " << ct;
- } else {
+ } 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);
ct++;
- }
+ } else ct++;
filter = clipService.filter(ct);
}
m_isBlocked = false;
if (!params.paramValue("keyframes").isEmpty() || /*it.key().startsWith("#") || */tag.startsWith("ladspa") || tag == "sox" || tag == "autotrack_rectangle") {
// This is a keyframe effect, to edit it, we remove it and re-add it.
- mltRemoveEffect(track, position, index);
+ mltRemoveEffect(track, position, index, true);
bool success = mltAddEffect(track, position, params);
return success;
}
int clipNb = trackPlaylist.count();
//kDebug() << "// PARSING SCENE TRACK: " << t << ", CLIPS: " << clipNb;
for (int i = 0; i < clipNb; i++) {
- Mlt::Producer nprod(trackPlaylist.get_clip(i)->get_parent());
- if (nprod.is_valid() && !nprod.is_blank() && !ids.contains(nprod.get("id"))) {
- ids.append(nprod.get("id"));
- prods.append(&nprod);
+ Mlt::Producer *nprod = new Mlt::Producer(trackPlaylist.get_clip(i)->get_parent());
+ if (nprod && !nprod->is_blank() && !ids.contains(nprod->get("id"))) {
+ ids.append(nprod->get("id"));
+ prods.append(nprod);
}
}
}
Mlt::Playlist trackPlaylist((mlt_playlist) trackProducer.get_service());
int clipNb = trackPlaylist.count();
for (int i = 0; i < clipNb; i++) {
- Mlt::Producer nprod(trackPlaylist.get_clip(i)->get_parent());
- if (nprod.is_valid() && !nprod.is_blank()) {
- QString id = nprod.get("id");
+ Mlt::Producer *nprod = new Mlt::Producer(trackPlaylist.get_clip(i)->get_parent());
+ if (nprod && !nprod->is_blank()) {
+ QString id = nprod->get("id");
if (id.startsWith("slowmotion:")) {
// this is a slowmotion producer, add it to the list
- QString url = nprod.get("resource");
+ QString url = nprod->get("resource");
if (!m_slowmotionProducers.contains(url)) {
- m_slowmotionProducers.insert(url, &nprod);
+ m_slowmotionProducers.insert(url, nprod);
}
}
}
void Render::updatePreviewSettings() {
kDebug() << "////// RESTARTING CONSUMER";
if (!m_mltConsumer || !m_mltProducer) return;
+ if (m_mltProducer->get_playtime() == 0) return;
Mlt::Service service(m_mltProducer->parent().get_service());
if (service.type() != tractor_type) return;
- m_mltConsumer->set("refresh", 0);
+ //m_mltConsumer->set("refresh", 0);
if (!m_mltConsumer->is_stopped()) m_mltConsumer->stop();
m_mltConsumer->purge();
QString scene = sceneList();