else requestClipThumbnail(parentItem->clipId() + '#' + QString::number(pos));
}
-void ProjectList::updateAllClips(bool displayRatioChanged, bool fpsChanged)
+void ProjectList::updateAllClips(bool displayRatioChanged, bool fpsChanged, QStringList brokenClips)
{
if (!m_allClipsProcessed) m_listView->setEnabled(false);
m_listView->setSortingEnabled(false);
item = static_cast <ProjectItem *>(*it);
clip = item->referencedClip();
if (item->referencedClip()->getProducer() == NULL) {
+ bool replace = false;
+ if (brokenClips.contains(item->clipId())) {
+ // if this is a proxy clip, disable proxy
+ item->setProxyStatus(NOPROXY);
+ clip->setProperty("proxy", "-");
+ replace = true;
+ }
if (clip->isPlaceHolder() == false && !item->isProxyRunning()) {
QDomElement xml = clip->toXML();
if (fpsChanged) {
xml.removeAttribute("file_hash");
xml.removeAttribute("proxy_out");
}
- bool replace = xml.attribute("replace") == "1";
+ if (!replace) replace = xml.attribute("replace") == "1";
if (replace) resetThumbsProducer(clip);
m_render->getFileProperties(xml, clip->getId(), m_listView->iconSize().height(), replace);
}
{
ProjectItem *item = getItemById(id);
if (item) {
+ kDebug()<<"// Proxy for clip "<<id<<" is invalid, delete";
item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsDropEnabled);
if (durationError) {
kDebug() << "Proxy duration is wrong, try changing transcoding parameters.";
if (proxyFolder.isParentOf(KUrl(path))) {
QFile::remove(path);
}
+ if (item->referencedClip()->getProducer() == NULL) {
+ // Clip has no valid producer, request it
+ slotProxyCurrentItem(false, item);
+ }
+ else {
+ // refresh thumbs producer
+ item->referencedClip()->reloadThumbProducer();
+ }
}
m_processingClips.removeAll(id);
m_thumbnailQueue.removeAll(id);
connect(m_doc->clipManager(), SIGNAL(modifiedClip(const QString &)), this, SLOT(slotModifiedClip(const QString &)));
connect(m_doc->clipManager(), SIGNAL(missingClip(const QString &)), this, SLOT(slotMissingClip(const QString &)));
connect(m_doc->clipManager(), SIGNAL(availableClip(const QString &)), this, SLOT(slotAvailableClip(const QString &)));
- connect(m_doc->clipManager(), SIGNAL(checkAllClips(bool, bool)), this, SLOT(updateAllClips(bool, bool)));
+ connect(m_doc->clipManager(), SIGNAL(checkAllClips(bool, bool, QStringList)), this, SLOT(updateAllClips(bool, bool, QStringList)));
}
QList <DocClipBase*> ProjectList::documentClipList() const
else delete command;
}
-void ProjectList::slotProxyCurrentItem(bool doProxy)
+void ProjectList::slotProxyCurrentItem(bool doProxy, ProjectItem *itemToProxy)
{
- QList<QTreeWidgetItem *> list = m_listView->selectedItems();
+ QList<QTreeWidgetItem *> list;
+ if (itemToProxy == NULL) list = m_listView->selectedItems();
+ else list << itemToProxy;
QTreeWidgetItem *listItem;
QUndoCommand *command = new QUndoCommand();
if (doProxy) command->setText(i18np("Add proxy clip", "Add proxy clips", list.count()));
ProjectItem *item = static_cast <ProjectItem*>(listItem);
CLIPTYPE t = item->clipType();
if ((t == VIDEO || t == AV || t == UNKNOWN || t == IMAGE || t == PLAYLIST) && item->referencedClip()) {
- if ((doProxy && item->hasProxy()) || (!doProxy && !item->hasProxy())) continue;
+ if ((doProxy && item->hasProxy()) || (!doProxy && !item->hasProxy() && item->referencedClip()->getProducer() != NULL)) continue;
DocClipBase *clip = item->referencedClip();
if (!clip || !clip->isClean() || m_render->isProcessing(item->clipId())) {
kDebug()<<"//// TRYING TO PROXY: "<<item->clipId()<<", but it is busy";
// We need to insert empty proxy so that undo will work
oldProps.insert("proxy", QString());
}
+ else if (item->referencedClip()->getProducer() == NULL) {
+ // Force clip reload
+ newProps.insert("resource", item->referencedClip()->getProperty("resource"));
+ }
new EditClipCommand(this, item->clipId(), oldProps, newProps, true, command);
}
}