m_videoOnlyProducer = NULL;
}
-void DocClipBase::setProducer(Mlt::Producer *producer)
+void DocClipBase::setProducer(Mlt::Producer *producer, bool reset)
{
if (producer == NULL) return;
+ if (reset) {
+ // Clear all previous producers
+ deleteProducers();
+ }
QString id = producer->get("id");
if (id.contains('_')) {
// this is a subtrack producer, insert it at correct place
}
//m_clipProducer = producer;
//m_clipProducer->set("transparency", m_properties.value("transparency").toInt());
- if (m_thumbProd && !m_thumbProd->hasProducer()) m_thumbProd->setProducer(producer);
+ if (m_thumbProd && (reset || !m_thumbProd->hasProducer())) m_thumbProd->setProducer(producer);
}
Mlt::Producer *DocClipBase::audioProducer(int track)
}
/** Sets producers for the current clip (one for each track due to a limitation in MLT's track mixing */
- void setProducer(Mlt::Producer *producer);
+ void setProducer(Mlt::Producer *producer, bool reset = false);
/** Retrieve a producer for a track */
Mlt::Producer *producer(int track = -1);
/** Retrieve the producer that shows only video */
if (item->clipType() == IMAGE) {
item->referencedClip()->producer()->set("force_reload", 1);
}
- emit getFileProperties(item->toXml(), item->clipId(), false);
+ emit getFileProperties(item->toXml(), item->clipId(), true);
}
}
const QDomElement dom = i.value();
const QString id = i.key();
m_infoQueue.remove(i.key());
- emit getFileProperties(dom, id, true);
+ emit getFileProperties(dom, id, false);
}
if (m_infoQueue.isEmpty()) m_listView->setEnabled(true);
}
m_listView->blockSignals(true);
item->setProperties(properties, metadata);
Q_ASSERT_X(item->referencedClip(), "void ProjectList::slotReplyGetFileProperties", QString("Item with groupName %1 does not have a clip associated").arg(item->groupName()).toLatin1());
- if (replace) item->referencedClip()->setProducer(producer);
- else {
+ item->referencedClip()->setProducer(producer, replace);
+ emit receivedClipDuration(clipId);
+ if (replace) {
+ // update clip in clip monitor
+ emit clipSelected(NULL);
+ emit clipSelected(item->referencedClip());
+ }
+ /*else {
// Check if duration changed.
emit receivedClipDuration(clipId);
delete producer;
- }
+ }*/
m_listView->blockSignals(false);
} else kDebug() << "//////// COULD NOT FIND CLIP TO UPDATE PRPS...";
if (!m_infoQueue.isEmpty()) QTimer::singleShot(300, this, SLOT(slotProcessNextClipInQueue()));